]> Git Repo - linux.git/commitdiff
Merge branch 'multipath'
authorTrond Myklebust <[email protected]>
Mon, 22 Feb 2016 22:58:38 +0000 (17:58 -0500)
committerTrond Myklebust <[email protected]>
Mon, 22 Feb 2016 22:58:38 +0000 (17:58 -0500)
* multipath:
  NFS add callback_ops to nfs4_proc_bind_conn_to_session_callback
  pnfs/NFSv4.1: Add multipath capabilities to pNFS flexfiles servers over NFSv3
  SUNRPC: Allow addition of new transports to a struct rpc_clnt
  NFSv4.1: nfs4_proc_bind_conn_to_session must iterate over all connections
  SUNRPC: Make NFS swap work with multipath
  SUNRPC: Add a helper to apply a function to all the rpc_clnt's transports
  SUNRPC: Allow caller to specify the transport to use
  SUNRPC: Use the multipath iterator to assign a transport to each task
  SUNRPC: Make rpc_clnt store the multipath iterators
  SUNRPC: Add a structure to track multiple transports
  SUNRPC: Make freeing of struct xprt rcu-safe
  SUNRPC: Uninline xprt_get(); It isn't performance critical.
  SUNRPC: Reorder rpc_task to put waitqueue related info in same cachelines
  SUNRPC: Remove unused function rpc_task_reset_client

1  2 
fs/nfs/nfs4proc.c
net/sunrpc/auth_gss/auth_gss.c

diff --combined fs/nfs/nfs4proc.c
index 1e103b4f4ad74e24db95fe891b6e820b4df6092d,dbc3dc2f65cd19396f37be4c0c919e752f8758b9..c70de30b80f103413a81e63062deae6a66dd81e0
@@@ -2466,9 -2466,9 +2466,9 @@@ static int _nfs4_open_and_get_state(str
                dentry = d_add_unique(dentry, igrab(state->inode));
                if (dentry == NULL) {
                        dentry = opendata->dentry;
 -              } else if (dentry != ctx->dentry) {
 +              } else {
                        dput(ctx->dentry);
 -                      ctx->dentry = dget(dentry);
 +                      ctx->dentry = dentry;
                }
                nfs_set_verifier(dentry,
                                nfs_save_change_attribute(d_inode(opendata->dir)));
@@@ -6782,13 -6782,26 +6782,26 @@@ nfs41_same_server_scope(struct nfs41_se
        return false;
  }
  
+ static void
+ nfs4_bind_one_conn_to_session_done(struct rpc_task *task, void *calldata)
+ {
+ }
+ static const struct rpc_call_ops nfs4_bind_one_conn_to_session_ops = {
+       .rpc_call_done =  &nfs4_bind_one_conn_to_session_done,
+ };
  /*
-  * nfs4_proc_bind_conn_to_session()
+  * nfs4_proc_bind_one_conn_to_session()
   *
   * The 4.1 client currently uses the same TCP connection for the
   * fore and backchannel.
   */
- int nfs4_proc_bind_conn_to_session(struct nfs_client *clp, struct rpc_cred *cred)
+ static
+ int nfs4_proc_bind_one_conn_to_session(struct rpc_clnt *clnt,
+               struct rpc_xprt *xprt,
+               struct nfs_client *clp,
+               struct rpc_cred *cred)
  {
        int status;
        struct nfs41_bind_conn_to_session_args args = {
                .rpc_resp = &res,
                .rpc_cred = cred,
        };
+       struct rpc_task_setup task_setup_data = {
+               .rpc_client = clnt,
+               .rpc_xprt = xprt,
+               .callback_ops = &nfs4_bind_one_conn_to_session_ops,
+               .rpc_message = &msg,
+               .flags = RPC_TASK_TIMEOUT,
+       };
+       struct rpc_task *task;
  
        dprintk("--> %s\n", __func__);
  
        if (!(clp->cl_session->flags & SESSION4_BACK_CHAN))
                args.dir = NFS4_CDFC4_FORE;
  
-       status = rpc_call_sync(clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT);
+       /* Do not set the backchannel flag unless this is clnt->cl_xprt */
+       if (xprt != rcu_access_pointer(clnt->cl_xprt))
+               args.dir = NFS4_CDFC4_FORE;
+       task = rpc_run_task(&task_setup_data);
+       if (!IS_ERR(task)) {
+               status = task->tk_status;
+               rpc_put_task(task);
+       } else
+               status = PTR_ERR(task);
        trace_nfs4_bind_conn_to_session(clp, status);
        if (status == 0) {
                if (memcmp(res.sessionid.data,
        return status;
  }
  
+ struct rpc_bind_conn_calldata {
+       struct nfs_client *clp;
+       struct rpc_cred *cred;
+ };
+ static int
+ nfs4_proc_bind_conn_to_session_callback(struct rpc_clnt *clnt,
+               struct rpc_xprt *xprt,
+               void *calldata)
+ {
+       struct rpc_bind_conn_calldata *p = calldata;
+       return nfs4_proc_bind_one_conn_to_session(clnt, xprt, p->clp, p->cred);
+ }
+ int nfs4_proc_bind_conn_to_session(struct nfs_client *clp, struct rpc_cred *cred)
+ {
+       struct rpc_bind_conn_calldata data = {
+               .clp = clp,
+               .cred = cred,
+       };
+       return rpc_clnt_iterate_for_each_xprt(clp->cl_rpcclient,
+                       nfs4_proc_bind_conn_to_session_callback, &data);
+ }
  /*
   * Minimum set of SP4_MACH_CRED operations from RFC 5661 in the enforce map
   * and operations we'd like to see to enable certain features in the allow map
@@@ -7319,7 -7374,7 +7374,7 @@@ static void nfs4_init_channel_attrs(str
        args->bc_attrs.max_resp_sz = PAGE_SIZE;
        args->bc_attrs.max_resp_sz_cached = 0;
        args->bc_attrs.max_ops = NFS4_MAX_BACK_CHANNEL_OPS;
 -      args->bc_attrs.max_reqs = 1;
 +      args->bc_attrs.max_reqs = NFS41_BC_MAX_CALLBACKS;
  
        dprintk("%s: Back Channel : max_rqst_sz=%u max_resp_sz=%u "
                "max_resp_sz_cached=%u max_ops=%u max_reqs=%u\n",
index cabf586f47d7d0d75a8cb77b44d497e76a34abd7,3ce391cb80c420bc6e2f0aa0e929c385bd58a43c..8c6bc795f0602a9991fc2b0782b965d96d6b5bf9
@@@ -740,7 -740,7 +740,7 @@@ gss_pipe_downcall(struct file *filp, co
                default:
                        printk(KERN_CRIT "%s: bad return from "
                                "gss_fill_context: %zd\n", __func__, err);
 -                      BUG();
 +                      gss_msg->msg.errno = -EIO;
                }
                goto err_release_msg;
        }
@@@ -1181,12 -1181,12 +1181,12 @@@ static struct rpc_auth 
  gss_create(struct rpc_auth_create_args *args, struct rpc_clnt *clnt)
  {
        struct gss_auth *gss_auth;
-       struct rpc_xprt *xprt = rcu_access_pointer(clnt->cl_xprt);
+       struct rpc_xprt_switch *xps = rcu_access_pointer(clnt->cl_xpi.xpi_xpswitch);
  
        while (clnt != clnt->cl_parent) {
                struct rpc_clnt *parent = clnt->cl_parent;
                /* Find the original parent for this transport */
-               if (rcu_access_pointer(parent->cl_xprt) != xprt)
+               if (rcu_access_pointer(parent->cl_xpi.xpi_xpswitch) != xps)
                        break;
                clnt = parent;
        }
This page took 0.124554 seconds and 4 git commands to generate.