All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: David Howells <dhowells@redhat.com>
Cc: hch@infradead.org, viro@ZenIV.linux.org.uk,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] Update the exportfs documentation and comments and fix some exportfs issues
Date: Wed, 3 Dec 2008 07:48:50 -0500	[thread overview]
Message-ID: <20081203124850.GA4075@infradead.org> (raw)
In-Reply-To: <20081202210233.19035.48005.stgit@warthog.procyon.org.uk>

On Tue, Dec 02, 2008 at 09:02:33PM +0000, David Howells wrote:
> Update the exportfs documentation and comments to fit the code, and add an
> extra FID type to be used for error indication (FILEID_ERROR).
> 
> The following other code changes have been made:
> 
>  (*) The encode_fh() op and exportfs_encode_fh() return enum fid_type rather
>      than int.

Once you change the prototype please also pass the struct fid * instead
of the current __u32 array, like the fh_to_dentry / fh_to_parent
methods.

>  (*) The exportfs_encode_fh() function has it's acceptable() function pointer
>      typedef'd.

I don't really see the point for that, but I don't care too much.

>  (*) The fh_to_dentry() and fh_to_parent() ops and exportfs_decode_fh() take
>      enum fid_type rather than int.

Ok.

>  (*) The generic_fh_to_dentry() and generic_fh_to_parent() functions now take
>      enum fid_type rather than int.  Their get_inode() function pointer has
>      been typedef'd.

Ok.  Again I don't really see the point of the typede, but hey..

>  (*) The generic_fh_to_dentry() and generic_fh_to_parent() functions no longer
>      return NULL, but return -ESTALE instead.  exportfs_decode_fh() does not
>      check for NULL, but will try to dereference it as IS_ERR() does not check
>      for it.

>  (*) The following filesystems have had their fh_to_dentry() and fh_to_parent()
>      implementations made to return -ESTALE rather than NULL: FUSE, GFS2,
>      ISOFS, OCFS2, UDF and XFS.

These two should probably be broken out into a smaller patch, before all
the cosmetic bits.

>  (*) Returns from encode_fh() implementations of 255 are changed to
>      FILEID_ERROR.

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

Ok.


> +A filehandle fragment consists of an array of 1 or more 32-bit words.  The
> +contents and the layout of the data in the array are entirely at the whim of
> +the filesystem that generated it.

Not really true anymore, as we have a real struct for it now.  But all
the length calculation is still done in number of 4 byte words.  Messy..

>  struct dentry *exportfs_decode_fh(struct vfsmount *mnt, struct fid *fid,
> -		int fh_len, int fileid_type,
> -		int (*acceptable)(void *, struct dentry *), void *context)
> +				  int fh_len, enum fid_type fileid_type,
> +				  exportfs_acceptable_t acceptable,
> +				  void *context)

Why the strange indentation?  Two tabs indent for spillover prototypes
is pretty much standard..

> +#define FAT_FILEID	((enum fid_type) 3)

That cast is completely pointless in C.

> +++ b/include/linux/exportfs.h
> @@ -1,3 +1,9 @@
> +/* Persistent file handle encoding and decoding interface

/*
 * Persistent file handle encoding and decoding interface


  parent reply	other threads:[~2008-12-03 12:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-02 21:02 [PATCH] Update the exportfs documentation and comments and fix some exportfs issues David Howells
2008-12-03  8:27 ` Phillip Lougher
2008-12-03 10:54   ` David Howells
2008-12-04  4:50     ` Phillip Lougher
2008-12-03 12:50   ` Christoph Hellwig
2008-12-03 12:48 ` Christoph Hellwig [this message]
2008-12-03 13:14   ` David Howells
2008-12-03 13:47     ` Jörn Engel
2008-12-03 17:21       ` David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081203124850.GA4075@infradead.org \
    --to=hch@infradead.org \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.