Commit 905ca191 authored by Trond Myklebust's avatar Trond Myklebust

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: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 9c626381
...@@ -315,7 +315,7 @@ init_lseg(struct pnfs_layout_hdr *lo, struct pnfs_layout_segment *lseg) ...@@ -315,7 +315,7 @@ init_lseg(struct pnfs_layout_hdr *lo, struct pnfs_layout_segment *lseg)
lseg->pls_layout = lo; 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; struct inode *ino = lseg->pls_layout->plh_inode;
...@@ -352,12 +352,9 @@ pnfs_put_lseg(struct pnfs_layout_segment *lseg) ...@@ -352,12 +352,9 @@ pnfs_put_lseg(struct pnfs_layout_segment *lseg)
lo = lseg->pls_layout; lo = lseg->pls_layout;
inode = lo->plh_inode; inode = lo->plh_inode;
if (atomic_dec_and_lock(&lseg->pls_refcount, &inode->i_lock)) { if (atomic_dec_and_lock(&lseg->pls_refcount, &inode->i_lock)) {
LIST_HEAD(free_me);
pnfs_layout_remove_lseg(lo, lseg); pnfs_layout_remove_lseg(lo, lseg);
spin_unlock(&inode->i_lock); spin_unlock(&inode->i_lock);
list_add(&lseg->pls_list, &free_me); pnfs_free_lseg(lseg);
pnfs_free_lseg_list(&free_me);
} }
} }
EXPORT_SYMBOL_GPL(pnfs_put_lseg); EXPORT_SYMBOL_GPL(pnfs_put_lseg);
...@@ -494,7 +491,7 @@ pnfs_free_lseg_list(struct list_head *free_me) ...@@ -494,7 +491,7 @@ pnfs_free_lseg_list(struct list_head *free_me)
list_for_each_entry_safe(lseg, tmp, free_me, pls_list) { list_for_each_entry_safe(lseg, tmp, free_me, pls_list) {
list_del(&lseg->pls_list); list_del(&lseg->pls_list);
free_lseg(lseg); pnfs_free_lseg(lseg);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment