From mboxrd@z Thu Jan 1 00:00:00 1970 From: Phillip Lougher Subject: Re: [PATCH] Update the exportfs documentation and comments and fix some exportfs issues Date: Wed, 03 Dec 2008 08:27:48 +0000 Message-ID: <49364304.7000501@lougher.demon.co.uk> References: <20081202210233.19035.48005.stgit@warthog.procyon.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: hch@infradead.org, viro@ZenIV.linux.org.uk, linux-fsdevel@vger.kernel.org To: David Howells Return-path: Received: from anchor-post-2.mail.demon.net ([195.173.77.133]:39912 "EHLO anchor-post-2.mail.demon.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751236AbYLCI1p (ORCPT ); Wed, 3 Dec 2008 03:27:45 -0500 In-Reply-To: <20081202210233.19035.48005.stgit@warthog.procyon.org.uk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: David Howells wrote: > (*) FAT has had its fh type #defined (FAT_FILEID). > > (*) FUSE has had its fh types #defined (FUSE_FILEID, FUSE_FILEID_PARENT). > > (*) ISOFS has had its fh types #defined (ISOFS_FILEID, ISOFS_FILEID_PARENT). > > (*) OCFS2 has had its fh types #defined (OCFS2_FILEID, OCFS2_FILEID_PARENT). > You define these in the filesystem c files themselves as #defines. UDF and BTRFS place theirs in the enum fid_type definition itself (in linux/exportfs.h). Is there any reason why you didn't do this? > --- a/fs/exportfs/expfs.c > +++ b/fs/exportfs/expfs.c > -static int export_encode_fh(struct dentry *dentry, struct fid *fid, > - int *max_len, int connectable) > +static enum fid_type export_encode_fh(struct dentry *dentry, struct fid *fid, > + int *max_len, int connectable) > { > struct inode * inode = dentry->d_inode; > int len = *max_len; > int type = FILEID_INO32_GEN; ^^^^ this should be changed to enum fid_type > - > + > if (len < 2 || (connectable && len < 4)) > - return 255; > + return FILEID_ERROR; > > len = 2; > fid->i32.ino = inode->i_ino; > @@ -341,24 +341,71 @@ static int export_encode_fh(struct dentry *dentry, struct fid *fid, > return type; > } > > --- a/fs/fuse/inode.c > +++ b/fs/fuse/inode.c > @@ -610,8 +610,11 @@ static struct dentry *fuse_get_dentry(struct super_block *sb, > return ERR_PTR(err); > } > > -static int fuse_encode_fh(struct dentry *dentry, u32 *fh, int *max_len, > - int connectable) > +#define FUSE_FILEID ((enum fid_type) 0x81) > +#define FUSE_FILEID_PARENT ((enum fid_type) 0x82) Move to enum fid_type in linux/exportfs.h? > diff --git a/fs/isofs/export.c b/fs/isofs/export.c > index e81a305..b66c083 100644 > --- a/fs/isofs/export.c > +++ b/fs/isofs/export.c > @@ -106,7 +106,10 @@ static struct dentry *isofs_export_get_parent(struct dentry *child) > return rv; > } > > -static int > +#define ISOFS_FILEID ((enum fid_type) 1) > +#define ISOFS_FILEID_PARENT ((enum fid_type) 2) > + Move to enum fid_type in linux/exportfs.h? Type 1 and 2 are also used by the generic fid_types FILEID_INO32_GEN and FILEID_INO32_GEN_PARENT, but (obviously) their formats are different. Phillip