NFSv4.1: Remove the NFS_LAYOUT_RETURNED state
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 21 Sep 2012 20:37:02 +0000 (16:37 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 28 Sep 2012 20:03:17 +0000 (16:03 -0400)
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>
fs/nfs/pnfs.c
fs/nfs/pnfs.h

index 174c51a5001cde599703be92ac6d04bdd8184950..20a1b6222ff689b0317683f06c9cd05c7fa0bfaa 100644 (file)
@@ -692,7 +692,7 @@ _pnfs_return_layout(struct inode *ino)
 
        spin_lock(&ino->i_lock);
        lo = nfsi->layout;
-       if (!lo || pnfs_test_layout_returned(lo)) {
+       if (!lo) {
                spin_unlock(&ino->i_lock);
                dprintk("NFS: %s no layout to return\n", __func__);
                goto out;
@@ -710,7 +710,6 @@ _pnfs_return_layout(struct inode *ino)
                goto out;
        }
        lo->plh_block_lgets++;
-       pnfs_mark_layout_returned(lo);
        spin_unlock(&ino->i_lock);
        pnfs_free_lseg_list(&tmp_list);
 
@@ -721,7 +720,6 @@ _pnfs_return_layout(struct inode *ino)
                status = -ENOMEM;
                pnfs_layout_io_set_failed(lo, IOMODE_RW);
                pnfs_layout_io_set_failed(lo, IOMODE_READ);
-               pnfs_clear_layout_returned(lo);
                pnfs_put_layout_hdr(lo);
                goto out;
        }
@@ -1111,9 +1109,6 @@ pnfs_update_layout(struct inode *ino,
        if (list_empty(&lo->plh_segs))
                first = true;
 
-       /* Enable LAYOUTRETURNs */
-       pnfs_clear_layout_returned(lo);
-
        spin_unlock(&ino->i_lock);
        if (first) {
                /* The lo must be on the clp list if there is any
index 92f6ce6532ba728793e1c5dc09e8e7e4ffe869b1..6cede2c6c9610b34e7f51754a892df2740539b85 100644 (file)
@@ -62,7 +62,6 @@ enum {
        NFS_LAYOUT_RW_FAILED,           /* get rw layout failed stop trying */
        NFS_LAYOUT_BULK_RECALL,         /* bulk recall affecting layout */
        NFS_LAYOUT_ROC,                 /* some lseg had roc bit set */
-       NFS_LAYOUT_RETURNED,            /* layout has already been returned */
 };
 
 enum layoutdriver_policy_flags {
@@ -259,24 +258,6 @@ void nfs4_mark_deviceid_unavailable(struct nfs4_deviceid_node *node);
 bool nfs4_test_deviceid_unavailable(struct nfs4_deviceid_node *node);
 void nfs4_deviceid_purge_client(const struct nfs_client *);
 
-static inline void
-pnfs_mark_layout_returned(struct pnfs_layout_hdr *lo)
-{
-       set_bit(NFS_LAYOUT_RETURNED, &lo->plh_flags);
-}
-
-static inline void
-pnfs_clear_layout_returned(struct pnfs_layout_hdr *lo)
-{
-       clear_bit(NFS_LAYOUT_RETURNED, &lo->plh_flags);
-}
-
-static inline bool
-pnfs_test_layout_returned(struct pnfs_layout_hdr *lo)
-{
-       return test_bit(NFS_LAYOUT_RETURNED, &lo->plh_flags);
-}
-
 static inline struct pnfs_layout_segment *
 pnfs_get_lseg(struct pnfs_layout_segment *lseg)
 {