From patchwork Thu Oct 24 14:05:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13849097 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9653FCE8E7A for ; Thu, 24 Oct 2024 14:06:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 00AAF6B0099; Thu, 24 Oct 2024 10:06:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EAD406B009B; Thu, 24 Oct 2024 10:06:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CFF506B009E; Thu, 24 Oct 2024 10:06:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id AC1076B0099 for ; Thu, 24 Oct 2024 10:06:31 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 60290812F5 for ; Thu, 24 Oct 2024 14:06:15 +0000 (UTC) X-FDA: 82708670436.23.2DCEDB4 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf27.hostedemail.com (Postfix) with ESMTP id 018AE40027 for ; Thu, 24 Oct 2024 14:06:10 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Rv3iecie; spf=pass (imf27.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729778585; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=2WJ3IwRH8RLBNIi0Kxo/o1E5+hUSf0Z9V2WPyhSRrlg=; b=ACkNpLXzTDYuj/P7SZNCQH4MS+JWj3Ml3RhwZJnnnkH6w08HDIktxNA/7vAdQxhIY+Rhey F3hD2Xbyfhw4YajDIC7W5QCaRSI2MyhE7ozrtvoMjRTrWXW/8zuxdvLiYjkETAGXCPhJHa LKVdCs9CcT9B8z7ew45nDpvy3avzgBQ= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Rv3iecie; spf=pass (imf27.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729778585; a=rsa-sha256; cv=none; b=0OEor50YKLfWdB2/LhBNqP6EYZKtl8TMs5I30rTfjiQLHh2XR+g/S41wDNqQvnkaoF61RZ D9H0sSS77HXpT8Bcn3Y5+sngbZMClfBeKoo1inAexK+gBXEeQ0SGhvaosedoFCVSn0kCsV Lg47HDu+3fxzVOdXyvy7gLYbkN8YFX0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729778789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2WJ3IwRH8RLBNIi0Kxo/o1E5+hUSf0Z9V2WPyhSRrlg=; b=Rv3iecieKtvfURDTBn6fT4Pt3FP9zJzNBg1ZiNBpgvHYQK9YxVoBFTji7FFCC1M8msmSn9 zllNo7diUVyHVvnCxrcfM32aBgYCm7lrYhCp7m/OnSqkWriqk8fwm88hP4V+z3YKrhFfkq Ued7lDT9if3uirJSgkBkczAM5k+6F+o= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-488-K1AZ-6hrP7ClMaUkBCUW0w-1; Thu, 24 Oct 2024 10:06:25 -0400 X-MC-Unique: K1AZ-6hrP7ClMaUkBCUW0w-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2FB241933195; Thu, 24 Oct 2024 14:06:21 +0000 (UTC) Received: from warthog.procyon.org.uk.com (unknown [10.42.28.231]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7C7D4195607C; Thu, 24 Oct 2024 14:06:13 +0000 (UTC) From: David Howells To: Christian Brauner , Steve French , Matthew Wilcox Cc: David Howells , Jeff Layton , Gao Xiang , Dominique Martinet , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Eric Van Hensbergen , Ilya Dryomov , netfs@lists.linux.dev, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Christian Brauner Subject: [PATCH 03/27] netfs: Remove unnecessary references to pages Date: Thu, 24 Oct 2024 15:05:01 +0100 Message-ID: <20241024140539.3828093-4-dhowells@redhat.com> In-Reply-To: <20241024140539.3828093-1-dhowells@redhat.com> References: <20241024140539.3828093-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 018AE40027 X-Stat-Signature: 5msgkmwduenbnftuafnbkfewhgdtkxm9 X-Rspam-User: X-HE-Tag: 1729778770-913480 X-HE-Meta: U2FsdGVkX1/VsGC8144hmj0xDKdv3bVZY766HqKHChxsfeQlt2OjkHqsaDNac4dVr1J230kxZTn23Ry0rhlai37KfqT+5lPtImGD18yc+gg6NnEXq/dMi+Ob21QrwOM6IwWa9QFx1Qev5C0wNvpJTd1T3SmLD2a43pcs2TVSgCETwihAWaw/36M40ReKylVftip+g6paQ/XDsmMhSwQ0tlEwloGR3X/MHYW0YVJutI9y3lx2l/AX/06K89xxoe7JmQAL33fvt11bCZlBpyFXkHdWPvO2uS02oYcu/s2D0n5ZViFAPElJuvU6KNmI9VgwkkpucKUuQImhhMLpiUbVJ+UU82908MWTbYSML2oVhqLHoZKmmSlgAApej1JYbLo4y1xA0Kn984YIyPZhOvcDeVzlwMh1U5/pQzW9/MuXrOPLhUgA92DUETYvwMEW+daSPiA+1WutG7PC+phiY5xzbBu5Qyaks9fIj65oFT5MbMucz/EglB4XTTg/0mjlc5+K/bkKtjbQn4I4fDQnYbO/kzvEthFgcazoSiliSCy70A11aGdNKfHN/PLtAflhciTvvUpRgsyVljkzKYcZfx3hDVMNAYkroPqCM0vCQ1yRb7B99zLUNA2FNpaaNmt4PKpybyuOumDKut/IBoswxODG1QVO/GyDyb7gvX++vZUVSHvBGqDxr/LOKbESiOKt0hoZJ1JUklUHFHQGN2YBQ6HIrUpr18WXlQfZgBMTr5ZlmL5Lg9HDSzavTKibVMKHIjXEikuc4Kj9UvSGOQHbhmKkL5H5zBMVVP7ybq3Ft6m+ymIc/kIwI9MuU+twPaV5TItC7nOHm8v4ZP+8oyeTeaT1XAAUZd9kIRg+FJ+SOwzDIJVv7UZ0chEavtoSEkMyCq35Lp7zprYGfhPhIyT4brlBERR1oiDVWfneiz767qfbO8WM5WPPgexXy4qA5PBJSH+THbU2K0nQZXN0ivi0Fnq j6UQVkgA Udpo+4ildLAlixpnFuvST6aC1eoJD+TLIO1ZqywLCHklgJxOb5Sv9BPnQxWkb9AmdnLzehXgnsW1ib9UAoyNE/ql57CIkYhwR/9SV/zsugusu8IDlgi2gAk+EtPqUXHhWGspsjrIK1e7s8pOrDhi9gzFsTCblDvf0ECpy1qlWir1oaUdLvhDeYfA6PYMT+BdGD0CPbpu550ThZwJSA2423sTtjxeJHdTAGuGK0mEui45/NKmX2/7pSkACKhP8Gzl3V7u++3x0WSCh9UsYyAHkZkV0lD2YigUBhAVTDVHdH7LJIiFcrJ8ksIBSZptlOz2EAltXWbB9eaWlMFcDcADKksdc0USt++FqDhNUKB8lsQgT/JuED7lHyLh6OQkiz7g4T/FB X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: "Matthew Wilcox (Oracle)" These places should all use folios instead of pages. Signed-off-by: Matthew Wilcox (Oracle) Link: https://lore.kernel.org/r/20241005182307.3190401-4-willy@infradead.org Signed-off-by: Christian Brauner --- fs/netfs/buffered_read.c | 8 ++++---- fs/netfs/buffered_write.c | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/fs/netfs/buffered_read.c b/fs/netfs/buffered_read.c index af46a598f4d7..7ac34550c403 100644 --- a/fs/netfs/buffered_read.c +++ b/fs/netfs/buffered_read.c @@ -627,7 +627,7 @@ static bool netfs_skip_folio_read(struct folio *folio, loff_t pos, size_t len, if (unlikely(always_fill)) { if (pos - offset + len <= i_size) return false; /* Page entirely before EOF */ - zero_user_segment(&folio->page, 0, plen); + folio_zero_segment(folio, 0, plen); folio_mark_uptodate(folio); return true; } @@ -646,7 +646,7 @@ static bool netfs_skip_folio_read(struct folio *folio, loff_t pos, size_t len, return false; zero_out: - zero_user_segments(&folio->page, 0, offset, offset + len, plen); + folio_zero_segments(folio, 0, offset, offset + len, plen); return true; } @@ -713,7 +713,7 @@ int netfs_write_begin(struct netfs_inode *ctx, if (folio_test_uptodate(folio)) goto have_folio; - /* If the page is beyond the EOF, we want to clear it - unless it's + /* If the folio is beyond the EOF, we want to clear it - unless it's * within the cache granule containing the EOF, in which case we need * to preload the granule. */ @@ -773,7 +773,7 @@ int netfs_write_begin(struct netfs_inode *ctx, EXPORT_SYMBOL(netfs_write_begin); /* - * Preload the data into a page we're proposing to write into. + * Preload the data into a folio we're proposing to write into. */ int netfs_prefetch_for_write(struct file *file, struct folio *folio, size_t offset, size_t len) diff --git a/fs/netfs/buffered_write.c b/fs/netfs/buffered_write.c index ff2814da88b1..b4826360a411 100644 --- a/fs/netfs/buffered_write.c +++ b/fs/netfs/buffered_write.c @@ -83,13 +83,13 @@ static void netfs_update_i_size(struct netfs_inode *ctx, struct inode *inode, * netfs_perform_write - Copy data into the pagecache. * @iocb: The operation parameters * @iter: The source buffer - * @netfs_group: Grouping for dirty pages (eg. ceph snaps). + * @netfs_group: Grouping for dirty folios (eg. ceph snaps). * - * Copy data into pagecache pages attached to the inode specified by @iocb. + * Copy data into pagecache folios attached to the inode specified by @iocb. * The caller must hold appropriate inode locks. * - * Dirty pages are tagged with a netfs_folio struct if they're not up to date - * to indicate the range modified. Dirty pages may also be tagged with a + * Dirty folios are tagged with a netfs_folio struct if they're not up to date + * to indicate the range modified. Dirty folios may also be tagged with a * netfs-specific grouping such that data from an old group gets flushed before * a new one is started. */ @@ -223,11 +223,11 @@ ssize_t netfs_perform_write(struct kiocb *iocb, struct iov_iter *iter, * we try to read it. */ if (fpos >= ctx->zero_point) { - zero_user_segment(&folio->page, 0, offset); + folio_zero_segment(folio, 0, offset); copied = copy_folio_from_iter_atomic(folio, offset, part, iter); if (unlikely(copied == 0)) goto copy_failed; - zero_user_segment(&folio->page, offset + copied, flen); + folio_zero_segment(folio, offset + copied, flen); __netfs_set_group(folio, netfs_group); folio_mark_uptodate(folio); trace_netfs_folio(folio, netfs_modify_and_clear); @@ -407,7 +407,7 @@ EXPORT_SYMBOL(netfs_perform_write); * netfs_buffered_write_iter_locked - write data to a file * @iocb: IO state structure (file, offset, etc.) * @from: iov_iter with data to write - * @netfs_group: Grouping for dirty pages (eg. ceph snaps). + * @netfs_group: Grouping for dirty folios (eg. ceph snaps). * * This function does all the work needed for actually writing data to a * file. It does all basic checks, removes SUID from the file, updates