NFS: Have nfs41_proc_reclaim_complete() call nfs4_call_sync_custom()
authorAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 14 Aug 2019 19:46:48 +0000 (15:46 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Thu, 22 Aug 2019 14:05:21 +0000 (10:05 -0400)
An async call followed by an rpc_wait_for_completion() is basically the
same as a synchronous call, so we can use nfs4_call_sync_custom() to
keep our custom callback ops and the RPC_TASK_NO_ROUND_ROBIN flag.

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

index de2b3fd806efffb1976655af816d381e029093be..1b7863ec12d38c1fbc720bf3fa8bf3358a322ec5 100644 (file)
@@ -8857,7 +8857,6 @@ static int nfs41_proc_reclaim_complete(struct nfs_client *clp,
                const struct cred *cred)
 {
        struct nfs4_reclaim_complete_data *calldata;
-       struct rpc_task *task;
        struct rpc_message msg = {
                .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_RECLAIM_COMPLETE],
                .rpc_cred = cred,
@@ -8866,7 +8865,7 @@ static int nfs41_proc_reclaim_complete(struct nfs_client *clp,
                .rpc_client = clp->cl_rpcclient,
                .rpc_message = &msg,
                .callback_ops = &nfs4_reclaim_complete_call_ops,
-               .flags = RPC_TASK_ASYNC | RPC_TASK_NO_ROUND_ROBIN,
+               .flags = RPC_TASK_NO_ROUND_ROBIN,
        };
        int status = -ENOMEM;
 
@@ -8881,15 +8880,7 @@ static int nfs41_proc_reclaim_complete(struct nfs_client *clp,
        msg.rpc_argp = &calldata->arg;
        msg.rpc_resp = &calldata->res;
        task_setup_data.callback_data = calldata;
-       task = rpc_run_task(&task_setup_data);
-       if (IS_ERR(task)) {
-               status = PTR_ERR(task);
-               goto out;
-       }
-       status = rpc_wait_for_completion_task(task);
-       if (status == 0)
-               status = task->tk_status;
-       rpc_put_task(task);
+       status = nfs4_call_sync_custom(&task_setup_data);
 out:
        dprintk("<-- %s status=%d\n", __func__, status);
        return status;