[16/17] SQUASHME restore lost put_lseg code
diff mbox

Message ID 1297389170-26702-17-git-send-email-andros@netapp.com
State RFC, archived
Headers show

Commit Message

Andy Adamson Feb. 11, 2011, 1:52 a.m. UTC
None

Patch
diff mbox

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 31e5f55..dc15a76 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -278,9 +278,12 @@  put_lseg(struct pnfs_layout_segment *lseg)
 		test_bit(NFS_LSEG_VALID, &lseg->pls_flags));
 	ino = lseg->pls_layout->plh_inode;
 	if (atomic_dec_and_lock(&lseg->pls_refcount, &ino->i_lock)) {
+		LIST_HEAD(free_me);
+
 		_put_lseg_common(lseg);
+		list_add(&lseg->pls_list, &free_me);
 		spin_unlock(&ino->i_lock);
-		free_lseg(lseg);
+		pnfs_free_lseg_list(&free_me);
 	}
 }
 EXPORT_SYMBOL_GPL(put_lseg);