UPSTREAM: NFS: Add a mount option to specify number of TCP connections to use

Allow the user to specify that the client should use multiple connections
to the server. For the moment, this functionality will be limited to
TCP and to NFSv4.x (x>0).

Change-Id: Ic55c3050dbeedfe5c2deb2a069a0b0e0d9adb42d
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
Trond Myklebust authored and Thomas Turner committed 2025-09-30 21:35:02 +01:00
1 parent 304899fb3d
commit deeef92d54
2 files changed
+11

No files matched your search

+1
View File
@@ -121,6 +121,7 @@ struct nfs_parsed_mount_data {
char *export_path;
int port;
unsigned short protocol;
unsigned short nconnect;
} nfs_server;
void *lsm_opts;
+10
View File
@@ -76,6 +76,8 @@
#define NFS_DEFAULT_VERSION 2
#endif
#define NFS_MAX_CONNECTIONS 16
enum {
/* Mount options that take no arguments */
Opt_soft, Opt_hard,
@@ -107,6 +109,7 @@ enum {
Opt_nfsvers,
Opt_sec, Opt_proto, Opt_mountproto, Opt_mounthost,
Opt_addr, Opt_mountaddr, Opt_clientaddr,
Opt_nconnect,
Opt_lookupcache,
Opt_fscache_uniq,
Opt_local_lock,
@@ -179,6 +182,8 @@ static const match_table_t nfs_mount_option_tokens = {
{ Opt_mounthost, "mounthost=%s" },
{ Opt_mountaddr, "mountaddr=%s" },
{ Opt_nconnect, "nconnect=%s" },
{ Opt_lookupcache, "lookupcache=%s" },
{ Opt_fscache_uniq, "fsc=%s" },
{ Opt_local_lock, "local_lock=%s" },
@@ -1539,6 +1544,11 @@ static int nfs_parse_mount_options(char *raw,
if (mnt->mount_server.addrlen == 0)
goto out_invalid_address;
break;
case Opt_nconnect:
if (nfs_get_option_ul_bound(args, &option, 1, NFS_MAX_CONNECTIONS))
goto out_invalid_value;
mnt->nfs_server.nconnect = option;
break;
case Opt_lookupcache:
string = match_strdup(args);
if (string == NULL)