Commit c18d1e17 authored by Trond Myklebust's avatar Trond Myklebust

pNFS: Clean up pnfs_layoutreturn_free_lsegs()

Remove the check for whether or not the stateid is NULL, and fix up the
callers.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent 078000d0
...@@ -1152,7 +1152,7 @@ void pnfs_layoutreturn_free_lsegs(struct pnfs_layout_hdr *lo, ...@@ -1152,7 +1152,7 @@ void pnfs_layoutreturn_free_lsegs(struct pnfs_layout_hdr *lo,
LIST_HEAD(freeme); LIST_HEAD(freeme);
spin_lock(&inode->i_lock); spin_lock(&inode->i_lock);
if (!pnfs_layout_is_valid(lo) || !arg_stateid || if (!pnfs_layout_is_valid(lo) ||
!nfs4_stateid_match_other(&lo->plh_stateid, arg_stateid)) !nfs4_stateid_match_other(&lo->plh_stateid, arg_stateid))
goto out_unlock; goto out_unlock;
if (stateid) { if (stateid) {
...@@ -1559,7 +1559,6 @@ void pnfs_roc_release(struct nfs4_layoutreturn_args *args, ...@@ -1559,7 +1559,6 @@ void pnfs_roc_release(struct nfs4_layoutreturn_args *args,
{ {
struct pnfs_layout_hdr *lo = args->layout; struct pnfs_layout_hdr *lo = args->layout;
struct inode *inode = args->inode; struct inode *inode = args->inode;
const nfs4_stateid *arg_stateid = NULL;
const nfs4_stateid *res_stateid = NULL; const nfs4_stateid *res_stateid = NULL;
struct nfs4_xdr_opaque_data *ld_private = args->ld_private; struct nfs4_xdr_opaque_data *ld_private = args->ld_private;
...@@ -1569,6 +1568,7 @@ void pnfs_roc_release(struct nfs4_layoutreturn_args *args, ...@@ -1569,6 +1568,7 @@ void pnfs_roc_release(struct nfs4_layoutreturn_args *args,
if (pnfs_layout_is_valid(lo) && if (pnfs_layout_is_valid(lo) &&
nfs4_stateid_match_other(&args->stateid, &lo->plh_stateid)) nfs4_stateid_match_other(&args->stateid, &lo->plh_stateid))
pnfs_set_plh_return_info(lo, args->range.iomode, 0); pnfs_set_plh_return_info(lo, args->range.iomode, 0);
pnfs_clear_layoutreturn_waitbit(lo);
spin_unlock(&inode->i_lock); spin_unlock(&inode->i_lock);
break; break;
case 0: case 0:
...@@ -1576,11 +1576,10 @@ void pnfs_roc_release(struct nfs4_layoutreturn_args *args, ...@@ -1576,11 +1576,10 @@ void pnfs_roc_release(struct nfs4_layoutreturn_args *args,
res_stateid = &res->stateid; res_stateid = &res->stateid;
fallthrough; fallthrough;
default: default:
arg_stateid = &args->stateid; pnfs_layoutreturn_free_lsegs(lo, &args->stateid, &args->range,
res_stateid);
} }
trace_nfs4_layoutreturn_on_close(args->inode, &args->stateid, ret); trace_nfs4_layoutreturn_on_close(args->inode, &args->stateid, ret);
pnfs_layoutreturn_free_lsegs(lo, arg_stateid, &args->range,
res_stateid);
if (ld_private && ld_private->ops && ld_private->ops->free) if (ld_private && ld_private->ops && ld_private->ops->free)
ld_private->ops->free(ld_private); ld_private->ops->free(ld_private);
pnfs_put_layout_hdr(lo); pnfs_put_layout_hdr(lo);
......
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