Commit e1c06f80 authored by Trond Myklebust's avatar Trond Myklebust

NFSv4.1/pnfs: Remove redundant check in pnfs_layoutgets_blocked()

layoutget now should already be serialised w.r.t. layout returns
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 2d8ae84f
...@@ -816,23 +816,12 @@ pnfs_layout_stateid_blocked(const struct pnfs_layout_hdr *lo, ...@@ -816,23 +816,12 @@ pnfs_layout_stateid_blocked(const struct pnfs_layout_hdr *lo,
return !pnfs_seqid_is_newer(seqid, lo->plh_barrier); return !pnfs_seqid_is_newer(seqid, lo->plh_barrier);
} }
static bool
pnfs_layout_returning(const struct pnfs_layout_hdr *lo,
struct pnfs_layout_range *range)
{
return test_bit(NFS_LAYOUT_RETURN, &lo->plh_flags) &&
(lo->plh_return_iomode == IOMODE_ANY ||
lo->plh_return_iomode == range->iomode);
}
/* lget is set to 1 if called from inside send_layoutget call chain */ /* lget is set to 1 if called from inside send_layoutget call chain */
static bool static bool
pnfs_layoutgets_blocked(const struct pnfs_layout_hdr *lo, pnfs_layoutgets_blocked(const struct pnfs_layout_hdr *lo)
struct pnfs_layout_range *range)
{ {
return lo->plh_block_lgets || return lo->plh_block_lgets ||
test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags) || test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags);
pnfs_layout_returning(lo, range);
} }
int int
...@@ -844,7 +833,7 @@ pnfs_choose_layoutget_stateid(nfs4_stateid *dst, struct pnfs_layout_hdr *lo, ...@@ -844,7 +833,7 @@ pnfs_choose_layoutget_stateid(nfs4_stateid *dst, struct pnfs_layout_hdr *lo,
dprintk("--> %s\n", __func__); dprintk("--> %s\n", __func__);
spin_lock(&lo->plh_inode->i_lock); spin_lock(&lo->plh_inode->i_lock);
if (pnfs_layoutgets_blocked(lo, range)) { if (pnfs_layoutgets_blocked(lo)) {
status = -EAGAIN; status = -EAGAIN;
} else if (!nfs4_valid_open_stateid(open_state)) { } else if (!nfs4_valid_open_stateid(open_state)) {
status = -EBADF; status = -EBADF;
...@@ -1546,7 +1535,7 @@ pnfs_update_layout(struct inode *ino, ...@@ -1546,7 +1535,7 @@ pnfs_update_layout(struct inode *ino,
goto out_put_layout_hdr; goto out_put_layout_hdr;
} }
if (pnfs_layoutgets_blocked(lo, &arg)) if (pnfs_layoutgets_blocked(lo))
goto out_unlock; goto out_unlock;
atomic_inc(&lo->plh_outstanding); atomic_inc(&lo->plh_outstanding);
spin_unlock(&ino->i_lock); spin_unlock(&ino->i_lock);
...@@ -1618,12 +1607,7 @@ pnfs_layout_process(struct nfs4_layoutget *lgp) ...@@ -1618,12 +1607,7 @@ pnfs_layout_process(struct nfs4_layoutget *lgp)
lseg->pls_range = res->range; lseg->pls_range = res->range;
spin_lock(&ino->i_lock); spin_lock(&ino->i_lock);
if (test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags)) { if (pnfs_layoutgets_blocked(lo)) {
dprintk("%s forget reply due to recall\n", __func__);
goto out_forget_reply;
}
if (pnfs_layoutgets_blocked(lo, &lgp->args.range)) {
dprintk("%s forget reply due to state\n", __func__); dprintk("%s forget reply due to state\n", __func__);
goto out_forget_reply; goto out_forget_reply;
} }
......
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