[pnfs] [PATCH] [SQUASHME] nfs41: get rid of session ref_count
Labiaga, Ricardo
Ricardo.Labiaga at netapp.com
Mon Jul 14 12:40:30 EDT 2008
Hi Benny,
Please don't remove the session ref_count yet. As we mentioned during
the conf call, Andy and I have been discussing whether a session can be
shared between mounts. This is why the ref count was in there to begin
with. We're converging on our thoughts and will present a proposal to
the team soon.
Thanks,
- ricardo
> -----Original Message-----
> From: Benny Halevy [mailto:bhalevy at panasas.com]
> Sent: Sunday, July 13, 2008 4:51 AM
> To: Adamson, Andy
> Cc: pnfs at linux-nfs.org
> Subject: [pnfs] [PATCH] [SQUASHME] nfs41: get rid of session ref_count
>
> Signed-off-by: Benny Halevy <bhalevy at panasas.com>
> ---
> fs/nfs/nfs41_session_recovery.c | 3 +--
> fs/nfs/nfs4proc.c | 10 +++-------
> include/linux/nfs4_session.h | 1 -
> 3 files changed, 4 insertions(+), 10 deletions(-)
>
> diff --git a/fs/nfs/nfs41_session_recovery.c
> b/fs/nfs/nfs41_session_recovery.c
> index 09c5f43..4aa79cc 100644
> --- a/fs/nfs/nfs41_session_recovery.c
> +++ b/fs/nfs/nfs41_session_recovery.c
> @@ -96,8 +96,7 @@ static int session_reclaimer(void *arg)
> dprintk("%s Session Reset\n", __func__);
> /* Reset is called only when all slots are clear.
> *
> - * Bail on the reset if destroy session op fails or if
> - * the session ref_count is not 1
> + * Bail on the reset if destroy session op fails.
> *
> * Of course since we are resetting the session,
> * it's OK if the session is already destroyed
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> index 7e3661e..c9e0f22 100644
> --- a/fs/nfs/nfs4proc.c
> +++ b/fs/nfs/nfs4proc.c
> @@ -4620,8 +4620,6 @@ struct nfs4_session *nfs4_alloc_session(void)
>
> nfs41_set_session_alloc(session);
>
> - atomic_set(&session->ref_count, 1);
> -
> nfs4_init_channel(&session->fore_channel);
> return session;
> }
> @@ -4635,11 +4633,9 @@ static void nfs4_free_session(struct
> nfs4_session *session)
> void nfs4_put_session(struct nfs4_session **session)
> {
> dprintk("--> nfs4_put_session()\n");
> - if (atomic_dec_and_test(&((*session)->ref_count))) {
> - nfs4_destroy_slot_table(&((*session)->fore_channel));
> - nfs4_free_session(*session);
> - *session = NULL;
> - }
> + nfs4_destroy_slot_table(&((*session)->fore_channel));
> + nfs4_free_session(*session);
> + *session = NULL;
> dprintk("<-- nfs4_put_session()\n");
> }
>
> diff --git a/include/linux/nfs4_session.h
> b/include/linux/nfs4_session.h
> index 551eb61..6245ffc 100644
> --- a/include/linux/nfs4_session.h
> +++ b/include/linux/nfs4_session.h
> @@ -57,7 +57,6 @@ struct nfs4_session {
> struct nfs4_channel fore_channel;
> struct nfs4_channel back_channel;
>
> - atomic_t ref_count;
> struct rpc_clnt *clnt;
> struct nfs_client *clp;
> };
> --
> 1.5.6.2
>
> _______________________________________________
> pNFS mailing list
> pNFS at linux-nfs.org
> http://linux-nfs.org/cgi-bin/mailman/listinfo/pnfs
>
More information about the pNFS
mailing list