From: NeilBrown Date: Fri, 4 Mar 2011 23:44:23 +0000 (+1100) Subject: checkpin: don't hold references on primary superblock. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=2d5ba74b5950d6930280adb4abce32ed26010fe0;p=LaFS.git 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 --- 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); + } } } }