]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
NFSv4.1: Clean up pnfs_put_lseg()
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 21 Sep 2012 00:46:49 +0000 (20:46 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 21 Sep 2012 23:22:07 +0000 (19:22 -0400)
There is no longer a need to use pnfs_free_lseg_list(). Just call
pnfs_free_lseg() directly.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/pnfs.c

index 0ceb3feb08f73ed1c0408654b01bc9f785f659a8..a93c734f14c907f070d0a8df90c38fc2b0f60a8c 100644 (file)
@@ -290,7 +290,7 @@ init_lseg(struct pnfs_layout_hdr *lo, struct pnfs_layout_segment *lseg)
        lseg->pls_layout = lo;
 }
 
-static void free_lseg(struct pnfs_layout_segment *lseg)
+static void pnfs_free_lseg(struct pnfs_layout_segment *lseg)
 {
        struct inode *ino = lseg->pls_layout->plh_inode;
 
@@ -327,12 +327,9 @@ pnfs_put_lseg(struct pnfs_layout_segment *lseg)
        lo = lseg->pls_layout;
        inode = lo->plh_inode;
        if (atomic_dec_and_lock(&lseg->pls_refcount, &inode->i_lock)) {
-               LIST_HEAD(free_me);
-
                pnfs_layout_remove_lseg(lo, lseg);
                spin_unlock(&inode->i_lock);
-               list_add(&lseg->pls_list, &free_me);
-               pnfs_free_lseg_list(&free_me);
+               pnfs_free_lseg(lseg);
        }
 }
 EXPORT_SYMBOL_GPL(pnfs_put_lseg);
@@ -469,7 +466,7 @@ pnfs_free_lseg_list(struct list_head *free_me)
 
        list_for_each_entry_safe(lseg, tmp, free_me, pls_list) {
                list_del(&lseg->pls_list);
-               free_lseg(lseg);
+               pnfs_free_lseg(lseg);
        }
 }