Commit 2370abda authored by Trond Myklebust's avatar Trond Myklebust

NFS: Cleanup - rename NFS_LAYOUT_RETURN_BEFORE_CLOSE

NFS_LAYOUT_RETURN_BEFORE_CLOSE is being used to signal that a
layoutreturn is needed, either due to a layout recall or to a
layout error. Rename it to NFS_LAYOUT_RETURN_REQUESTED in order
to clarify its purpose.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 13c13a6a
...@@ -1215,7 +1215,7 @@ static int ff_layout_read_done_cb(struct rpc_task *task, ...@@ -1215,7 +1215,7 @@ static int ff_layout_read_done_cb(struct rpc_task *task,
hdr->pgio_mirror_idx + 1, hdr->pgio_mirror_idx + 1,
&hdr->pgio_mirror_idx)) &hdr->pgio_mirror_idx))
goto out_eagain; goto out_eagain;
set_bit(NFS_LAYOUT_RETURN_BEFORE_CLOSE, set_bit(NFS_LAYOUT_RETURN_REQUESTED,
&hdr->lseg->pls_layout->plh_flags); &hdr->lseg->pls_layout->plh_flags);
pnfs_read_resend_pnfs(hdr); pnfs_read_resend_pnfs(hdr);
return task->tk_status; return task->tk_status;
......
...@@ -412,7 +412,7 @@ nfs4_ff_layout_prepare_ds(struct pnfs_layout_segment *lseg, u32 ds_idx, ...@@ -412,7 +412,7 @@ nfs4_ff_layout_prepare_ds(struct pnfs_layout_segment *lseg, u32 ds_idx,
OP_ILLEGAL, GFP_NOIO); OP_ILLEGAL, GFP_NOIO);
if (!fail_return) { if (!fail_return) {
if (ff_layout_has_available_ds(lseg)) if (ff_layout_has_available_ds(lseg))
set_bit(NFS_LAYOUT_RETURN_BEFORE_CLOSE, set_bit(NFS_LAYOUT_RETURN_REQUESTED,
&lseg->pls_layout->plh_flags); &lseg->pls_layout->plh_flags);
else else
pnfs_error_mark_layout_for_return(ino, lseg); pnfs_error_mark_layout_for_return(ino, lseg);
......
...@@ -885,7 +885,7 @@ pnfs_prepare_layoutreturn(struct pnfs_layout_hdr *lo) ...@@ -885,7 +885,7 @@ pnfs_prepare_layoutreturn(struct pnfs_layout_hdr *lo)
return false; return false;
lo->plh_return_iomode = 0; lo->plh_return_iomode = 0;
pnfs_get_layout_hdr(lo); pnfs_get_layout_hdr(lo);
clear_bit(NFS_LAYOUT_RETURN_BEFORE_CLOSE, &lo->plh_flags); clear_bit(NFS_LAYOUT_RETURN_REQUESTED, &lo->plh_flags);
return true; return true;
} }
...@@ -929,7 +929,7 @@ pnfs_layout_need_return(struct pnfs_layout_hdr *lo) ...@@ -929,7 +929,7 @@ pnfs_layout_need_return(struct pnfs_layout_hdr *lo)
{ {
struct pnfs_layout_segment *s; struct pnfs_layout_segment *s;
if (!test_bit(NFS_LAYOUT_RETURN_BEFORE_CLOSE, &lo->plh_flags)) if (!test_bit(NFS_LAYOUT_RETURN_REQUESTED, &lo->plh_flags))
return false; return false;
/* Defer layoutreturn until all lsegs are done */ /* Defer layoutreturn until all lsegs are done */
...@@ -945,7 +945,7 @@ static void pnfs_layoutreturn_before_put_layout_hdr(struct pnfs_layout_hdr *lo) ...@@ -945,7 +945,7 @@ static void pnfs_layoutreturn_before_put_layout_hdr(struct pnfs_layout_hdr *lo)
{ {
struct inode *inode= lo->plh_inode; struct inode *inode= lo->plh_inode;
if (!test_bit(NFS_LAYOUT_RETURN_BEFORE_CLOSE, &lo->plh_flags)) if (!test_bit(NFS_LAYOUT_RETURN_REQUESTED, &lo->plh_flags))
return; return;
spin_lock(&inode->i_lock); spin_lock(&inode->i_lock);
if (pnfs_layout_need_return(lo)) { if (pnfs_layout_need_return(lo)) {
...@@ -1085,7 +1085,7 @@ bool pnfs_roc(struct inode *ino) ...@@ -1085,7 +1085,7 @@ bool pnfs_roc(struct inode *ino)
nfs4_stateid_copy(&stateid, &lo->plh_stateid); nfs4_stateid_copy(&stateid, &lo->plh_stateid);
/* always send layoutreturn if being marked so */ /* always send layoutreturn if being marked so */
if (test_and_clear_bit(NFS_LAYOUT_RETURN_BEFORE_CLOSE, if (test_and_clear_bit(NFS_LAYOUT_RETURN_REQUESTED,
&lo->plh_flags)) &lo->plh_flags))
layoutreturn = pnfs_prepare_layoutreturn(lo); layoutreturn = pnfs_prepare_layoutreturn(lo);
...@@ -1766,7 +1766,7 @@ pnfs_mark_matching_lsegs_return(struct pnfs_layout_hdr *lo, ...@@ -1766,7 +1766,7 @@ pnfs_mark_matching_lsegs_return(struct pnfs_layout_hdr *lo,
pnfs_set_plh_return_iomode(lo, return_range->iomode); pnfs_set_plh_return_iomode(lo, return_range->iomode);
if (!mark_lseg_invalid(lseg, tmp_list)) if (!mark_lseg_invalid(lseg, tmp_list))
remaining++; remaining++;
set_bit(NFS_LAYOUT_RETURN_BEFORE_CLOSE, set_bit(NFS_LAYOUT_RETURN_REQUESTED,
&lo->plh_flags); &lo->plh_flags);
} }
return remaining; return remaining;
......
...@@ -94,8 +94,8 @@ enum { ...@@ -94,8 +94,8 @@ enum {
NFS_LAYOUT_RO_FAILED = 0, /* get ro layout failed stop trying */ NFS_LAYOUT_RO_FAILED = 0, /* get ro layout failed stop trying */
NFS_LAYOUT_RW_FAILED, /* get rw layout failed stop trying */ NFS_LAYOUT_RW_FAILED, /* get rw layout failed stop trying */
NFS_LAYOUT_BULK_RECALL, /* bulk recall affecting layout */ NFS_LAYOUT_BULK_RECALL, /* bulk recall affecting layout */
NFS_LAYOUT_RETURN, /* Return this layout ASAP */ NFS_LAYOUT_RETURN, /* layoutreturn in progress */
NFS_LAYOUT_RETURN_BEFORE_CLOSE, /* Return this layout before close */ NFS_LAYOUT_RETURN_REQUESTED, /* Return this layout ASAP */
NFS_LAYOUT_INVALID_STID, /* layout stateid id is invalid */ NFS_LAYOUT_INVALID_STID, /* layout stateid id is invalid */
NFS_LAYOUT_FIRST_LAYOUTGET, /* Serialize first layoutget */ NFS_LAYOUT_FIRST_LAYOUTGET, /* Serialize first layoutget */
}; };
......
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