Commit 37a8484a authored by Anna Schumaker's avatar Anna Schumaker

NFS: Return errors directly in _nfs4_opendata_reclaim_to_nfs4_state()

There is no need for a goto just to return an error code without any
cleanup.  Returning the error directly helps to clean up the code.
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 820bf85c
...@@ -1639,17 +1639,15 @@ _nfs4_opendata_reclaim_to_nfs4_state(struct nfs4_opendata *data) ...@@ -1639,17 +1639,15 @@ _nfs4_opendata_reclaim_to_nfs4_state(struct nfs4_opendata *data)
int ret; int ret;
if (!data->rpc_done) { if (!data->rpc_done) {
if (data->rpc_status) { if (data->rpc_status)
ret = data->rpc_status; return ERR_PTR(data->rpc_status);
goto err;
}
/* cached opens have already been processed */ /* cached opens have already been processed */
goto update; goto update;
} }
ret = nfs_refresh_inode(inode, &data->f_attr); ret = nfs_refresh_inode(inode, &data->f_attr);
if (ret) if (ret)
goto err; return ERR_PTR(ret);
if (data->o_res.delegation_type != 0) if (data->o_res.delegation_type != 0)
nfs4_opendata_check_deleg(data, state); nfs4_opendata_check_deleg(data, state);
...@@ -1659,9 +1657,6 @@ _nfs4_opendata_reclaim_to_nfs4_state(struct nfs4_opendata *data) ...@@ -1659,9 +1657,6 @@ _nfs4_opendata_reclaim_to_nfs4_state(struct nfs4_opendata *data)
atomic_inc(&state->count); atomic_inc(&state->count);
return state; return state;
err:
return ERR_PTR(ret);
} }
static struct nfs4_state * static struct nfs4_state *
......
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