From: NeilBrown Date: Sun, 10 Oct 2010 23:05:12 +0000 (+1100) Subject: Use igrab_fs for I_Pinned handling. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=7942d6f68c750e5cd6d133bf40ab57da88b84b8c;p=LaFS.git Use igrab_fs for I_Pinned handling. We hold references on inodes when the InoIdx block is pinned. This is needed for cleaning to make sure the inode doesn't disappear. But we also need the superblock to be held in this context. So use lafs_igrab_fs Signed-off-by: NeilBrown --- diff --git a/inode.c b/inode.c index 8b13b4a..1c65172 100644 --- a/inode.c +++ b/inode.c @@ -475,7 +475,7 @@ 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)) - iput(ino); + lafs_iput_fs(ino); } else { /* Need to check if iblock is Pinned. */ struct indexblock *ib = NULL; @@ -488,10 +488,10 @@ void lafs_inode_checkpin(struct inode *ino) } if (ib) { if (!test_and_set_bit(I_Pinned, &LAFSI(ino)->iflags)) - igrab(ino); + lafs_igrab_fs(ino); } else { if (test_and_clear_bit(I_Pinned, &LAFSI(ino)->iflags)) - iput(ino); + lafs_iput_fs(ino); } } } diff --git a/state.h b/state.h index c422cd1..a8ae6a4 100644 --- a/state.h +++ b/state.h @@ -558,7 +558,7 @@ struct lafs_inode { #define I_Destroyed 4 /* inode destroy has been delayed */ #define I_Trunc 5 /* a truncation is in process */ #define I_Pinned 6 /* InoIdx is pinned, i_nlink is non-zero, and consequently - * we own an extra ref to the inode. + * we own an extra ref to the inode and superblock. */ /* next three indicate if we hold a reference on the relevant qent */ #define I_QUid 8