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;
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);
list_for_each_entry_safe(lseg, tmp, free_me, pls_list) {
list_del(&lseg->pls_list);
- free_lseg(lseg);
+ pnfs_free_lseg(lseg);
}
}