diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-09-21 16:37:02 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-09-28 16:03:17 -0400 |
commit | e5929f3cff05e84f20c68df235f4768920e2e89e (patch) | |
tree | 849a2fec772d7c8d9a54288659f9d4ba9c8a915f /fs | |
parent | 173f77e9c5cbddb02eebe17dd9c48d39e5eb86b9 (diff) |
NFSv4.1: Remove the NFS_LAYOUT_RETURNED state
It serves no purpose that the test for whether or not we have valid
layout segments doesn't already serve.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/pnfs.c | 7 | ||||
-rw-r--r-- | fs/nfs/pnfs.h | 19 |
2 files changed, 1 insertions, 25 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 174c51a5001..20a1b6222ff 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -692,7 +692,7 @@ _pnfs_return_layout(struct inode *ino) | |||
692 | 692 | ||
693 | spin_lock(&ino->i_lock); | 693 | spin_lock(&ino->i_lock); |
694 | lo = nfsi->layout; | 694 | lo = nfsi->layout; |
695 | if (!lo || pnfs_test_layout_returned(lo)) { | 695 | if (!lo) { |
696 | spin_unlock(&ino->i_lock); | 696 | spin_unlock(&ino->i_lock); |
697 | dprintk("NFS: %s no layout to return\n", __func__); | 697 | dprintk("NFS: %s no layout to return\n", __func__); |
698 | goto out; | 698 | goto out; |
@@ -710,7 +710,6 @@ _pnfs_return_layout(struct inode *ino) | |||
710 | goto out; | 710 | goto out; |
711 | } | 711 | } |
712 | lo->plh_block_lgets++; | 712 | lo->plh_block_lgets++; |
713 | pnfs_mark_layout_returned(lo); | ||
714 | spin_unlock(&ino->i_lock); | 713 | spin_unlock(&ino->i_lock); |
715 | pnfs_free_lseg_list(&tmp_list); | 714 | pnfs_free_lseg_list(&tmp_list); |
716 | 715 | ||
@@ -721,7 +720,6 @@ _pnfs_return_layout(struct inode *ino) | |||
721 | status = -ENOMEM; | 720 | status = -ENOMEM; |
722 | pnfs_layout_io_set_failed(lo, IOMODE_RW); | 721 | pnfs_layout_io_set_failed(lo, IOMODE_RW); |
723 | pnfs_layout_io_set_failed(lo, IOMODE_READ); | 722 | pnfs_layout_io_set_failed(lo, IOMODE_READ); |
724 | pnfs_clear_layout_returned(lo); | ||
725 | pnfs_put_layout_hdr(lo); | 723 | pnfs_put_layout_hdr(lo); |
726 | goto out; | 724 | goto out; |
727 | } | 725 | } |
@@ -1111,9 +1109,6 @@ pnfs_update_layout(struct inode *ino, | |||
1111 | if (list_empty(&lo->plh_segs)) | 1109 | if (list_empty(&lo->plh_segs)) |
1112 | first = true; | 1110 | first = true; |
1113 | 1111 | ||
1114 | /* Enable LAYOUTRETURNs */ | ||
1115 | pnfs_clear_layout_returned(lo); | ||
1116 | |||
1117 | spin_unlock(&ino->i_lock); | 1112 | spin_unlock(&ino->i_lock); |
1118 | if (first) { | 1113 | if (first) { |
1119 | /* The lo must be on the clp list if there is any | 1114 | /* The lo must be on the clp list if there is any |
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h index 92f6ce6532b..6cede2c6c96 100644 --- a/fs/nfs/pnfs.h +++ b/fs/nfs/pnfs.h | |||
@@ -62,7 +62,6 @@ enum { | |||
62 | NFS_LAYOUT_RW_FAILED, /* get rw layout failed stop trying */ | 62 | NFS_LAYOUT_RW_FAILED, /* get rw layout failed stop trying */ |
63 | NFS_LAYOUT_BULK_RECALL, /* bulk recall affecting layout */ | 63 | NFS_LAYOUT_BULK_RECALL, /* bulk recall affecting layout */ |
64 | NFS_LAYOUT_ROC, /* some lseg had roc bit set */ | 64 | NFS_LAYOUT_ROC, /* some lseg had roc bit set */ |
65 | NFS_LAYOUT_RETURNED, /* layout has already been returned */ | ||
66 | }; | 65 | }; |
67 | 66 | ||
68 | enum layoutdriver_policy_flags { | 67 | enum layoutdriver_policy_flags { |
@@ -259,24 +258,6 @@ void nfs4_mark_deviceid_unavailable(struct nfs4_deviceid_node *node); | |||
259 | bool nfs4_test_deviceid_unavailable(struct nfs4_deviceid_node *node); | 258 | bool nfs4_test_deviceid_unavailable(struct nfs4_deviceid_node *node); |
260 | void nfs4_deviceid_purge_client(const struct nfs_client *); | 259 | void nfs4_deviceid_purge_client(const struct nfs_client *); |
261 | 260 | ||
262 | static inline void | ||
263 | pnfs_mark_layout_returned(struct pnfs_layout_hdr *lo) | ||
264 | { | ||
265 | set_bit(NFS_LAYOUT_RETURNED, &lo->plh_flags); | ||
266 | } | ||
267 | |||
268 | static inline void | ||
269 | pnfs_clear_layout_returned(struct pnfs_layout_hdr *lo) | ||
270 | { | ||
271 | clear_bit(NFS_LAYOUT_RETURNED, &lo->plh_flags); | ||
272 | } | ||
273 | |||
274 | static inline bool | ||
275 | pnfs_test_layout_returned(struct pnfs_layout_hdr *lo) | ||
276 | { | ||
277 | return test_bit(NFS_LAYOUT_RETURNED, &lo->plh_flags); | ||
278 | } | ||
279 | |||
280 | static inline struct pnfs_layout_segment * | 261 | static inline struct pnfs_layout_segment * |
281 | pnfs_get_lseg(struct pnfs_layout_segment *lseg) | 262 | pnfs_get_lseg(struct pnfs_layout_segment *lseg) |
282 | { | 263 | { |