From: Benny Halevy <bhalevy@primarydata.com>
To: Christoph Hellwig <hch@infradead.org>, bfields@redhat.com
Cc: NFS list <linux-nfs@vger.kernel.org>
Subject: Re: nfs4_file usage
Date: Wed, 16 Oct 2013 11:45:28 +0300 [thread overview]
Message-ID: <525E5228.80200@primarydata.com> (raw)
In-Reply-To: <20131016064649.GB28758@infradead.org>
[adding linux-nfs to the Cc]
On 2013-10-16 09:46, Christoph Hellwig wrote:
> On Wed, Oct 16, 2013 at 09:04:12AM +0300, Benny Halevy wrote:
>> On 2013-10-16 00:14, Christoph Hellwig wrote:
>>> it seems like the pnfs tree uses struct nfs4_file for something entirely
>>> different than the current nfsd usage of it - in fact none of the actual
>>> fields except for the refcount, hashing and inode reference seems to be
>>> shared.
>>
>> The dlm patchset adds these members:
>> + struct list_head fi_lo_states;
>>
>> The fi_lo_states (coupled with nfs4_client.cl_lo_states) use case is equivalent
>> to fi_delegations.
>> But that said, it might make sense to move the respective layout state handling
>> to nfs4state.c.
>>
>> + struct nfs4_fsid fi_fsid;
>> fi_fsid is a shorthand for fh_export->ex_fsid and it would be expensive to look
>> it up on demand (return and recall by fsid)
>>
>> Other uses in the full pnfsd patchset add:
>> + struct mutex fi_lo_lock;
>> for inter-locking layout changing ops (layout get/commit/return) across
>> down calls to the file system.
>> I need to see if that can/should be moved to the layout state structure instead.
>>
>> + u32 fi_fhlen;
>> + u8 fi_fhval[NFS4_FHSIZE];
>>
>> Similar to fi_fsid, a shorthand for layout recall by file (common case).
>> I don't see a better place to put it.
>
> Maybe I wasn't clear enough in the first mail. pnfs still needs a
> structure the shadows struct inode with all the fields it adds. I just
> don't think overlyaing it over nfs4_file makes sense, but rather have
> something separate ala:
>
> struct pnfsd_inode {
> atomic_t pi_ref;
> struct hlist_node pi_hash;
> struct list_head pi_lo_states;
I'm reluctant about the layout stateids as it uses common hashing data structs
locking infrastructure, and code with all other nfsd4 stateids.
I hope that the pnfs layer can just carry a pointer to the nfs4_file
to passed to functions living in nfs4state.c that control the layout state.
> struct mutex pi_lo_lock;
> struct nfs4_fsid pi_fsid;
> u32 pi_fhlen;
> u8 pi_fhval[NFS4_FHSIZE];
> };
>
We can have a similar hash table for pnfsd_inode similar to nfs4_file
Note that nfs4_file is also per inode, not per file as might be reflected from its name.
Maybe moving it nfs4state.c also warrants renaming it to something more accurate.
And while there, change file_hashval to hash on i_ino rather than the inode ptr.
Benny
next prev parent reply other threads:[~2013-10-16 8:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20131015211445.GA23636@infradead.org>
[not found] ` <525DB943.3010707@primarydata.com>
[not found] ` <20131016064243.GA28758@infradead.org>
2013-10-16 8:21 ` state lock elimination Benny Halevy
2013-10-16 18:22 ` Christoph Hellwig
[not found] ` <525E2C5C.4020104@primarydata.com>
[not found] ` <20131016064649.GB28758@infradead.org>
2013-10-16 8:45 ` Benny Halevy [this message]
2013-10-16 8:51 ` nfs4_file usage Christoph Hellwig
2013-10-16 12:18 ` Benny Halevy
2013-10-16 12:33 ` Christoph Hellwig
2013-10-16 12:48 ` Benny Halevy
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=525E5228.80200@primarydata.com \
--to=bhalevy@primarydata.com \
--cc=bfields@redhat.com \
--cc=hch@infradead.org \
--cc=linux-nfs@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;
as well as URLs for NNTP newsgroup(s).