linux/fs/nfs
David Howells 2ff1e97587 netfs: Replace PG_fscache by setting folio->private and marking dirty
When dirty data is being written to the cache, setting/waiting on/clearing
the fscache flag is always done in tandem with setting/waiting on/clearing
the writeback flag.  The netfslib buffered write routines wait on and set
both flags and the write request cleanup clears both flags, so the fscache
flag is almost superfluous.

The reason it isn't superfluous is because the fscache flag is also used to
indicate that data just read from the server is being written to the cache.
The flag is used to prevent a race involving overlapping direct-I/O writes
to the cache.

Change this to indicate that a page is in need of being copied to the cache
by placing a magic value in folio->private and marking the folios dirty.
Then when the writeback code sees a folio marked in this way, it only
writes it to the cache and not to the server.

If a folio that has this magic value set is modified, the value is just
replaced and the folio will then be uplodaded too.

With this, PG_fscache is no longer required by the netfslib core, 9p and
afs.

Ceph and nfs, however, still need to use the old PG_fscache-based tracking.
To deal with this, a flag, NETFS_ICTX_USE_PGPRIV2, now has to be set on the
flags in the netfs_inode struct for those filesystems.  This reenables the
use of PG_fscache in that inode.  9p and afs use the netfslib write helpers
so get switched over; cifs, for the moment, does page-by-page manual access
to the cache, so doesn't use PG_fscache and is unaffected.

Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
cc: Matthew Wilcox (Oracle) <willy@infradead.org>
cc: Eric Van Hensbergen <ericvh@kernel.org>
cc: Latchesar Ionkov <lucho@ionkov.net>
cc: Dominique Martinet <asmadeus@codewreck.org>
cc: Christian Schoenebeck <linux_oss@crudebyte.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Ilya Dryomov <idryomov@gmail.com>
cc: Xiubo Li <xiubli@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.com>
cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
cc: Shyam Prasad N <sprasad@microsoft.com>
cc: Tom Talpey <tom@talpey.com>
cc: Bharath SM <bharathsm@microsoft.com>
cc: Trond Myklebust <trond.myklebust@hammerspace.com>
cc: Anna Schumaker <anna@kernel.org>
cc: netfs@lists.linux.dev
cc: v9fs@lists.linux.dev
cc: linux-afs@lists.infradead.org
cc: ceph-devel@vger.kernel.org
cc: linux-cifs@vger.kernel.org
cc: linux-nfs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-mm@kvack.org
2024-04-29 15:01:42 +01:00
..
blocklayout nfs: port block device access to files 2024-02-25 12:05:26 +01:00
filelayout pnfs/filelayout: add tracepoint to getdeviceinfo 2024-02-28 16:18:19 -05:00
flexfilelayout nfs: fix panic when nfs4_ff_layout_prepare_ds() fails 2024-03-16 12:41:45 -04:00
cache_lib.c
cache_lib.h
callback.c nfsd: stop setting ->pg_stats for unused stats 2024-03-01 09:12:08 -05:00
callback.h NFS Client Updates for Linux 6.8 2024-01-10 16:13:57 -08:00
callback_proc.c NFSv4.1: if referring calls are complete, trust the stateid argument 2024-01-04 10:47:56 -05:00
callback_xdr.c NFSv4.1: Use the nfs_client's rpc timeouts for backchannel 2024-01-04 17:01:01 -05:00
client.c NFS: remove unused variable nfs_rpcstat 2024-03-09 09:14:51 -05:00
delegation.c NFS client updates for Linux 6.9 2024-03-16 11:44:00 -07:00
delegation.h NFSv4: fairly test all delegations on a SEQ4_ revocation 2023-11-01 15:15:52 -04:00
dir.c nfs: make nfs_set_verifier() safe for use in RCU pathwalk 2024-02-25 02:10:31 -05:00
direct.c NFS client updates for Linux 6.9 2024-03-16 11:44:00 -07:00
dns_resolve.c NFS: Move common includes outside ifdef 2023-08-24 13:24:15 -04:00
dns_resolve.h NFS: Avoid memcpy() run-time warning for struct sockaddr overflows 2022-10-27 15:52:10 -04:00
export.c nfsd: allow reaping files still under writeback 2023-04-26 09:04:59 -04:00
file.c nfs: adapt to breakup of struct file_lock 2024-02-05 13:11:43 +01:00
fs_context.c NFS: trace the uniquifier of fscache 2024-03-09 09:14:51 -05:00
fscache.c NFS: Fix nfs_netfs_issue_read() xarray locking for writeback interrupt 2024-03-09 09:14:38 -05:00
fscache.h netfs: Replace PG_fscache by setting folio->private and marking dirty 2024-04-29 15:01:42 +01:00
getroot.c
inode.c NFS client updates for Linux 6.9 2024-03-16 11:44:00 -07:00
internal.h nfs: make the rpc_stat per net namespace 2024-03-09 09:14:51 -05:00
io.c
iostat.h NFS: Remove all NFSIOS_FSCACHE counters due to conversion to netfs API 2023-04-11 13:08:26 -04:00
Kconfig netfs, fscache: Combine fscache with netfs 2023-12-24 15:08:46 +00:00
Makefile
mount_clnt.c NFS: Avoid memcpy() run-time warning for struct sockaddr overflows 2022-10-27 15:52:10 -04:00
namespace.c fs: pass the request_mask to generic_fillattr 2023-08-09 08:56:36 +02:00
netns.h nfs: make the rpc_stat per net namespace 2024-03-09 09:14:51 -05:00
nfs.h nfs: move nfs4_xattr_handlers to .rodata 2023-10-09 16:24:20 +02:00
nfs2super.c
nfs2xdr.c NFS: Guard against READDIR loop when entry names exceed MAXNAMELEN 2023-08-30 11:08:27 -04:00
nfs3_fs.h fs: drop unused posix acl handlers 2023-03-06 09:57:12 +01:00
nfs3acl.c Mainly singleton patches all over the place. Series of note are: 2023-04-27 19:57:00 -07:00
nfs3client.c NFS: enable nconnect for RDMA 2024-03-09 09:14:51 -05:00
nfs3proc.c nfs: adapt to breakup of struct file_lock 2024-02-05 13:11:43 +01:00
nfs3super.c fs: drop unused posix acl handlers 2023-03-06 09:57:12 +01:00
nfs3xdr.c NFS: Guard against READDIR loop when entry names exceed MAXNAMELEN 2023-08-30 11:08:27 -04:00
nfs4_fs.h NFS client updates for Linux 6.9 2024-03-16 11:44:00 -07:00
nfs4client.c NFS: enable nconnect for RDMA 2024-03-09 09:14:51 -05:00
nfs4file.c filelock: split leases out of struct file_lock 2024-02-05 13:11:44 +01:00
nfs4getroot.c
nfs4idmap.c cred: Do not default to init_cred in prepare_kernel_cred() 2022-11-01 10:04:52 -07:00
nfs4idmap.h
nfs4namespace.c NFS: Avoid memcpy() run-time warning for struct sockaddr overflows 2022-10-27 15:52:10 -04:00
nfs4proc.c NFS client updates for Linux 6.9 2024-03-16 11:44:00 -07:00
nfs4renewd.c
nfs4session.c
nfs4session.h
nfs4state.c NFS client updates for Linux 6.9 2024-03-16 11:44:00 -07:00
nfs4super.c nfs: fix regression in handling of fsc= option in NFSv4 2024-02-28 16:18:19 -05:00
nfs4sysctl.c fs: Remove the now superfluous sentinel elements from ctl_table array 2023-12-28 04:57:57 -08:00
nfs4trace.c pnfs/filelayout: add tracepoint to getdeviceinfo 2024-02-28 16:18:19 -05:00
nfs4trace.h NFS client updates for Linux 6.9 2024-03-16 11:44:00 -07:00
nfs4xdr.c nfs: adapt to breakup of struct file_lock 2024-02-05 13:11:43 +01:00
nfs42.h NFSv4.2: fix listxattr maximum XDR buffer size 2024-02-28 16:18:18 -05:00
nfs42proc.c nfs42: client needs to strip file mode's suid/sgid bit after ALLOCATE op 2023-10-11 09:37:48 -04:00
nfs42xattr.c mm, slab: remove last vestiges of SLAB_MEM_SPREAD 2024-03-12 20:32:19 -07:00
nfs42xdr.c NFSv4.2: Rework scratch handling for READ_PLUS (again) 2023-08-23 15:58:47 -04:00
nfsroot.c NFS: Fix an off by one in root_nfs_cat() 2024-03-09 09:14:51 -05:00
nfstrace.c
nfstrace.h NFS: drop unused nfs_direct_req bytes_left 2024-01-04 10:47:56 -05:00
pagelist.c NFS: Convert buffered read paths to use netfs when fscache is enabled 2023-04-11 13:08:26 -04:00
pnfs.c NFS: avoid infinite loop in pnfs_update_layout. 2024-03-09 09:14:51 -05:00
pnfs.h NFSv4/pnfs: Allow layoutget to return EAGAIN for softerr mounts 2023-10-22 19:47:56 -04:00
pnfs_dev.c NFSv4/pnfs: minor fix for cleanup path in nfs4_get_device_info 2023-08-24 13:24:15 -04:00
pnfs_nfs.c NFSv4.1/pnfs: fix NFS with TLS in pnfs 2024-03-09 09:14:51 -05:00
proc.c nfs: Convert nfs_symlink() to use a folio 2023-11-01 15:40:44 -04:00
read.c NFS: Read unlock folio on nfs_page_create_from_folio() error 2024-03-09 09:14:51 -05:00
super.c NFS: Display the "fsc=" mount option if it is set 2024-02-28 16:18:18 -05:00
symlink.c fs: Change the type of filler_t 2022-05-09 16:36:48 -04:00
sysctl.c fs: Remove the now superfluous sentinel elements from ctl_table array 2023-12-28 04:57:57 -08:00
sysfs.c NFS: Fix sysfs server name memory leak 2023-08-19 10:26:29 -04:00
sysfs.h NFS: Add sysfs links to sunrpc clients for nfs_clients 2023-06-19 15:04:13 -04:00
unlink.c nfs: rename the nfs_async_rename_done tracepoint 2024-01-04 10:47:56 -05:00
write.c NFS client updates for Linux 6.9 2024-03-16 11:44:00 -07:00