export generic_drop_inode()
PATCH 1/1 export generic_drop_inode()
Hi,
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.
fs/inode.c +3 -1
@@ -1048,7 +1048,7 @@* inode when the usage count drops to zero, and * i_nlink is zero. */ -static void generic_drop_inode (struct inode *inode) +void generic_drop_inode (struct inode *inode) {if (!inode->i_nlink)generic_delete_inode (inode);
@@ -1056,6 +1056,8 @@generic_forget_inode (inode); } +EXPORT_SYMBOL (generic_drop_inode); +/* * Called when we're dropping the last reference * to an inode.
include/linux/fs.h +1 -0
@@ -1411,6 +1411,7 @@extern ino_t iunique (struct super_block *,ino_t );extern int inode_needs_sync (struct inode *inode);extern void generic_delete_inode (struct inode *inode); +extern void generic_drop_inode (struct inode *inode);extern struct inode *ilookup5 (struct super_block *sb,unsigned long hashval,int (*test)(struct inode *,void *),void *data);
fs/inode.c line 1060
Quoted 6 lines · Mark Fasheh
fs/inode.c +2
-0@@ -1056,6 +1056,8 @@generic_forget_inode (inode); } +EXPORT_SYMBOL (generic_drop_inode); +
I think it is best to default these to EXPORT_SYMBOL_GPL to be on the safe side, unless you have the agreement of the authors of the code, in which case I beg your pardon.
Thanks,
Nick
Signature · 3 lines
SUSE Labs, Novell Inc. Send instant messages to your online friends http://au.messenger.yahoo.com
Quoted 3 lines · Nick Piggin
I think it is best to default these to
EXPORT_SYMBOL_GPLto be on the safe side, unless you have the agreement of the authors of the code, in which case I beg your pardon.
No problem. I apologize if I stepped on anyone's toes by using EXPORT_SYMBOL :) Here's a patch using EXPORT_SYMBOL_GPL instead.
fs/inode.c +3 -1
@@ -1048,7 +1048,7 @@* inode when the usage count drops to zero, and * i_nlink is zero. */ -static void generic_drop_inode (struct inode *inode) +void generic_drop_inode (struct inode *inode) {if (!inode->i_nlink)generic_delete_inode (inode);
@@ -1056,6 +1056,8 @@generic_forget_inode (inode); } +EXPORT_SYMBOL_GPL (generic_drop_inode); +/* * Called when we're dropping the last reference * to an inode.
include/linux/fs.h +1 -0
@@ -1411,6 +1411,7 @@extern ino_t iunique (struct super_block *,ino_t );extern int inode_needs_sync (struct inode *inode);extern void generic_delete_inode (struct inode *inode); +extern void generic_drop_inode (struct inode *inode);extern struct inode *ilookup5 (struct super_block *sb,unsigned long hashval,int (*test)(struct inode *,void *),void *data);