summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2017-04-26 23:30:48 -0400
committerTrond Myklebust <trond.myklebust@hammerspace.com>2019-07-06 14:54:50 -0400
commit28cc5cd8c68f1cd2146d88c7a54cc3234ed4dabe (patch)
tree056f9ce9d7290351f02aed7b5a2ebcae3a89ff7b
parent612b41f808a98a124b23d72229693c3181733291 (diff)
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). Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r--fs/nfs/internal.h1
-rw-r--r--fs/nfs/super.c10
2 files changed, 11 insertions, 0 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index 498fab72f70b..bba09dace5d6 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -123,6 +123,7 @@ struct nfs_parsed_mount_data {
123 char *export_path; 123 char *export_path;
124 int port; 124 int port;
125 unsigned short protocol; 125 unsigned short protocol;
126 unsigned short nconnect;
126 } nfs_server; 127 } nfs_server;
127 128
128 void *lsm_opts; 129 void *lsm_opts;
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index f88ddac2dcdf..68ad0b8bcabd 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -77,6 +77,8 @@
77#define NFS_DEFAULT_VERSION 2 77#define NFS_DEFAULT_VERSION 2
78#endif 78#endif
79 79
80#define NFS_MAX_CONNECTIONS 16
81
80enum { 82enum {
81 /* Mount options that take no arguments */ 83 /* Mount options that take no arguments */
82 Opt_soft, Opt_softerr, Opt_hard, 84 Opt_soft, Opt_softerr, Opt_hard,
@@ -108,6 +110,7 @@ enum {
108 Opt_nfsvers, 110 Opt_nfsvers,
109 Opt_sec, Opt_proto, Opt_mountproto, Opt_mounthost, 111 Opt_sec, Opt_proto, Opt_mountproto, Opt_mounthost,
110 Opt_addr, Opt_mountaddr, Opt_clientaddr, 112 Opt_addr, Opt_mountaddr, Opt_clientaddr,
113 Opt_nconnect,
111 Opt_lookupcache, 114 Opt_lookupcache,
112 Opt_fscache_uniq, 115 Opt_fscache_uniq,
113 Opt_local_lock, 116 Opt_local_lock,
@@ -181,6 +184,8 @@ static const match_table_t nfs_mount_option_tokens = {
181 { Opt_mounthost, "mounthost=%s" }, 184 { Opt_mounthost, "mounthost=%s" },
182 { Opt_mountaddr, "mountaddr=%s" }, 185 { Opt_mountaddr, "mountaddr=%s" },
183 186
187 { Opt_nconnect, "nconnect=%s" },
188
184 { Opt_lookupcache, "lookupcache=%s" }, 189 { Opt_lookupcache, "lookupcache=%s" },
185 { Opt_fscache_uniq, "fsc=%s" }, 190 { Opt_fscache_uniq, "fsc=%s" },
186 { Opt_local_lock, "local_lock=%s" }, 191 { Opt_local_lock, "local_lock=%s" },
@@ -1549,6 +1554,11 @@ static int nfs_parse_mount_options(char *raw,
1549 if (mnt->mount_server.addrlen == 0) 1554 if (mnt->mount_server.addrlen == 0)
1550 goto out_invalid_address; 1555 goto out_invalid_address;
1551 break; 1556 break;
1557 case Opt_nconnect:
1558 if (nfs_get_option_ul_bound(args, &option, 1, NFS_MAX_CONNECTIONS))
1559 goto out_invalid_value;
1560 mnt->nfs_server.nconnect = option;
1561 break;
1552 case Opt_lookupcache: 1562 case Opt_lookupcache:
1553 string = match_strdup(args); 1563 string = match_strdup(args);
1554 if (string == NULL) 1564 if (string == NULL)