Commit 56257334 authored by David Howells's avatar David Howells

cifs: Make wait_mtu_credits take size_t args

Make the wait_mtu_credits functions use size_t for the size and num
arguments rather than unsigned int as netfslib uses size_t/ssize_t for
arguments and return values to allow for extra capacity.
Signed-off-by: default avatarDavid 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: linux-cachefs@redhat.com
cc: netfs@lists.linux.dev
cc: linux-mm@kvack.org
parent ab58fbde
...@@ -546,8 +546,8 @@ struct smb_version_operations { ...@@ -546,8 +546,8 @@ struct smb_version_operations {
/* writepages retry size */ /* writepages retry size */
unsigned int (*wp_retry_size)(struct inode *); unsigned int (*wp_retry_size)(struct inode *);
/* get mtu credits */ /* get mtu credits */
int (*wait_mtu_credits)(struct TCP_Server_Info *, unsigned int, int (*wait_mtu_credits)(struct TCP_Server_Info *, size_t,
unsigned int *, struct cifs_credits *); size_t *, struct cifs_credits *);
/* adjust previously taken mtu credits to request size */ /* adjust previously taken mtu credits to request size */
int (*adjust_credits)(struct TCP_Server_Info *server, int (*adjust_credits)(struct TCP_Server_Info *server,
struct cifs_credits *credits, struct cifs_credits *credits,
......
...@@ -121,7 +121,7 @@ extern struct mid_q_entry *cifs_setup_async_request(struct TCP_Server_Info *, ...@@ -121,7 +121,7 @@ extern struct mid_q_entry *cifs_setup_async_request(struct TCP_Server_Info *,
extern int cifs_check_receive(struct mid_q_entry *mid, extern int cifs_check_receive(struct mid_q_entry *mid,
struct TCP_Server_Info *server, bool log_error); struct TCP_Server_Info *server, bool log_error);
extern int cifs_wait_mtu_credits(struct TCP_Server_Info *server, extern int cifs_wait_mtu_credits(struct TCP_Server_Info *server,
unsigned int size, unsigned int *num, size_t size, size_t *num,
struct cifs_credits *credits); struct cifs_credits *credits);
extern int SendReceive2(const unsigned int /* xid */ , struct cifs_ses *, extern int SendReceive2(const unsigned int /* xid */ , struct cifs_ses *,
struct kvec *, int /* nvec to send */, struct kvec *, int /* nvec to send */,
......
...@@ -2783,7 +2783,8 @@ static ssize_t cifs_write_back_from_locked_folio(struct address_space *mapping, ...@@ -2783,7 +2783,8 @@ static ssize_t cifs_write_back_from_locked_folio(struct address_space *mapping,
struct cifs_credits *credits = &credits_on_stack; struct cifs_credits *credits = &credits_on_stack;
struct cifsFileInfo *cfile = NULL; struct cifsFileInfo *cfile = NULL;
unsigned long long i_size = i_size_read(inode), max_len; unsigned long long i_size = i_size_read(inode), max_len;
unsigned int xid, wsize; unsigned int xid;
size_t wsize;
size_t len = folio_size(folio); size_t len = folio_size(folio);
long count = wbc->nr_to_write; long count = wbc->nr_to_write;
int rc; int rc;
...@@ -3285,7 +3286,7 @@ static int ...@@ -3285,7 +3286,7 @@ static int
cifs_resend_wdata(struct cifs_io_subrequest *wdata, struct list_head *wdata_list, cifs_resend_wdata(struct cifs_io_subrequest *wdata, struct list_head *wdata_list,
struct cifs_aio_ctx *ctx) struct cifs_aio_ctx *ctx)
{ {
unsigned int wsize; size_t wsize;
struct cifs_credits credits; struct cifs_credits credits;
int rc; int rc;
struct TCP_Server_Info *server = wdata->server; struct TCP_Server_Info *server = wdata->server;
...@@ -3420,7 +3421,8 @@ cifs_write_from_iter(loff_t fpos, size_t len, struct iov_iter *from, ...@@ -3420,7 +3421,8 @@ cifs_write_from_iter(loff_t fpos, size_t len, struct iov_iter *from,
do { do {
struct cifs_credits credits_on_stack; struct cifs_credits credits_on_stack;
struct cifs_credits *credits = &credits_on_stack; struct cifs_credits *credits = &credits_on_stack;
unsigned int wsize, nsegs = 0; unsigned int nsegs = 0;
size_t wsize;
if (signal_pending(current)) { if (signal_pending(current)) {
rc = -EINTR; rc = -EINTR;
...@@ -3857,7 +3859,7 @@ static int cifs_resend_rdata(struct cifs_io_subrequest *rdata, ...@@ -3857,7 +3859,7 @@ static int cifs_resend_rdata(struct cifs_io_subrequest *rdata,
struct list_head *rdata_list, struct list_head *rdata_list,
struct cifs_aio_ctx *ctx) struct cifs_aio_ctx *ctx)
{ {
unsigned int rsize; size_t rsize;
struct cifs_credits credits; struct cifs_credits credits;
int rc; int rc;
struct TCP_Server_Info *server; struct TCP_Server_Info *server;
...@@ -3931,10 +3933,10 @@ cifs_send_async_read(loff_t fpos, size_t len, struct cifsFileInfo *open_file, ...@@ -3931,10 +3933,10 @@ cifs_send_async_read(loff_t fpos, size_t len, struct cifsFileInfo *open_file,
struct cifs_aio_ctx *ctx) struct cifs_aio_ctx *ctx)
{ {
struct cifs_io_subrequest *rdata; struct cifs_io_subrequest *rdata;
unsigned int rsize, nsegs, max_segs = INT_MAX; unsigned int nsegs, max_segs = INT_MAX;
struct cifs_credits credits_on_stack; struct cifs_credits credits_on_stack;
struct cifs_credits *credits = &credits_on_stack; struct cifs_credits *credits = &credits_on_stack;
size_t cur_len, max_len; size_t cur_len, max_len, rsize;
int rc; int rc;
pid_t pid; pid_t pid;
struct TCP_Server_Info *server; struct TCP_Server_Info *server;
...@@ -4530,12 +4532,13 @@ static void cifs_readahead(struct readahead_control *ractl) ...@@ -4530,12 +4532,13 @@ static void cifs_readahead(struct readahead_control *ractl)
* Chop the readahead request up into rsize-sized read requests. * Chop the readahead request up into rsize-sized read requests.
*/ */
while ((nr_pages = ra_pages)) { while ((nr_pages = ra_pages)) {
unsigned int i, rsize; unsigned int i;
struct cifs_io_subrequest *rdata; struct cifs_io_subrequest *rdata;
struct cifs_credits credits_on_stack; struct cifs_credits credits_on_stack;
struct cifs_credits *credits = &credits_on_stack; struct cifs_credits *credits = &credits_on_stack;
struct folio *folio; struct folio *folio;
pgoff_t fsize; pgoff_t fsize;
size_t rsize;
/* /*
* Find out if we have anything cached in the range of * Find out if we have anything cached in the range of
......
...@@ -217,8 +217,8 @@ smb2_get_credits(struct mid_q_entry *mid) ...@@ -217,8 +217,8 @@ smb2_get_credits(struct mid_q_entry *mid)
} }
static int static int
smb2_wait_mtu_credits(struct TCP_Server_Info *server, unsigned int size, smb2_wait_mtu_credits(struct TCP_Server_Info *server, size_t size,
unsigned int *num, struct cifs_credits *credits) size_t *num, struct cifs_credits *credits)
{ {
int rc = 0; int rc = 0;
unsigned int scredits, in_flight; unsigned int scredits, in_flight;
......
...@@ -691,8 +691,8 @@ wait_for_compound_request(struct TCP_Server_Info *server, int num, ...@@ -691,8 +691,8 @@ wait_for_compound_request(struct TCP_Server_Info *server, int num,
} }
int int
cifs_wait_mtu_credits(struct TCP_Server_Info *server, unsigned int size, cifs_wait_mtu_credits(struct TCP_Server_Info *server, size_t size,
unsigned int *num, struct cifs_credits *credits) size_t *num, struct cifs_credits *credits)
{ {
*num = size; *num = size;
credits->value = 0; credits->value = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment