linux-mainline/fs/cifs
David Howells bc899ee1c8 netfs: Add a netfs inode context
Add a netfs_i_context struct that should be included in the network
filesystem's own inode struct wrapper, directly after the VFS's inode
struct, e.g.:

	struct my_inode {
		struct {
			/* These must be contiguous */
			struct inode		vfs_inode;
			struct netfs_i_context	netfs_ctx;
		};
	};

The netfs_i_context struct so far contains a single field for the network
filesystem to use - the cache cookie:

	struct netfs_i_context {
		...
		struct fscache_cookie	*cache;
	};

Three functions are provided to help with this:

 (1) void netfs_i_context_init(struct inode *inode,
			       const struct netfs_request_ops *ops);

     Initialise the netfs context and set the operations.

 (2) struct netfs_i_context *netfs_i_context(struct inode *inode);

     Find the netfs context from the VFS inode.

 (3) struct inode *netfs_inode(struct netfs_i_context *ctx);

     Find the VFS inode from the netfs context.

Changes
=======
ver #4)
 - Fix netfs_is_cache_enabled() to check cookie->cache_priv to see if a
   cache is present[3].
 - Fix netfs_skip_folio_read() to zero out all of the page, not just some
   of it[3].

ver #3)
 - Split out the bit to move ceph cap-getting on readahead into
   ceph_init_request()[1].
 - Stick in a comment to the netfs inode structs indicating the contiguity
   requirements[2].

ver #2)
 - Adjust documentation to match.
 - Use "#if IS_ENABLED()" in netfs_i_cookie(), not "#ifdef".
 - Move the cap check from ceph_readahead() to ceph_init_request() to be
   called from netfslib.
 - Remove ceph_readahead() and use  netfs_readahead() directly instead.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Jeff Layton <jlayton@kernel.org>
cc: linux-cachefs@redhat.com

Link: https://lore.kernel.org/r/8af0d47f17d89c06bbf602496dd845f2b0bf25b3.camel@kernel.org/ [1]
Link: https://lore.kernel.org/r/beaf4f6a6c2575ed489adb14b257253c868f9a5c.camel@kernel.org/ [2]
Link: https://lore.kernel.org/r/3536452.1647421585@warthog.procyon.org.uk/ [3]
Link: https://lore.kernel.org/r/164622984545.3564931.15691742939278418580.stgit@warthog.procyon.org.uk/ # v1
Link: https://lore.kernel.org/r/164678213320.1200972.16807551936267647470.stgit@warthog.procyon.org.uk/ # v2
Link: https://lore.kernel.org/r/164692909854.2099075.9535537286264248057.stgit@warthog.procyon.org.uk/ # v3
Link: https://lore.kernel.org/r/306388.1647595110@warthog.procyon.org.uk/ # v4
2022-03-18 09:29:05 +00:00
..
asn1.c
cifs_debug.c cifs: adjust DebugData to use chans_need_reconnect for conn status 2022-01-02 20:38:46 -06:00
cifs_debug.h
cifs_dfs_ref.c
cifs_fs_sb.h
cifs_ioctl.h
cifs_spnego_negtokeninit.asn1
cifs_spnego.c cifs: use the chans_need_reconnect bitmap for reconnect status 2022-01-02 20:38:46 -06:00
cifs_spnego.h cifs: use the chans_need_reconnect bitmap for reconnect status 2022-01-02 20:38:46 -06:00
cifs_swn.c cifs: call helper functions for marking channels for reconnect 2022-02-08 22:13:48 -06:00
cifs_swn.h
cifs_unicode.c
cifs_unicode.h
cifs_uniupr.h
cifsacl.c cifs: modefromsids must add an ACE for authenticated users 2022-02-14 09:55:51 -06:00
cifsacl.h
cifsencrypt.c cifs: take cifs_tcp_ses_lock for status checks 2022-01-07 20:07:07 -06:00
cifsfs.c cifs: fix double free race when mount fails in cifs_get_root() 2022-02-13 14:56:48 -06:00
cifsfs.h cifs: update internal module number 2022-01-19 23:14:34 -06:00
cifsglob.h netfs: Add a netfs inode context 2022-03-18 09:29:05 +00:00
cifspdu.h cifs: fix FILE_BOTH_DIRECTORY_INFO definition 2022-01-15 10:08:47 -06:00
cifsproto.h cifs: cifs_ses_mark_for_reconnect should also update reconnect bits 2022-01-19 11:10:58 -06:00
cifsroot.c
cifssmb.c cifs: maintain a state machine for tcp/smb/tcon sessions 2022-01-07 20:09:22 -06:00
connect.c cifs: mark sessions for reconnection in helper function 2022-02-08 22:13:52 -06:00
dfs_cache.c cifs: call helper functions for marking channels for reconnect 2022-02-08 22:13:48 -06:00
dfs_cache.h
dir.c cifs: Support fscache indexing rewrite 2022-01-19 11:21:08 -06:00
dns_resolve.c
dns_resolve.h
export.c
file.c cifs: Fix the readahead conversion to manage the batch when reading from cache 2022-02-01 10:36:22 -06:00
fs_context.c smb3: fix snapshot mount option 2022-02-13 14:56:16 -06:00
fs_context.h
fscache.c netfs: Add a netfs inode context 2022-03-18 09:29:05 +00:00
fscache.h netfs: Add a netfs inode context 2022-03-18 09:29:05 +00:00
inode.c Invalidate fscache cookie only when inode attributes are changed. 2022-02-03 00:08:51 -06:00
ioctl.c
Kconfig cifs: Support fscache indexing rewrite 2022-01-19 11:21:08 -06:00
link.c
Makefile cifs: Support fscache indexing rewrite 2022-01-19 11:21:08 -06:00
misc.c cifs: quirk for STATUS_OBJECT_NAME_INVALID returned for non-ASCII dfs refs 2022-01-17 13:28:25 -06:00
netlink.c
netlink.h
netmisc.c cifs: cifs_ses_mark_for_reconnect should also update reconnect bits 2022-01-19 11:10:58 -06:00
nterr.c
nterr.h
ntlmssp.h smb3: send NTLMSSP version information 2022-01-19 23:14:15 -06:00
readdir.c
rfc1002pdu.h
sess.c cifs: fix confusing unneeded warning message on smb2.1 and earlier 2022-02-16 17:16:49 -06:00
smb1ops.c cifs: call helper functions for marking channels for reconnect 2022-02-08 22:13:48 -06:00
smb2file.c
smb2glob.h cifs: move superblock magic defitions to magic.h 2022-01-15 10:08:44 -06:00
smb2inode.c
smb2maperror.c
smb2misc.c cifs: Fix smb311_update_preauth_hash() kernel-doc comment 2022-01-15 10:08:33 -06:00
smb2ops.c cifs: move superblock magic defitions to magic.h 2022-01-15 10:08:44 -06:00
smb2pdu.c smb3: send NTLMSSP version information 2022-01-19 23:14:15 -06:00
smb2pdu.h
smb2proto.h cifs: use the chans_need_reconnect bitmap for reconnect status 2022-01-02 20:38:46 -06:00
smb2status.h
smb2transport.c cifs: protect all accesses to chan_* with chan_lock 2022-01-19 11:10:54 -06:00
smbdirect.c
smbdirect.h
smbencrypt.c
smberr.h
trace.c
trace.h
transport.c cifs: call helper functions for marking channels for reconnect 2022-02-08 22:13:48 -06:00
unc.c
winucase.c
xattr.c cifs: fix set of group SID via NTSD xattrs 2022-02-13 14:56:34 -06:00