aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Fasheh <mark.fasheh@oracle.com>2005-07-07 20:56:03 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-07 21:23:35 -0400
commitcb2c0233755429037462e16ea0d5497a0092738c (patch)
tree49c5d19090986c71b59dd2fb4c57b1e1ae33062d
parentca3f5a95b7d04eef0f88464f8d3299c1c01e8e13 (diff)
[PATCH] export generic_drop_inode() to modules
OCFS2 wants to mark an inode which has been orphaned by another node so that during final iput it takes the correct path through the VFS and can pass through the OCFS2 delete_inode callback. Since i_nlink can get out of date with other nodes, the best way I see to accomplish this is by clearing i_nlink on those inodes at drop_inode time. Other than this small amount of work, nothing different needs to happen, so I think it would be cleanest to be able to just call generic_drop_inode at the end of the OCFS2 drop_inode callback. Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--fs/inode.c4
-rw-r--r--include/linux/fs.h1
2 files changed, 4 insertions, 1 deletions
diff --git a/fs/inode.c b/fs/inode.c
index 1f9a3a2b89bc..6d695037a0a3 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -1052,7 +1052,7 @@ static void generic_forget_inode(struct inode *inode)
1052 * inode when the usage count drops to zero, and 1052 * inode when the usage count drops to zero, and
1053 * i_nlink is zero. 1053 * i_nlink is zero.
1054 */ 1054 */
1055static void generic_drop_inode(struct inode *inode) 1055void generic_drop_inode(struct inode *inode)
1056{ 1056{
1057 if (!inode->i_nlink) 1057 if (!inode->i_nlink)
1058 generic_delete_inode(inode); 1058 generic_delete_inode(inode);
@@ -1060,6 +1060,8 @@ static void generic_drop_inode(struct inode *inode)
1060 generic_forget_inode(inode); 1060 generic_forget_inode(inode);
1061} 1061}
1062 1062
1063EXPORT_SYMBOL_GPL(generic_drop_inode);
1064
1063/* 1065/*
1064 * Called when we're dropping the last reference 1066 * Called when we're dropping the last reference
1065 * to an inode. 1067 * to an inode.
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 047bde30836a..302ec20838ca 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1435,6 +1435,7 @@ extern struct inode * igrab(struct inode *);
1435extern ino_t iunique(struct super_block *, ino_t); 1435extern ino_t iunique(struct super_block *, ino_t);
1436extern int inode_needs_sync(struct inode *inode); 1436extern int inode_needs_sync(struct inode *inode);
1437extern void generic_delete_inode(struct inode *inode); 1437extern void generic_delete_inode(struct inode *inode);
1438extern void generic_drop_inode(struct inode *inode);
1438 1439
1439extern struct inode *ilookup5(struct super_block *sb, unsigned long hashval, 1440extern struct inode *ilookup5(struct super_block *sb, unsigned long hashval,
1440 int (*test)(struct inode *, void *), void *data); 1441 int (*test)(struct inode *, void *), void *data);