nfs41: allow LD to choose DS connection version/minor_version
authorPeng Tao <tao.peng@primarydata.com>
Fri, 30 May 2014 10:15:58 +0000 (18:15 +0800)
committerTom Haynes <loghyr@primarydata.com>
Tue, 3 Feb 2015 19:06:34 +0000 (11:06 -0800)
flexfile layout may need to set such when making DS connections.

Signed-off-by: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Tom Haynes <Thomas.Haynes@primarydata.com>
fs/nfs/filelayout/filelayoutdev.c
fs/nfs/internal.h
fs/nfs/nfs4client.c
fs/nfs/pnfs.h
fs/nfs/pnfs_nfs.c

index 5e4b0ce..4f372e2 100644 (file)
@@ -278,7 +278,8 @@ nfs4_fl_prepare_ds(struct pnfs_layout_segment *lseg, u32 ds_idx)
                goto out_test_devid;
 
        nfs4_pnfs_ds_connect(s, ds, devid, dataserver_timeo,
-                            dataserver_retrans,
+                            dataserver_retrans, 4,
+                            s->nfs_client->cl_minorversion,
                             s->nfs_client->cl_rpcclient->cl_auth->au_flavor);
 
 out_test_devid:
index 7332ba1..5543850 100644 (file)
@@ -190,6 +190,7 @@ extern struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp,
                                             int ds_addrlen, int ds_proto,
                                             unsigned int ds_timeo,
                                             unsigned int ds_retrans,
+                                            u32 minor_version,
                                             rpc_authflavor_t au_flavor);
 extern struct rpc_clnt *nfs4_find_or_create_ds_client(struct nfs_client *,
                                                struct inode *);
index 62d93a1..102d967 100644 (file)
@@ -850,14 +850,14 @@ error:
 struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp,
                const struct sockaddr *ds_addr, int ds_addrlen,
                int ds_proto, unsigned int ds_timeo, unsigned int ds_retrans,
-               rpc_authflavor_t au_flavor)
+               u32 minor_version, rpc_authflavor_t au_flavor)
 {
        struct nfs_client_initdata cl_init = {
                .addr = ds_addr,
                .addrlen = ds_addrlen,
                .nfs_mod = &nfs_v4,
                .proto = ds_proto,
-               .minorversion = mds_clp->cl_minorversion,
+               .minorversion = minor_version,
                .net = mds_clp->cl_net,
        };
        struct rpc_timeout ds_timeout;
index aef89b3..70ffec1 100644 (file)
@@ -325,7 +325,8 @@ struct nfs4_pnfs_ds *nfs4_pnfs_ds_add(struct list_head *dsaddrs,
                                      gfp_t gfp_flags);
 void nfs4_pnfs_ds_connect(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds,
                          struct nfs4_deviceid_node *devid, unsigned int timeo,
-                         unsigned int retrans, rpc_authflavor_t au_flavor);
+                         unsigned int retrans, u32 versoin, u32 minor_version,
+                         rpc_authflavor_t au_flavor);
 struct nfs4_pnfs_ds_addr *nfs4_decode_mp_ds_addr(struct net *net,
                                                 struct xdr_stream *xdr,
                                                 gfp_t gfp_flags);
index 106ee08..ad211a4 100644 (file)
@@ -554,6 +554,7 @@ static int _nfs4_pnfs_ds_connect(struct nfs_server *mds_srv,
                                 struct nfs4_pnfs_ds *ds,
                                 unsigned int timeo,
                                 unsigned int retrans,
+                                u32 minor_version,
                                 rpc_authflavor_t au_flavor)
 {
        struct nfs_client *clp = ERR_PTR(-EIO);
@@ -570,7 +571,8 @@ static int _nfs4_pnfs_ds_connect(struct nfs_server *mds_srv,
                clp = nfs4_set_ds_client(mds_srv->nfs_client,
                                        (struct sockaddr *)&da->da_addr,
                                        da->da_addrlen, IPPROTO_TCP,
-                                       timeo, retrans, au_flavor);
+                                       timeo, retrans, minor_version,
+                                       au_flavor);
                if (!IS_ERR(clp))
                        break;
        }
@@ -601,13 +603,14 @@ out_put:
  */
 void nfs4_pnfs_ds_connect(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds,
                          struct nfs4_deviceid_node *devid, unsigned int timeo,
-                         unsigned int retrans, rpc_authflavor_t au_flavor)
+                         unsigned int retrans, u32 version,
+                         u32 minor_version, rpc_authflavor_t au_flavor)
 {
        if (test_and_set_bit(NFS4DS_CONNECTING, &ds->ds_state) == 0) {
                int err = 0;
 
-               err = _nfs4_pnfs_ds_connect(mds_srv, ds, timeo,
-                                           retrans, au_flavor);
+               err = _nfs4_pnfs_ds_connect(mds_srv, ds, timeo, retrans,
+                                           minor_version, au_flavor);
                if (err)
                        nfs4_mark_deviceid_unavailable(devid);
                nfs4_clear_ds_conn_bit(ds);