2009-04-21 22:48:49

by J. Bruce Fields

[permalink] [raw]
Subject: Re: [PATCH 1/11] nfsd: ADD data structure infrastructure

On Wed, Mar 25, 2009 at 07:06:28PM +0530, Krishna Kumar wrote:
> From: Krishna Kumar <[email protected]>
>
> ADD infrastructure in terms of new structures.
>
> Signed-off-by: Krishna Kumar <[email protected]>
> ---
>
> fs/nfsd/vfs.c | 35 +++++++++++++++++++++++++++++++++++
> 1 file changed, 35 insertions(+)
>
> diff -ruNp org/fs/nfsd/vfs.c new1/fs/nfsd/vfs.c
> --- org/fs/nfsd/vfs.c 2009-03-25 17:31:39.000000000 +0530
> +++ new1/fs/nfsd/vfs.c 2009-03-25 17:39:43.000000000 +0530
> @@ -88,6 +88,41 @@ struct raparm_hbucket {
> #define RAPARM_HASH_MASK (RAPARM_HASH_SIZE-1)
> static struct raparm_hbucket raparm_hash[RAPARM_HASH_SIZE];
>
> +/*
> + * This is a cache of file handles to quicken file lookup. This also
> + * helps prevent multiple open/close of a file when a client reads it.
> + *
> + * If you increase the number of cached files very much, you'll need to
> + * add a hash table here.

I'm a little confused here--what do you mean by "add a hash table here"?

--b.

> + */
> +struct fhcache {
> + struct fhcache *p_next;
> +
> + /* Hashed on this parameter */
> + __u32 p_auth;
> +
> + /* Cached information */
> + struct file *p_filp;
> + struct svc_export *p_exp;
> +
> + /* Refcount for overwrite */
> + atomic_t p_count;
> +
> + /* When this entry expires */
> + unsigned long p_expires;
> +
> + unsigned int p_hindex;
> +};
> +
> +struct fhcache_hbucket {
> + struct fhcache *pb_head;
> + spinlock_t pb_lock;
> +} ____cacheline_aligned_in_smp;
> +
> +#define FHPARM_HASH_BITS 8
> +#define FHPARM_HASH_SIZE (1<<FHPARM_HASH_BITS)
> +#define FHPARM_HASH_MASK (FHPARM_HASH_SIZE-1)
> +
> /*
> * Called from nfsd_lookup and encode_dirent. Check if we have crossed
> * a mount point.


2009-04-22 05:37:37

by Krishna Kumar2

[permalink] [raw]
Subject: Re: [PATCH 1/11] nfsd: ADD data structure infrastructure

"J. Bruce Fields" <[email protected]> wrote on 04/22/2009 04:18:38 AM:

> > +/*
> > + * This is a cache of file handles to quicken file lookup. This also
> > + * helps prevent multiple open/close of a file when a client reads it.
> > + *
> > + * If you increase the number of cached files very much, you'll need
to
> > + * add a hash table here.
>
> I'm a little confused here--what do you mean by "add a hash table here"?

That is also in the original code. I feel the comment is wrong as we
already have a hash table in raparm_hbucket, but I didn't want to change
typos as part of this patch.

thanks,

- KK


2009-04-22 19:43:18

by J. Bruce Fields

[permalink] [raw]
Subject: Re: [PATCH 1/11] nfsd: ADD data structure infrastructure

On Wed, Apr 22, 2009 at 11:06:33AM +0530, Krishna Kumar2 wrote:
> "J. Bruce Fields" <[email protected]> wrote on 04/22/2009 04:18:38 AM:
>
> > > +/*
> > > + * This is a cache of file handles to quicken file lookup. This also
> > > + * helps prevent multiple open/close of a file when a client reads it.
> > > + *
> > > + * If you increase the number of cached files very much, you'll need
> to
> > > + * add a hash table here.
> >
> > I'm a little confused here--what do you mean by "add a hash table here"?
>
> That is also in the original code. I feel the comment is wrong as we
> already have a hash table in raparm_hbucket, but I didn't want to change
> typos as part of this patch.

This patch doesn't change anything--it only adds new lines. If you're
trying to make minimal changes, that's admirable, but break up the
patches in such a way that each patch shows that minimal change.

--b.

>
> thanks,
>
> - KK
>