From 2d5ba74b5950d6930280adb4abce32ed26010fe0 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Sat, 5 Mar 2011 10:44:23 +1100 Subject: [PATCH] checkpin: don't hold references on primary superblock. This isn't really a need to hold a reference on the primary superblock as everything else does and when the last reference goes it will stop the cleaner so these references won't be needed any. This is only an interim solution - we will be removing the multiple superblocks soon and all this will go away. Signed-off-by: NeilBrown --- inode.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/inode.c b/inode.c index 59979b7..50ecf31 100644 --- a/inode.c +++ b/inode.c @@ -648,8 +648,12 @@ void lafs_inode_checkpin(struct inode *ino) */ if (ino->i_nlink == 0) { /* I_Pinned should not be set */ - if (test_and_clear_bit(I_Pinned, &LAFSI(ino)->iflags)) - lafs_iput_fs(ino); + if (test_and_clear_bit(I_Pinned, &LAFSI(ino)->iflags)) { + if (ino->i_sb->s_type == &lafs_fs_type) + iput(ino); + else + lafs_iput_fs(ino); + } } else { /* Need to check if iblock is Pinned. */ struct indexblock *ib = NULL; @@ -661,11 +665,19 @@ void lafs_inode_checkpin(struct inode *ino) spin_unlock(&ino->i_data.private_lock); } if (ib) { - if (!test_and_set_bit(I_Pinned, &LAFSI(ino)->iflags)) - lafs_igrab_fs(ino); + if (!test_and_set_bit(I_Pinned, &LAFSI(ino)->iflags)) { + if (ino->i_sb->s_type == &lafs_fs_type) + igrab(ino); + else + lafs_igrab_fs(ino); + } } else { - if (test_and_clear_bit(I_Pinned, &LAFSI(ino)->iflags)) + if (test_and_clear_bit(I_Pinned, &LAFSI(ino)->iflags)) { + if (ino->i_sb->s_type == &lafs_fs_type) + iput(ino); + else lafs_iput_fs(ino); + } } } } -- 2.39.5