summaryrefslogtreecommitdiffstats
path: root/fs/smb/client/cifsglob.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2023-10-06 18:16:15 +0100
committerDavid Howells <dhowells@redhat.com>2024-05-01 18:08:21 +0100
commit69c3c023af25edb5433a2db824d3e7cc328f0183 (patch)
tree5d4f801f8913358dd027d1554cbbee546089ab01 /fs/smb/client/cifsglob.h
parentc20c0d7325abd9a8bf985a934591d75d514a3d4d (diff)
downloadlinux-stable-69c3c023af25edb5433a2db824d3e7cc328f0183.tar.gz
linux-stable-69c3c023af25edb5433a2db824d3e7cc328f0183.tar.bz2
linux-stable-69c3c023af25edb5433a2db824d3e7cc328f0183.zip
cifs: Implement netfslib hooks
Provide implementation of the netfslib hooks that will be used by netfslib to ask cifs to set up and perform operations. Of particular note are (*) cifs_clamp_length() - This is used to negotiate the size of the next subrequest in a read request, taking into account the credit available and the rsize. The credits are attached to the subrequest. (*) cifs_req_issue_read() - This is used to issue a subrequest that has been set up and clamped. (*) cifs_prepare_write() - This prepares to fill a subrequest by picking a channel, reopening the file and requesting credits so that we can set the maximum size of the subrequest and also sets the maximum number of segments if we're doing RDMA. (*) cifs_issue_write() - This releases any unneeded credits and issues an asynchronous data write for the contiguous slice of file covered by the subrequest. This should possibly be folded in to all ->async_writev() ops and that called directly. (*) cifs_begin_writeback() - This gets the cached writable handle through which we do writeback (this does not affect writethrough, unbuffered or direct writes). At this point, cifs is not wired up to actually *use* netfslib; that will be done in a subsequent patch. Signed-off-by: David Howells <dhowells@redhat.com> cc: Steve French <sfrench@samba.org> cc: Shyam Prasad N <nspmangalore@gmail.com> cc: Rohith Surabattula <rohiths.msft@gmail.com> cc: Jeff Layton <jlayton@kernel.org> cc: linux-cifs@vger.kernel.org cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org
Diffstat (limited to 'fs/smb/client/cifsglob.h')
-rw-r--r--fs/smb/client/cifsglob.h28
1 files changed, 19 insertions, 9 deletions
diff --git a/fs/smb/client/cifsglob.h b/fs/smb/client/cifsglob.h
index 611f59c6d2c0..4e9033b2f191 100644
--- a/fs/smb/client/cifsglob.h
+++ b/fs/smb/client/cifsglob.h
@@ -1491,15 +1491,24 @@ struct cifs_aio_ctx {
bool direct_io;
};
+struct cifs_io_request {
+ struct netfs_io_request rreq;
+ struct cifsFileInfo *cfile;
+};
+
/* asynchronous read support */
struct cifs_io_subrequest {
- struct netfs_io_subrequest subreq;
- struct cifsFileInfo *cfile;
- struct address_space *mapping;
- struct cifs_aio_ctx *ctx;
+ union {
+ struct netfs_io_subrequest subreq;
+ struct netfs_io_request *rreq;
+ struct cifs_io_request *req;
+ };
ssize_t got_bytes;
pid_t pid;
+ unsigned int xid;
int result;
+ bool have_xid;
+ bool replay;
struct kvec iov[2];
struct TCP_Server_Info *server;
#ifdef CONFIG_CIFS_SMB_DIRECT
@@ -1507,15 +1516,16 @@ struct cifs_io_subrequest {
#endif
struct cifs_credits credits;
- enum writeback_sync_modes sync_mode;
- bool uncached;
- bool replay;
- struct bio_vec *bv;
-
// TODO: Remove following elements
struct list_head list;
struct completion done;
struct work_struct work;
+ struct cifsFileInfo *cfile;
+ struct address_space *mapping;
+ struct cifs_aio_ctx *ctx;
+ enum writeback_sync_modes sync_mode;
+ bool uncached;
+ struct bio_vec *bv;
};
/*