aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-09-20 20:46:49 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-09-28 16:03:15 -0400
commit905ca191cfe1ab18822d86e3ddef1b1b38832fdc (patch)
treeb8e6a5056878adf3f0f3423f3f8c859467e16112
parent9c6263819f25254f2ed48f076b50096dd5893dfb (diff)
NFSv4.1: Clean up pnfs_put_lseg()
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>
-rw-r--r--fs/nfs/pnfs.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 11cc0ad6b409..c34ba9a0a46f 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -315,7 +315,7 @@ init_lseg(struct pnfs_layout_hdr *lo, struct pnfs_layout_segment *lseg)
315 lseg->pls_layout = lo; 315 lseg->pls_layout = lo;
316} 316}
317 317
318static void free_lseg(struct pnfs_layout_segment *lseg) 318static void pnfs_free_lseg(struct pnfs_layout_segment *lseg)
319{ 319{
320 struct inode *ino = lseg->pls_layout->plh_inode; 320 struct inode *ino = lseg->pls_layout->plh_inode;
321 321
@@ -352,12 +352,9 @@ pnfs_put_lseg(struct pnfs_layout_segment *lseg)
352 lo = lseg->pls_layout; 352 lo = lseg->pls_layout;
353 inode = lo->plh_inode; 353 inode = lo->plh_inode;
354 if (atomic_dec_and_lock(&lseg->pls_refcount, &inode->i_lock)) { 354 if (atomic_dec_and_lock(&lseg->pls_refcount, &inode->i_lock)) {
355 LIST_HEAD(free_me);
356
357 pnfs_layout_remove_lseg(lo, lseg); 355 pnfs_layout_remove_lseg(lo, lseg);
358 spin_unlock(&inode->i_lock); 356 spin_unlock(&inode->i_lock);
359 list_add(&lseg->pls_list, &free_me); 357 pnfs_free_lseg(lseg);
360 pnfs_free_lseg_list(&free_me);
361 } 358 }
362} 359}
363EXPORT_SYMBOL_GPL(pnfs_put_lseg); 360EXPORT_SYMBOL_GPL(pnfs_put_lseg);
@@ -494,7 +491,7 @@ pnfs_free_lseg_list(struct list_head *free_me)
494 491
495 list_for_each_entry_safe(lseg, tmp, free_me, pls_list) { 492 list_for_each_entry_safe(lseg, tmp, free_me, pls_list) {
496 list_del(&lseg->pls_list); 493 list_del(&lseg->pls_list);
497 free_lseg(lseg); 494 pnfs_free_lseg(lseg);
498 } 495 }
499} 496}
500 497