]> git.neil.brown.name Git - LaFS.git/commitdiff
Use igrab_fs for I_Pinned handling.
authorNeilBrown <neilb@suse.de>
Sun, 10 Oct 2010 23:05:12 +0000 (10:05 +1100)
committerNeilBrown <neilb@suse.de>
Sun, 10 Oct 2010 23:33:56 +0000 (10:33 +1100)
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 <neilb@suse.de>
inode.c
state.h

diff --git a/inode.c b/inode.c
index 8b13b4a88970abda05b87c3cc201a58781bb583e..1c651725de7bc4bd1fac516d26b133dea707bc45 100644 (file)
--- 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 c422cd12e22678204c1003ec3c9d051186c1c671..a8ae6a4017a33a12db6dd82837010fefbca092bd 100644 (file)
--- 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