Commit c31663d4 authored by Fred Isaman's avatar Fred Isaman Committed by Trond Myklebust

pnfs: layoutget rpc code cleanup

No functional changes, just some code minor code rearrangement and
comments.
Signed-off-by: default avatarFred Isaman <iisaman@netapp.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 4541d16c
...@@ -5293,10 +5293,14 @@ static void ...@@ -5293,10 +5293,14 @@ static void
nfs4_layoutget_prepare(struct rpc_task *task, void *calldata) nfs4_layoutget_prepare(struct rpc_task *task, void *calldata)
{ {
struct nfs4_layoutget *lgp = calldata; struct nfs4_layoutget *lgp = calldata;
struct inode *ino = lgp->args.inode; struct nfs_server *server = NFS_SERVER(lgp->args.inode);
struct nfs_server *server = NFS_SERVER(ino);
dprintk("--> %s\n", __func__); dprintk("--> %s\n", __func__);
/* Note the is a race here, where a CB_LAYOUTRECALL can come in
* right now covering the LAYOUTGET we are about to send.
* However, that is not so catastrophic, and there seems
* to be no way to prevent it completely.
*/
if (nfs4_setup_sequence(server, &lgp->args.seq_args, if (nfs4_setup_sequence(server, &lgp->args.seq_args,
&lgp->res.seq_res, 0, task)) &lgp->res.seq_res, 0, task))
return; return;
...@@ -5379,13 +5383,10 @@ int nfs4_proc_layoutget(struct nfs4_layoutget *lgp) ...@@ -5379,13 +5383,10 @@ int nfs4_proc_layoutget(struct nfs4_layoutget *lgp)
if (IS_ERR(task)) if (IS_ERR(task))
return PTR_ERR(task); return PTR_ERR(task);
status = nfs4_wait_for_completion_rpc_task(task); status = nfs4_wait_for_completion_rpc_task(task);
if (status != 0) if (status == 0)
goto out;
status = task->tk_status; status = task->tk_status;
if (status != 0) if (status == 0)
goto out;
status = pnfs_layout_process(lgp); status = pnfs_layout_process(lgp);
out:
rpc_put_task(task); rpc_put_task(task);
dprintk("<-- %s status=%d\n", __func__, status); dprintk("<-- %s status=%d\n", __func__, status);
return status; return status;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment