linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] export generic_drop_inode()
@ 2005-06-11  2:18 Mark Fasheh
  2005-06-11  7:03 ` Nick Piggin
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Fasheh @ 2005-06-11  2:18 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel; +Cc: torvalds, akpm, viro

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.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>

diff -aru linux-2.6.12-rc6.orig/fs/inode.c linux-2.6.12-rc6/fs/inode.c
--- linux-2.6.12-rc6.orig/fs/inode.c	2005-06-06 08:22:29.000000000 -0700
+++ linux-2.6.12-rc6/fs/inode.c	2005-06-10 18:27:07.000000000 -0700
@@ -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. 
diff -aru linux-2.6.12-rc6.orig/include/linux/fs.h linux-2.6.12-rc6/include/linux/fs.h
--- linux-2.6.12-rc6.orig/include/linux/fs.h	2005-06-06 08:22:29.000000000 -0700
+++ linux-2.6.12-rc6/include/linux/fs.h	2005-06-10 17:13:18.000000000 -0700
@@ -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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] export generic_drop_inode()
  2005-06-11  2:18 [PATCH] export generic_drop_inode() Mark Fasheh
@ 2005-06-11  7:03 ` Nick Piggin
  2005-06-11  7:25   ` Mark Fasheh
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Piggin @ 2005-06-11  7:03 UTC (permalink / raw)
  To: Mark Fasheh; +Cc: linux-kernel, linux-fsdevel, torvalds, akpm, viro

Mark Fasheh wrote:

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

-- 
SUSE Labs, Novell Inc.

Send instant messages to your online friends http://au.messenger.yahoo.com 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] export generic_drop_inode()
  2005-06-11  7:03 ` Nick Piggin
@ 2005-06-11  7:25   ` Mark Fasheh
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Fasheh @ 2005-06-11  7:25 UTC (permalink / raw)
  To: Nick Piggin; +Cc: linux-kernel, linux-fsdevel, torvalds, akpm, viro

On Sat, Jun 11, 2005 at 05:03:59PM +1000, Nick Piggin wrote:
> 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.
No problem. I apologize if I stepped on anyone's toes by using EXPORT_SYMBOL
:) Here's a patch using EXPORT_SYMBOL_GPL instead.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>

diff -aur linux-2.6.12-rc6.orig/fs/inode.c linux-2.6.12-rc6/fs/inode.c
--- linux-2.6.12-rc6.orig/fs/inode.c	2005-06-06 08:22:29.000000000 -0700
+++ linux-2.6.12-rc6/fs/inode.c	2005-06-11 00:15:06.000000000 -0700
@@ -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. 
diff -aur linux-2.6.12-rc6.orig/include/linux/fs.h linux-2.6.12-rc6/include/linux/fs.h
--- linux-2.6.12-rc6.orig/include/linux/fs.h	2005-06-06 08:22:29.000000000 -0700
+++ linux-2.6.12-rc6/include/linux/fs.h	2005-06-10 17:13:18.000000000 -0700
@@ -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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-06-11  7:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-11  2:18 [PATCH] export generic_drop_inode() Mark Fasheh
2005-06-11  7:03 ` Nick Piggin
2005-06-11  7:25   ` Mark Fasheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).