linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATH 08/19] jfs: new export ops
@ 2007-08-30 13:16 Christoph Hellwig
  2007-09-10 19:45 ` [NFS] " J. Bruce Fields
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2007-08-30 13:16 UTC (permalink / raw)
  To: nfs, linux-fsdevel

[-- Attachment #1: jfs-implement-fh_to_dentry --]
[-- Type: text/plain, Size: 3490 bytes --]

Trivial switch over to the new generic helpers.


Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: linux-2.6/fs/jfs/jfs_inode.h
===================================================================
--- linux-2.6.orig/fs/jfs/jfs_inode.h	2007-07-19 15:56:46.000000000 +0200
+++ linux-2.6/fs/jfs/jfs_inode.h	2007-07-20 19:52:26.000000000 +0200
@@ -18,6 +18,8 @@
 #ifndef	_H_JFS_INODE
 #define _H_JFS_INODE
 
+struct fid;
+
 extern struct inode *ialloc(struct inode *, umode_t);
 extern int jfs_fsync(struct file *, struct dentry *, int);
 extern int jfs_ioctl(struct inode *, struct file *,
@@ -32,7 +34,10 @@ extern void jfs_truncate_nolock(struct i
 extern void jfs_free_zero_link(struct inode *);
 extern struct dentry *jfs_get_parent(struct dentry *dentry);
 extern void jfs_get_inode_flags(struct jfs_inode_info *);
-extern struct dentry *jfs_get_dentry(struct super_block *sb, void *vobjp);
+extern struct dentry *jfs_fh_to_dentry(struct super_block *sb, struct fid *fid,
+	int fh_len, int fh_type);
+extern struct dentry *jfs_fh_to_parent(struct super_block *sb, struct fid *fid,
+	int fh_len, int fh_type);
 extern void jfs_set_inode_flags(struct inode *);
 extern int jfs_get_block(struct inode *, sector_t, struct buffer_head *, int);
 
Index: linux-2.6/fs/jfs/namei.c
===================================================================
--- linux-2.6.orig/fs/jfs/namei.c	2007-07-19 15:56:46.000000000 +0200
+++ linux-2.6/fs/jfs/namei.c	2007-07-20 19:52:04.000000000 +0200
@@ -20,6 +20,7 @@
 #include <linux/fs.h>
 #include <linux/ctype.h>
 #include <linux/quotaops.h>
+#include <linux/exportfs.h>
 #include "jfs_incore.h"
 #include "jfs_superblock.h"
 #include "jfs_inode.h"
@@ -1477,13 +1478,10 @@ static struct dentry *jfs_lookup(struct 
 	return dentry;
 }
 
-struct dentry *jfs_get_dentry(struct super_block *sb, void *vobjp)
+static struct inode *jfs_nfs_get_inode(struct super_block *sb,
+		u64 ino, u32 generation)
 {
-	__u32 *objp = vobjp;
-	unsigned long ino = objp[0];
-	__u32 generation = objp[1];
 	struct inode *inode;
-	struct dentry *result;
 
 	if (ino == 0)
 		return ERR_PTR(-ESTALE);
@@ -1493,20 +1491,23 @@ struct dentry *jfs_get_dentry(struct sup
 
 	if (is_bad_inode(inode) ||
 	    (generation && inode->i_generation != generation)) {
-	    	result = ERR_PTR(-ESTALE);
-		goto out_iput;
+		iput(inode);
+	    	return ERR_PTR(-ESTALE);
 	}
 
-	result = d_alloc_anon(inode);
-	if (!result) {
-		result = ERR_PTR(-ENOMEM);
-		goto out_iput;
-	}
-	return result;
+	return inode;
+}
 
- out_iput:
-	iput(inode);
-	return result;
+struct dentry *jfs_fh_to_dentry(struct super_block *sb, struct fid *fid,
+		int fh_len, int fh_type)
+{
+	return generic_fh_to_dentry(sb, fid, fh_len, fh_type, jfs_nfs_get_inode);
+}
+
+struct dentry *jfs_fh_to_parent(struct super_block *sb, struct fid *fid,
+		int fh_len, int fh_type)
+{
+	return generic_fh_to_parent(sb, fid, fh_len, fh_type, jfs_nfs_get_inode);
 }
 
 struct dentry *jfs_get_parent(struct dentry *dentry)
Index: linux-2.6/fs/jfs/super.c
===================================================================
--- linux-2.6.orig/fs/jfs/super.c	2007-07-20 17:20:01.000000000 +0200
+++ linux-2.6/fs/jfs/super.c	2007-07-20 19:52:04.000000000 +0200
@@ -738,7 +738,8 @@ static const struct super_operations jfs
 };
 
 static struct export_operations jfs_export_operations = {
-	.get_dentry	= jfs_get_dentry,
+	.fh_to_dentry	= jfs_fh_to_dentry,
+	.fh_to_parent	= jfs_fh_to_parent,
 	.get_parent	= jfs_get_parent,
 };
 

--

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

* Re: [NFS] [PATH 08/19] jfs: new export ops
  2007-08-30 13:16 [PATH 08/19] jfs: new export ops Christoph Hellwig
@ 2007-09-10 19:45 ` J. Bruce Fields
  2007-09-13 13:59   ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: J. Bruce Fields @ 2007-09-10 19:45 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: nfs, linux-fsdevel, Neil Brown

On Thu, Aug 30, 2007 at 03:16:32PM +0200, Christoph Hellwig wrote:
> Trivial switch over to the new generic helpers.
> -	    	result = ERR_PTR(-ESTALE);
> -		goto out_iput;
> +		iput(inode);
> +	    	return ERR_PTR(-ESTALE);

For some reason you're introducing a bunch of whitespace damage on lines
like that last one.  Would you mind running these through checkpatch.pl
or whatever and then resending?

Other than that I can't find any problem, and it seems like an obvious
improvement, though I'd like to see Neil take a look.  Do you want these
added to the nfsd patches for 2.6.24?

--b.

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

* Re: [PATH 08/19] jfs: new export ops
  2007-09-10 19:45 ` [NFS] " J. Bruce Fields
@ 2007-09-13 13:59   ` Christoph Hellwig
  2007-09-13 20:57     ` [NFS] " J. Bruce Fields
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2007-09-13 13:59 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: linux-fsdevel, Neil Brown, nfs, Christoph Hellwig

On Mon, Sep 10, 2007 at 03:45:33PM -0400, J. Bruce Fields wrote:
> On Thu, Aug 30, 2007 at 03:16:32PM +0200, Christoph Hellwig wrote:
> > Trivial switch over to the new generic helpers.
> > -	    	result = ERR_PTR(-ESTALE);
> > -		goto out_iput;
> > +		iput(inode);
> > +	    	return ERR_PTR(-ESTALE);
> 
> For some reason you're introducing a bunch of whitespace damage on lines
> like that last one.  Would you mind running these through checkpatch.pl
> or whatever and then resending?
> 
> Other than that I can't find any problem, and it seems like an obvious
> improvement, though I'd like to see Neil take a look.  Do you want these
> added to the nfsd patches for 2.6.24?

Yes, please add them to the queue.  I've put a quilt series of patches
with the whitespace fixe on http://verein.lst.de/~hch/patches.nfsd.tgz.
Do you want to take it that way or should I resend everything to the
list?

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

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

* Re: [NFS] [PATH 08/19] jfs: new export ops
  2007-09-13 13:59   ` Christoph Hellwig
@ 2007-09-13 20:57     ` J. Bruce Fields
  2007-09-13 21:01       ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: J. Bruce Fields @ 2007-09-13 20:57 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: nfs, linux-fsdevel, Neil Brown

On Thu, Sep 13, 2007 at 03:59:34PM +0200, Christoph Hellwig wrote:
> Yes, please add them to the queue.  I've put a quilt series of patches
> with the whitespace fixe on http://verein.lst.de/~hch/patches.nfsd.tgz.
> Do you want to take it that way or should I resend everything to the
> list?

Yeah, I hate to be so picky, but would it be possible to get them as
mail?  It just saves me some scripting.  (I tried git-quiltimport and it
doesn't get the silly subject lines right.)  They don't even have to be
mailed out, an mbox I can wget would be fine.

--b.

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

* Re: [NFS] [PATH 08/19] jfs: new export ops
  2007-09-13 20:57     ` [NFS] " J. Bruce Fields
@ 2007-09-13 21:01       ` Christoph Hellwig
  0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2007-09-13 21:01 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Christoph Hellwig, nfs, linux-fsdevel, Neil Brown

On Thu, Sep 13, 2007 at 04:57:01PM -0400, J. Bruce Fields wrote:
> On Thu, Sep 13, 2007 at 03:59:34PM +0200, Christoph Hellwig wrote:
> > Yes, please add them to the queue.  I've put a quilt series of patches
> > with the whitespace fixe on http://verein.lst.de/~hch/patches.nfsd.tgz.
> > Do you want to take it that way or should I resend everything to the
> > list?
> 
> Yeah, I hate to be so picky, but would it be possible to get them as
> mail?  It just saves me some scripting.  (I tried git-quiltimport and it
> doesn't get the silly subject lines right.)  They don't even have to be
> mailed out, an mbox I can wget would be fine.

No problem, I'll do that tomorrow.

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

end of thread, other threads:[~2007-09-13 21:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-30 13:16 [PATH 08/19] jfs: new export ops Christoph Hellwig
2007-09-10 19:45 ` [NFS] " J. Bruce Fields
2007-09-13 13:59   ` Christoph Hellwig
2007-09-13 20:57     ` [NFS] " J. Bruce Fields
2007-09-13 21:01       ` Christoph Hellwig

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).