]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
NFS: Have _nfs4_proc_secinfo() call nfs4_call_sync_custom()
authorAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 14 Aug 2019 19:30:16 +0000 (15:30 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Thu, 22 Aug 2019 14:05:16 +0000 (10:05 -0400)
We do this to set the RPC_TASK_NO_ROUND_ROBIN flag in the task_setup
structure

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/nfs4proc.c

index 234312240f33e92e7361d5fa2360852dcb3faf8a..de2b3fd806efffb1976655af816d381e029093be 100644 (file)
@@ -7644,6 +7644,8 @@ int nfs4_proc_fsid_present(struct inode *inode, const struct cred *cred)
 static int _nfs4_proc_secinfo(struct inode *dir, const struct qstr *name, struct nfs4_secinfo_flavors *flavors, bool use_integrity)
 {
        int status;
+       struct rpc_clnt *clnt = NFS_SERVER(dir)->client;
+       struct nfs_client *clp = NFS_SERVER(dir)->nfs_client;
        struct nfs4_secinfo_arg args = {
                .dir_fh = NFS_FH(dir),
                .name   = name,
@@ -7656,26 +7658,37 @@ static int _nfs4_proc_secinfo(struct inode *dir, const struct qstr *name, struct
                .rpc_argp = &args,
                .rpc_resp = &res,
        };
-       struct rpc_clnt *clnt = NFS_SERVER(dir)->client;
+       struct nfs4_call_sync_data data = {
+               .seq_server = NFS_SERVER(dir),
+               .seq_args = &args.seq_args,
+               .seq_res = &res.seq_res,
+       };
+       struct rpc_task_setup task_setup = {
+               .rpc_client = clnt,
+               .rpc_message = &msg,
+               .callback_ops = clp->cl_mvops->call_sync_ops,
+               .callback_data = &data,
+               .flags = RPC_TASK_NO_ROUND_ROBIN,
+       };
        const struct cred *cred = NULL;
 
        if (use_integrity) {
-               clnt = NFS_SERVER(dir)->nfs_client->cl_rpcclient;
-               cred = nfs4_get_clid_cred(NFS_SERVER(dir)->nfs_client);
+               clnt = clp->cl_rpcclient;
+               task_setup.rpc_client = clnt;
+
+               cred = nfs4_get_clid_cred(clp);
                msg.rpc_cred = cred;
        }
 
        dprintk("NFS call  secinfo %s\n", name->name);
 
-       nfs4_state_protect(NFS_SERVER(dir)->nfs_client,
-               NFS_SP4_MACH_CRED_SECINFO, &clnt, &msg);
+       nfs4_state_protect(clp, NFS_SP4_MACH_CRED_SECINFO, &clnt, &msg);
+       nfs4_init_sequence(&args.seq_args, &res.seq_res, 0, 0);
+       status = nfs4_call_sync_custom(&task_setup);
 
-       status = nfs4_call_sync(clnt, NFS_SERVER(dir), &msg, &args.seq_args,
-                               &res.seq_res, RPC_TASK_NO_ROUND_ROBIN);
        dprintk("NFS reply  secinfo: %d\n", status);
 
        put_cred(cred);
-
        return status;
 }