mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-14 12:21:15 -04:00
smb: server: pass struct smbdirect_socket to smb_direct_get_max_fr_pages()
This will make it easier to move function to the common code in future. Cc: Namjae Jeon <linkinjeon@kernel.org> Cc: Steve French <smfrench@gmail.com> Cc: Tom Talpey <tom@talpey.com> Cc: linux-cifs@vger.kernel.org Cc: samba-technical@lists.samba.org Signed-off-by: Stefan Metzmacher <metze@samba.org> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
committed by
Steve French
parent
ce85071d2c
commit
57131bf9e8
@@ -1812,10 +1812,8 @@ static int smb_direct_prepare_negotiation(struct smb_direct_transport *t)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static unsigned int smb_direct_get_max_fr_pages(struct smb_direct_transport *t)
|
||||
static unsigned int smb_direct_get_max_fr_pages(struct smbdirect_socket *sc)
|
||||
{
|
||||
struct smbdirect_socket *sc = &t->socket;
|
||||
|
||||
return min_t(unsigned int,
|
||||
sc->ib.dev->attrs.max_fast_reg_page_list_len,
|
||||
256);
|
||||
@@ -1846,7 +1844,7 @@ static int smb_direct_init_params(struct smb_direct_transport *t,
|
||||
* are needed for MR registration, RDMA R/W, local & remote
|
||||
* MR invalidation.
|
||||
*/
|
||||
sc->rw_io.credits.num_pages = smb_direct_get_max_fr_pages(t);
|
||||
sc->rw_io.credits.num_pages = smb_direct_get_max_fr_pages(sc);
|
||||
sc->rw_io.credits.max = DIV_ROUND_UP(sp->max_read_write_size,
|
||||
(sc->rw_io.credits.num_pages - 1) *
|
||||
PAGE_SIZE);
|
||||
|
||||
Reference in New Issue
Block a user