linux-stable/fs/nfs
Linus Torvalds f008b1d6e1 Netfs prep for write helpers
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEqG5UsNXhtOCrfGQP+7dXa6fLC2sFAmI1HOwACgkQ+7dXa6fL
 C2u9mA/+LUdXHqlvET/PAtFTg75bUPeOFGLnuDnYl1Ng2FCKMSodAohpbVtENxsK
 E/gTVS7uiVZFQgC+YmNA00z6eIQkAaDVyvKyEcUbKREBbUgONfJ/HLeaK/NvVKxx
 TY5gx/POdG6yHRQXL6JGBqSJUB8bZrGKwnJm8ebzeKOji9n7GSJBYiMlYBA7EAhs
 Aut/P7Y39ISHLw3y+y5czBeRoubljmTyznbP20xUZEzrRwhTpNwpJVzBGUZU635T
 93Sqcp//0U5LIdn6Pg6DUGHBMBTNDNJChb21ZoBusF/HHswXsOOnf/mcRUBSJUTI
 M1WSpNLk8PRBgajMdIymQpGU1sCZZzJ3krrSA3RcXdN6GPHwZg8kKjoroHsLDL6l
 igPbDSMJ5wfiwA2A2gXbY1CkAl3ik5ccb7ZqhTwS0WBk0vOnHmAsE9cs/bBo7Xii
 GTiWXEFOgtJiXANPMS2P9DiOS3ZQNf+wxotCYdkGPOXuX9wnIo1Kmy8XfujQ1bXf
 pJsEZKfeyROKrzyKWgqLI64/Kg5xNueoFQZfDpOlZYzF1uDstynADPUt0eQD706q
 jcuKaXLN3rn5gSPun5mWOYbRtXVgOLdFL/7zptMVJwFKBFguQENhjG4UMNZcjkVA
 3Mr0kGocsgoCSk1oDBkFlrw1wIsXxWbkRBL1Pww6kovivuGUwoo=
 =j0yx
 -----END PGP SIGNATURE-----

Merge tag 'netfs-prep-20220318' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs

Pull netfs updates from David Howells:
 "Netfs prep for write helpers.

  Having had a go at implementing write helpers and content encryption
  support in netfslib, it seems that the netfs_read_{,sub}request
  structs and the equivalent write request structs were almost the same
  and so should be merged, thereby requiring only one set of
  alloc/get/put functions and a common set of tracepoints.

  Merging the structs also has the advantage that if a bounce buffer is
  added to the request struct, a read operation can be performed to fill
  the bounce buffer, the contents of the buffer can be modified and then
  a write operation can be performed on it to send the data wherever it
  needs to go using the same request structure all the way through. The
  I/O handlers would then transparently perform any required crypto.
  This should make it easier to perform RMW cycles if needed.

  The potentially common functions and structs, however, by their names
  all proclaim themselves to be associated with the read side of things.

  The bulk of these changes alter this in the following ways:

   - Rename struct netfs_read_{,sub}request to netfs_io_{,sub}request.

   - Rename some enums, members and flags to make them more appropriate.

   - Adjust some comments to match.

   - Drop "read"/"rreq" from the names of common functions. For
     instance, netfs_get_read_request() becomes netfs_get_request().

   - The ->init_rreq() and ->issue_op() methods become ->init_request()
     and ->issue_read(). I've kept the latter as a read-specific
     function and in another branch added an ->issue_write() method.

  The driver source is then reorganised into a number of files:

        fs/netfs/buffered_read.c        Create read reqs to the pagecache
        fs/netfs/io.c                   Dispatchers for read and write reqs
        fs/netfs/main.c                 Some general miscellaneous bits
        fs/netfs/objects.c              Alloc, get and put functions
        fs/netfs/stats.c                Optional procfs statistics.

  and future development can be fitted into this scheme, e.g.:

        fs/netfs/buffered_write.c       Modify the pagecache
        fs/netfs/buffered_flush.c       Writeback from the pagecache
        fs/netfs/direct_read.c          DIO read support
        fs/netfs/direct_write.c         DIO write support
        fs/netfs/unbuffered_write.c     Write modifications directly back

  Beyond the above changes, there are also some changes that affect how
  things work:

   - Make fscache_end_operation() generally available.

   - In the netfs tracing header, generate enums from the symbol ->
     string mapping tables rather than manually coding them.

   - Add a struct for filesystems that uses netfslib to put into their
     inode wrapper structs to hold extra state that netfslib is
     interested in, such as the fscache cookie. This allows netfslib
     functions to be set in filesystem operation tables and jumped to
     directly without having to have a filesystem wrapper.

   - Add a member to the struct added above to track the remote inode
     length as that may differ if local modifications are buffered. We
     may need to supply an appropriate EOF pointer when storing data (in
     AFS for example).

   - Pass extra information to netfs_alloc_request() so that the
     ->init_request() hook can access it and retain information to
     indicate the origin of the operation.

   - Make the ->init_request() hook return an error, thereby allowing a
     filesystem that isn't allowed to cache an inode (ceph or cifs, for
     example) to skip readahead.

   - Switch to using refcount_t for subrequests and add tracepoints to
     log refcount changes for the request and subrequest structs.

   - Add a function to consolidate dispatching a read request. Similar
     code is used in three places and another couple are likely to be
     added in the future"

Link: https://lore.kernel.org/all/2639515.1648483225@warthog.procyon.org.uk/

* tag 'netfs-prep-20220318' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
  afs: Maintain netfs_i_context::remote_i_size
  netfs: Keep track of the actual remote file size
  netfs: Split some core bits out into their own file
  netfs: Split fs/netfs/read_helper.c
  netfs: Rename read_helper.c to io.c
  netfs: Prepare to split read_helper.c
  netfs: Add a function to consolidate beginning a read
  netfs: Add a netfs inode context
  ceph: Make ceph_init_request() check caps on readahead
  netfs: Change ->init_request() to return an error code
  netfs: Refactor arguments for netfs_alloc_read_request
  netfs: Adjust the netfs_failure tracepoint to indicate non-subreq lines
  netfs: Trace refcounting on the netfs_io_subrequest struct
  netfs: Trace refcounting on the netfs_io_request struct
  netfs: Adjust the netfs_rreq tracepoint slightly
  netfs: Split netfs_io_* object handling out
  netfs: Finish off rename of netfs_read_request to netfs_io_request
  netfs: Rename netfs_read_*request to netfs_io_*request
  netfs: Generate enums from trace symbol mapping lists
  fscache: export fscache_end_operation()
2022-03-31 15:49:36 -07:00
..
blocklayout block: pass a block_device and opf to bio_alloc 2022-02-02 07:49:59 -07:00
filelayout pNFS/files: Ensure pNFS allocation modes are consistent with nfsiod 2022-03-22 15:52:56 -04:00
flexfilelayout pNFS/flexfiles: Ensure pNFS allocation modes are consistent with nfsiod 2022-03-22 15:52:56 -04:00
cache_lib.c
cache_lib.h
callback.c NFSD: Move svc_serv_ops::svo_function into struct svc_serv 2022-02-28 10:26:40 -05:00
callback.h NFSv4.1: Fix uninitialised variable in devicenotify 2022-01-06 14:00:20 -05:00
callback_proc.c NFSv4/pNFS: Fix another issue with a list iterator pointing to the head 2022-03-28 08:36:34 -04:00
callback_xdr.c NFS: remove unneeded check in decode_devicenotify_args() 2022-03-13 12:59:34 -04:00
client.c NFSv4.1 provide mount option to toggle trunking discovery 2022-03-21 10:36:49 -04:00
delegation.c NFSv4: Charge NFSv4 open state trackers to kmemcg 2022-02-25 18:50:12 -05:00
delegation.h NFSv4: Fix delegation return in cases where we have to retry 2021-06-13 19:36:27 -04:00
dir.c NFS: Fix revalidation of empty readdir pages 2022-03-22 15:52:55 -04:00
direct.c NFS: swap-out must always use STABLE writes. 2022-03-13 12:59:35 -04:00
dns_resolve.c
dns_resolve.h
export.c nfs: block notification on fs with its own ->lock 2022-01-08 14:42:01 -05:00
file.c NFS client updates for Linux 5.18 2022-03-29 18:55:37 -07:00
fs_context.c NFSv4.1 provide mount option to toggle trunking discovery 2022-03-21 10:36:49 -04:00
fscache.c Netfs prep for write helpers 2022-03-31 15:49:36 -07:00
fscache.h NFS: Rename fscache read and write pages functions 2022-03-13 12:59:35 -04:00
getroot.c NFS: Remove the nfs4_label argument from nfs_setsecurity 2021-11-05 14:54:40 -04:00
inode.c NFS client updates for Linux 5.18 2022-03-29 18:55:37 -07:00
internal.h NFS: nfsiod should not block forever in mempool_alloc() 2022-03-22 15:52:56 -04:00
io.c NFS: Fix up incorrect documentation 2021-04-05 09:04:20 -04:00
iostat.h
Kconfig NFS: Convert readdir page cache to use a cookie based index 2022-03-02 08:43:39 -05:00
Makefile nfs: Convert to new fscache volume/cookie API 2022-01-10 11:53:25 +00:00
mount_clnt.c nfs: hornor timeo and retrans option when mounting NFSv3 2021-04-05 09:04:21 -04:00
namespace.c NFS: Remove the label from the nfs4_lookup_res struct 2021-11-05 14:54:39 -04:00
netns.h
nfs.h
nfs2super.c
nfs2xdr.c NFS: Optimise away the previous cookie field 2022-03-02 08:43:39 -05:00
nfs3_fs.h vfs: add rcu argument to ->get_acl() callback 2021-08-18 22:08:24 +02:00
nfs3acl.c vfs: add rcu argument to ->get_acl() callback 2021-08-18 22:08:24 +02:00
nfs3client.c
nfs3proc.c NFS: pass cred explicitly for access tests 2022-01-06 14:00:20 -05:00
nfs3super.c
nfs3xdr.c NFS: Optimise away the previous cookie field 2022-03-02 08:43:39 -05:00
nfs4_fs.h NFSv4: keep state manager thread active if swap is enabled 2022-03-13 12:59:35 -04:00
nfs4client.c nfs: nfs4clinet: check the return value of kstrdup() 2022-01-06 14:00:20 -05:00
nfs4file.c NFSv4.2/copyoffload: Convert GFP_NOFS to GFP_KERNEL 2022-02-25 18:50:12 -05:00
nfs4getroot.c
nfs4idmap.c Fix user namespace leak 2021-10-20 18:09:54 -04:00
nfs4idmap.h
nfs4namespace.c NFSv4 handle port presence in fs_location server string 2022-01-13 09:36:58 -05:00
nfs4proc.c NFSv4.1: don't retry BIND_CONN_TO_SESSION on session error 2022-03-24 12:06:07 -04:00
nfs4renewd.c treewide: remove editor modelines and cruft 2021-05-07 00:26:34 -07:00
nfs4session.c NFSv4: Sanity check the parameters in nfs41_update_target_slotid() 2021-11-07 09:23:14 -05:00
nfs4session.h NFSv4: Sanity check the parameters in nfs41_update_target_slotid() 2021-11-07 09:23:14 -05:00
nfs4state.c NFS client updates for Linux 5.18 2022-03-29 18:55:37 -07:00
nfs4super.c NFS: Adjust fs_context error logging 2021-01-10 13:32:39 -05:00
nfs4sysctl.c
nfs4trace.c
nfs4trace.h NFSv4.2 add tracepoint to OFFLOAD_CANCEL 2021-11-04 19:43:30 -04:00
nfs4xdr.c NFS: Optimise away the previous cookie field 2022-03-02 08:43:39 -05:00
nfs42.h
nfs42proc.c NFS: replace usage of found with dedicated list iterator variable 2022-03-24 12:06:07 -04:00
nfs42xattr.c NFSv4.2: Fix up an invalid combination of memory allocation flags 2022-02-25 18:50:12 -05:00
nfs42xdr.c NFSv42: Don't fail clone() unless the OP_CLONE operation failed 2021-11-17 14:08:23 -05:00
nfsroot.c
nfstrace.c NFSv4: Catch and trace server filehandle encoding errors 2021-04-14 09:36:29 -04:00
nfstrace.h NFS: Replace dfprintks with tracepoints in fscache read and write page functions 2022-03-13 12:59:35 -04:00
pagelist.c NFS: Don't loop forever in nfs_do_recoalesce() 2022-03-25 21:51:03 -04:00
pnfs.c NFSv4/pNFS: Fix another issue with a list iterator pointing to the head 2022-03-28 08:36:34 -04:00
pnfs.h NFSv4/pNFS: Fix another issue with a list iterator pointing to the head 2022-03-28 08:36:34 -04:00
pnfs_dev.c
pnfs_nfs.c NFS: nfsiod should not block forever in mempool_alloc() 2022-03-22 15:52:56 -04:00
proc.c NFS: NFSv2/v3 clients should never be setting NFS_CAP_XATTR 2022-02-25 18:50:13 -05:00
read.c NFS: discard NFS_RPC_SWAPFLAGS and RPC_TASK_ROOTCREDS 2022-03-13 12:59:35 -04:00
super.c nfs: Convert to new fscache volume/cookie API 2022-01-10 11:53:25 +00:00
symlink.c
sysctl.c
sysfs.c Revert "NFSv4: use unique client identifiers in network namespaces" 2022-02-28 10:09:23 -05:00
sysfs.h
unlink.c NFS: Fix open coded versions of nfs_set_cache_invalid() 2021-03-08 16:13:55 -05:00
write.c NFS client updates for Linux 5.18 2022-03-29 18:55:37 -07:00