diff options
author | David Howells <dhowells@redhat.com> | 2023-10-06 18:27:41 +0300 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2024-05-01 20:08:18 +0300 |
commit | a975a2f22cdce7ec0c678ce8d73d2f6616cb281c (patch) | |
tree | 3b02ac92f4d23f207405fc4870ec46576811e116 /fs/smb/client/cifsproto.h | |
parent | 753b67eb630db34e36ec4ae1e86c75e243ea4fc9 (diff) | |
download | linux-a975a2f22cdce7ec0c678ce8d73d2f6616cb281c.tar.xz |
cifs: Replace cifs_writedata with a wrapper around netfs_io_subrequest
Replace the cifs_writedata struct with the same wrapper around
netfs_io_subrequest that was used to replace cifs_readdata.
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/cifsproto.h')
-rw-r--r-- | fs/smb/client/cifsproto.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/fs/smb/client/cifsproto.h b/fs/smb/client/cifsproto.h index 5712f789eaa0..cb5cc5711a84 100644 --- a/fs/smb/client/cifsproto.h +++ b/fs/smb/client/cifsproto.h @@ -612,11 +612,19 @@ static inline void cifs_put_readdata(struct cifs_io_subrequest *rdata) int cifs_async_readv(struct cifs_io_subrequest *rdata); int cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid); -int cifs_async_writev(struct cifs_writedata *wdata, - void (*release)(struct kref *kref)); +int cifs_async_writev(struct cifs_io_subrequest *wdata); void cifs_writev_complete(struct work_struct *work); -struct cifs_writedata *cifs_writedata_alloc(work_func_t complete); -void cifs_writedata_release(struct kref *refcount); +struct cifs_io_subrequest *cifs_writedata_alloc(work_func_t complete); +void cifs_writedata_release(struct cifs_io_subrequest *rdata); +static inline void cifs_get_writedata(struct cifs_io_subrequest *wdata) +{ + refcount_inc(&wdata->subreq.ref); +} +static inline void cifs_put_writedata(struct cifs_io_subrequest *wdata) +{ + if (refcount_dec_and_test(&wdata->subreq.ref)) + cifs_writedata_release(wdata); +} int cifs_query_mf_symlink(unsigned int xid, struct cifs_tcon *tcon, struct cifs_sb_info *cifs_sb, const unsigned char *path, char *pbuf, |