From 7942d6f68c750e5cd6d133bf40ab57da88b84b8c Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 11 Oct 2010 10:05:12 +1100 Subject: [PATCH] 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 --- inode.c | 6 +++--- state.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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 -- 2.39.5