From: Bryan Schumaker <bjschuma@netapp.com>
To: andros@netapp.com
Cc: trond.myklebust@netapp.com, linux-nfs@vger.kernel.org
Subject: Re: [PATCH Version 7 2/3] NFSv4.1 prepare for dynamic session slots
Date: Mon, 13 Feb 2012 08:49:31 -0500 [thread overview]
Message-ID: <4F3914EB.7090908@netapp.com> (raw)
In-Reply-To: <1329069176-8349-3-git-send-email-andros@netapp.com>
On 02/12/12 12:52, andros@netapp.com wrote:
> From: Andy Adamson <andros@netapp.com>
>
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> index 18b095a..11f4e96 100644
> --- a/fs/nfs/nfs4proc.c
> +++ b/fs/nfs/nfs4proc.c
> @@ -350,6 +350,127 @@ static void renew_lease(const struct nfs_server *server, unsigned long timestamp
> #if defined(CONFIG_NFS_V4_1)
>
> /*
> + * Slot table hlist functions
> + */
> +
> +static inline u32 slot_tbl_hash(u8 slotid)
> +{
> + return (u32)slotid % SLOT_HASH_TBL_SZ;
> +}
> +
> +/*
> + * Allocate the slot the requested slotid.
> + * Called outside of the slot_tbl_lock. If the slot is already allocated,
> + * return success.
> + */
> +static int
> +nfs4_alloc_insert_slot(struct nfs4_slot_table *tbl, int ivalue, int slotid,
> + gfp_t gfp_flags)
> +{
> + struct nfs4_slot *new;
> + u32 hash = slot_tbl_hash(slotid);
> +
> + dprintk("--> %s slotid=%u\n", __func__, slotid);
> +
> + new = kzalloc(sizeof(struct nfs4_slot), gfp_flags);
> + if (!new)
> + return -ENOMEM;
> + INIT_HLIST_NODE(&new->node);
> + new->slot_id = slotid;
> + new->seq_nr = ivalue;
> + spin_lock(&tbl->slot_tbl_lock);
> + hlist_add_head(&new->node, &tbl->slots[hash]);
> + tbl->max_slots++;
> + spin_unlock(&tbl->slot_tbl_lock);
> + return 0;
> +}
> +
> +/*
> + * Allocate the negotiated number of slots and place them in the hlist.
> + * Called at session initialization, or session reset (with session
> + * drained).
> + *
> + * @start - the slotid where allocation starts.
> + * @num - the number of slots to allocate.
> + *
> + */
> +static int nfs4_alloc_slots(struct nfs4_slot_table *tbl, int ivalue,
> + int start, int num, gfp_t gfp_flags)
> +{
> +int i, ret = 0;
Not a big deal, but I think a tab got lost here.
- Bryan
> +
> + for (i = start; i < start + num; i++) {
> + ret = nfs4_alloc_insert_slot(tbl, ivalue, i, gfp_flags);
> + if (ret)
> + break;
> + }
> + return ret;
> +}
next prev parent reply other threads:[~2012-02-13 13:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-12 17:52 [PATCH Version 7] NFSv4.1 Prepare for dynamic session slots andros
2012-02-12 17:52 ` [PATCH Version 7 1/3] NFS4.1 clean up nfs4_alloc_session andros
2012-02-12 17:52 ` [PATCH Version 7 2/3] NFSv4.1 prepare for dynamic session slots andros
2012-02-13 13:49 ` Bryan Schumaker [this message]
2012-02-12 17:52 ` [PATCH Version 7 3/3] NFSv4.1 avoid freeing slot when tasks are waiting andros
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=4F3914EB.7090908@netapp.com \
--to=bjschuma@netapp.com \
--cc=andros@netapp.com \
--cc=linux-nfs@vger.kernel.org \
--cc=trond.myklebust@netapp.com \
/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).