Linux NFS development
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Krishna Kumar2 <krkumar2@in.ibm.com>
Cc: jlayton@redhat.com, Krishna Kumar <krikku@gmail.com>,
	linux-nfs@vger.kernel.org,
	Greg Banks <gnb-xTcybq6BZ68@public.gmane.org>
Subject: Re: [PATCH 3/11] nfsd: CHANGE old function calls to new calls
Date: Fri, 24 Apr 2009 12:23:21 -0400	[thread overview]
Message-ID: <20090424162321.GB17365@fieldses.org> (raw)
In-Reply-To: <OFC1241E6B.C4476A61-ON652575A2.00207885-652575A2.00598912@in.ibm.com>

On Fri, Apr 24, 2009 at 09:47:57PM +0530, Krishna Kumar2 wrote:
> Hi Bruce,
> 
> "J. Bruce Fields" <bfields@fieldses.org> wrote on 04/24/2009 04:09:09 AM:
> 
> > > Keying on the entire filehandle seems reasonable, but I don't think it
> is
> > > required as auth[3] seems to be allocated memory which is unique in a
> > > system,
> >
> > You lost me.  Where do you see auth[3] getting encoded, and what do you
> > mean by saying it's "allocated memory which is unique in a system"?
> >
> > There are a lot of different filehandle encoding options.  I lose track
> > of them myself....
> 
> Sorry, I am wrong, I was thinking of &auth[3] and wrote too fast. I am
> testing
> using your suggestion hashing on the full filehandle, something like:
> 
> {
>       __u32 a = auth[0], b = auth[1], c = auth[2], d = auth[3];
>       hash = jhash_3words(a, b, jhash_2words(c, d, 0), 0xfeedbeef) &
>                                     FHPARM_HASH_MASK;
>       ...
>       /*
>        * Matching check uses something like:
>        * if (fh->p_auth1 == a && fh->p_auth2 == b && fh->p_auth3 == c &&
> fh->p_auth4 == d)
>        */
> }
> 
> Is what you had in mind? I am testing some more with this, so far I get
> different values for different files and filesystems.
> 
> I am not sure if there is an easier way to do a hash and get the unique
> file
> associated with the filehandle, this part of the code is very complicated.

Why not just do a hash on the entire filehandle, however long it may be?

(Cc'ing Greg since he says he had some patches which did something
similar, and perhaps he could offer a suggestion.)

--b.

  reply	other threads:[~2009-04-24 16:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090325133607.16437.33288.sendpatchset@localhost.localdomain>
     [not found] ` <20090325133628.16437.11092.sendpatchset@localhost.localdomain>
     [not found]   ` <20090325133628.16437.11092.sendpatchset-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-04-21 22:48     ` [PATCH 1/11] nfsd: ADD data structure infrastructure J. Bruce Fields
2009-04-22  5:36       ` Krishna Kumar2
2009-04-22 19:43         ` J. Bruce Fields
2009-04-21 23:05     ` J. Bruce Fields
     [not found] ` <20090325133607.16437.33288.sendpatchset-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-04-17 18:46   ` [PATCH 0/11] nfsd: Summary of "Improve NFS server performance" J. Bruce Fields
2009-04-17 19:30     ` Krishna Kumar2
2009-04-21 22:57   ` J. Bruce Fields
2009-04-22  5:35     ` Krishna Kumar2
2009-04-22 19:41       ` J. Bruce Fields
     [not found] ` <20090325133647.16437.59567.sendpatchset@localhost.localdomain>
     [not found]   ` <20090325133647.16437.59567.sendpatchset-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-04-22  2:54     ` [PATCH 2/11] nfsd: ADD new function infrastructure J. Bruce Fields
2009-04-22  5:37       ` Krishna Kumar2
     [not found] ` <20090325133707.16437.66360.sendpatchset@localhost.localdomain>
     [not found]   ` <20090325133707.16437.66360.sendpatchset-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2009-04-22 20:05     ` [PATCH 3/11] nfsd: CHANGE old function calls to new calls J. Bruce Fields
2009-04-23 15:55       ` Krishna Kumar2
2009-04-23 22:39         ` J. Bruce Fields
2009-04-24 16:17           ` Krishna Kumar2
2009-04-24 16:23             ` J. Bruce Fields [this message]
2009-04-24 16:58               ` Krishna Kumar2
2009-04-24 19:25                 ` J. Bruce Fields
2009-04-26 11:16                   ` Krishna Kumar2

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=20090424162321.GB17365@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=gnb-xTcybq6BZ68@public.gmane.org \
    --cc=jlayton@redhat.com \
    --cc=krikku@gmail.com \
    --cc=krkumar2@in.ibm.com \
    --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