diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-01-27 20:32:50 -0500 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-01-27 20:40:05 -0500 |
commit | 2370abdab530718b61afc222c51901bdc2884ee2 (patch) | |
tree | 42bcdef3d17c02ffdc65a376bdf6567ae09b45b7 | |
parent | 13c13a6ad71f98c3b6189dfc89a9a743ab02a39a (diff) |
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: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r-- | fs/nfs/flexfilelayout/flexfilelayout.c | 2 | ||||
-rw-r--r-- | fs/nfs/flexfilelayout/flexfilelayoutdev.c | 2 | ||||
-rw-r--r-- | fs/nfs/pnfs.c | 10 | ||||
-rw-r--r-- | fs/nfs/pnfs.h | 4 |
4 files changed, 9 insertions, 9 deletions
diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index 5bcd92d50e82..0cb1abd535e3 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c | |||
@@ -1215,7 +1215,7 @@ static int ff_layout_read_done_cb(struct rpc_task *task, | |||
1215 | hdr->pgio_mirror_idx + 1, | 1215 | hdr->pgio_mirror_idx + 1, |
1216 | &hdr->pgio_mirror_idx)) | 1216 | &hdr->pgio_mirror_idx)) |
1217 | goto out_eagain; | 1217 | goto out_eagain; |
1218 | set_bit(NFS_LAYOUT_RETURN_BEFORE_CLOSE, | 1218 | set_bit(NFS_LAYOUT_RETURN_REQUESTED, |
1219 | &hdr->lseg->pls_layout->plh_flags); | 1219 | &hdr->lseg->pls_layout->plh_flags); |
1220 | pnfs_read_resend_pnfs(hdr); | 1220 | pnfs_read_resend_pnfs(hdr); |
1221 | return task->tk_status; | 1221 | return task->tk_status; |
diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c b/fs/nfs/flexfilelayout/flexfilelayoutdev.c index 29898a9550fa..eb370460ce20 100644 --- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c +++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c | |||
@@ -412,7 +412,7 @@ nfs4_ff_layout_prepare_ds(struct pnfs_layout_segment *lseg, u32 ds_idx, | |||
412 | OP_ILLEGAL, GFP_NOIO); | 412 | OP_ILLEGAL, GFP_NOIO); |
413 | if (!fail_return) { | 413 | if (!fail_return) { |
414 | if (ff_layout_has_available_ds(lseg)) | 414 | if (ff_layout_has_available_ds(lseg)) |
415 | set_bit(NFS_LAYOUT_RETURN_BEFORE_CLOSE, | 415 | set_bit(NFS_LAYOUT_RETURN_REQUESTED, |
416 | &lseg->pls_layout->plh_flags); | 416 | &lseg->pls_layout->plh_flags); |
417 | else | 417 | else |
418 | pnfs_error_mark_layout_for_return(ino, lseg); | 418 | pnfs_error_mark_layout_for_return(ino, lseg); |
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 9c20685d4961..482b6e94bb37 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -885,7 +885,7 @@ pnfs_prepare_layoutreturn(struct pnfs_layout_hdr *lo) | |||
885 | return false; | 885 | return false; |
886 | lo->plh_return_iomode = 0; | 886 | lo->plh_return_iomode = 0; |
887 | pnfs_get_layout_hdr(lo); | 887 | pnfs_get_layout_hdr(lo); |
888 | clear_bit(NFS_LAYOUT_RETURN_BEFORE_CLOSE, &lo->plh_flags); | 888 | clear_bit(NFS_LAYOUT_RETURN_REQUESTED, &lo->plh_flags); |
889 | return true; | 889 | return true; |
890 | } | 890 | } |
891 | 891 | ||
@@ -929,7 +929,7 @@ pnfs_layout_need_return(struct pnfs_layout_hdr *lo) | |||
929 | { | 929 | { |
930 | struct pnfs_layout_segment *s; | 930 | struct pnfs_layout_segment *s; |
931 | 931 | ||
932 | if (!test_bit(NFS_LAYOUT_RETURN_BEFORE_CLOSE, &lo->plh_flags)) | 932 | if (!test_bit(NFS_LAYOUT_RETURN_REQUESTED, &lo->plh_flags)) |
933 | return false; | 933 | return false; |
934 | 934 | ||
935 | /* Defer layoutreturn until all lsegs are done */ | 935 | /* 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 | { | 945 | { |
946 | struct inode *inode= lo->plh_inode; | 946 | struct inode *inode= lo->plh_inode; |
947 | 947 | ||
948 | if (!test_bit(NFS_LAYOUT_RETURN_BEFORE_CLOSE, &lo->plh_flags)) | 948 | if (!test_bit(NFS_LAYOUT_RETURN_REQUESTED, &lo->plh_flags)) |
949 | return; | 949 | return; |
950 | spin_lock(&inode->i_lock); | 950 | spin_lock(&inode->i_lock); |
951 | if (pnfs_layout_need_return(lo)) { | 951 | if (pnfs_layout_need_return(lo)) { |
@@ -1085,7 +1085,7 @@ bool pnfs_roc(struct inode *ino) | |||
1085 | 1085 | ||
1086 | nfs4_stateid_copy(&stateid, &lo->plh_stateid); | 1086 | nfs4_stateid_copy(&stateid, &lo->plh_stateid); |
1087 | /* always send layoutreturn if being marked so */ | 1087 | /* always send layoutreturn if being marked so */ |
1088 | if (test_and_clear_bit(NFS_LAYOUT_RETURN_BEFORE_CLOSE, | 1088 | if (test_and_clear_bit(NFS_LAYOUT_RETURN_REQUESTED, |
1089 | &lo->plh_flags)) | 1089 | &lo->plh_flags)) |
1090 | layoutreturn = pnfs_prepare_layoutreturn(lo); | 1090 | layoutreturn = pnfs_prepare_layoutreturn(lo); |
1091 | 1091 | ||
@@ -1766,7 +1766,7 @@ pnfs_mark_matching_lsegs_return(struct pnfs_layout_hdr *lo, | |||
1766 | pnfs_set_plh_return_iomode(lo, return_range->iomode); | 1766 | pnfs_set_plh_return_iomode(lo, return_range->iomode); |
1767 | if (!mark_lseg_invalid(lseg, tmp_list)) | 1767 | if (!mark_lseg_invalid(lseg, tmp_list)) |
1768 | remaining++; | 1768 | remaining++; |
1769 | set_bit(NFS_LAYOUT_RETURN_BEFORE_CLOSE, | 1769 | set_bit(NFS_LAYOUT_RETURN_REQUESTED, |
1770 | &lo->plh_flags); | 1770 | &lo->plh_flags); |
1771 | } | 1771 | } |
1772 | return remaining; | 1772 | return remaining; |
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h index 9f4e2a47f4aa..1ac1db5f6dad 100644 --- a/fs/nfs/pnfs.h +++ b/fs/nfs/pnfs.h | |||
@@ -94,8 +94,8 @@ enum { | |||
94 | NFS_LAYOUT_RO_FAILED = 0, /* get ro layout failed stop trying */ | 94 | NFS_LAYOUT_RO_FAILED = 0, /* get ro layout failed stop trying */ |
95 | NFS_LAYOUT_RW_FAILED, /* get rw layout failed stop trying */ | 95 | NFS_LAYOUT_RW_FAILED, /* get rw layout failed stop trying */ |
96 | NFS_LAYOUT_BULK_RECALL, /* bulk recall affecting layout */ | 96 | NFS_LAYOUT_BULK_RECALL, /* bulk recall affecting layout */ |
97 | NFS_LAYOUT_RETURN, /* Return this layout ASAP */ | 97 | NFS_LAYOUT_RETURN, /* layoutreturn in progress */ |
98 | NFS_LAYOUT_RETURN_BEFORE_CLOSE, /* Return this layout before close */ | 98 | NFS_LAYOUT_RETURN_REQUESTED, /* Return this layout ASAP */ |
99 | NFS_LAYOUT_INVALID_STID, /* layout stateid id is invalid */ | 99 | NFS_LAYOUT_INVALID_STID, /* layout stateid id is invalid */ |
100 | NFS_LAYOUT_FIRST_LAYOUTGET, /* Serialize first layoutget */ | 100 | NFS_LAYOUT_FIRST_LAYOUTGET, /* Serialize first layoutget */ |
101 | }; | 101 | }; |