From: Al Viro <viro@ZenIV.linux.org.uk>
To: David Howells <dhowells@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>, linux-fsdevel@vger.kernel.org
Subject: Re: Questions about exportfs
Date: Thu, 27 Nov 2008 23:20:28 +0000 [thread overview]
Message-ID: <20081127232028.GE28946@ZenIV.linux.org.uk> (raw)
In-Reply-To: <9428.1227797500@redhat.com>
On Thu, Nov 27, 2008 at 02:51:40PM +0000, David Howells wrote:
>
> Hi Christoph,
>
> Can you answer some questions about exportfs please?
>
> (1) In linux/exportfs.h, the description of the encode_fh() op says that
> "encode_fh() should return the number of bytes stored or a negative error
> code such as %-ENOSPC".
>
> This, however, contradicts export_encode_fh(), which returns a member of
> enum fid_type instead. I presume the docs are wrong, or at least,
> unclear.
No negative error codes, just 255 (or anything that would give 255 when
converted to u8, actually).
> (2) Why does exportfs_encode_fh() return the type of the FID? Why not embed
> it in the fid struct? It seems that the value has to be handed back to
> the decode routine.
Take a look at the struct nfs_fhbase_new in include/linux/nfsd/nfsfh.h;
we have type information for all components in the beginning, packed
together, instead of embedding each into its part of array.
> (3) Is fat_encode_fh() allowed to return a value not in the fid_type enum?
Yes. That enum is just a bunch of common encoding schemes. The values you
are using are entirely[*] up to specific filesystem; these ones are just for
common helper functions.
[*] other than "255 is reserved for encoding error"
prev parent reply other threads:[~2008-11-27 23:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-27 14:51 Questions about exportfs David Howells
2008-11-27 23:20 ` Al Viro [this message]
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=20081127232028.GE28946@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=dhowells@redhat.com \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox