Commit cb2c0233755429037462e16ea0d5497a0092738c

Authored by Mark Fasheh
Committed by Linus Torvalds
1 parent ca3f5a95b7

[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>

Showing 2 changed files with 4 additions and 1 deletions Side-by-side Diff

... ... @@ -1052,13 +1052,15 @@
1052 1052 * inode when the usage count drops to zero, and
1053 1053 * i_nlink is zero.
1054 1054 */
1055   -static void generic_drop_inode(struct inode *inode)
  1055 +void generic_drop_inode(struct inode *inode)
1056 1056 {
1057 1057 if (!inode->i_nlink)
1058 1058 generic_delete_inode(inode);
1059 1059 else
1060 1060 generic_forget_inode(inode);
1061 1061 }
  1062 +
  1063 +EXPORT_SYMBOL_GPL(generic_drop_inode);
1062 1064  
1063 1065 /*
1064 1066 * Called when we're dropping the last reference
... ... @@ -1435,6 +1435,7 @@
1435 1435 extern ino_t iunique(struct super_block *, ino_t);
1436 1436 extern int inode_needs_sync(struct inode *inode);
1437 1437 extern void generic_delete_inode(struct inode *inode);
  1438 +extern void generic_drop_inode(struct inode *inode);
1438 1439  
1439 1440 extern struct inode *ilookup5(struct super_block *sb, unsigned long hashval,
1440 1441 int (*test)(struct inode *, void *), void *data);