aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorAndy Adamson <andros@netapp.com>2009-04-01 09:21:53 -0400
committerBenny Halevy <bhalevy@panasas.com>2009-06-17 13:46:19 -0400
commit557134a39c8d2ab79d8b8d53438e03e29feb5ec4 (patch)
tree3f6999d9601618102413fd535ff95f9be0babd85 /fs/nfs/nfs4proc.c
parent9ff71c3a9827b99699510076dffa0bbe7c36bfd4 (diff)
nfs41: sessions client infrastructure
NFSv4.1 Sessions basic data types, initialization, and destruction. The session is always associated with a struct nfs_client that holds the exchange_id results. Signed-off-by: Rahul Iyer <iyer@netapp.com> Signed-off-by: Andy Adamson<andros@netapp.com> Signed-off-by: Benny Halevy <bhalevy@panasas.com> [remove extraneous rpc_clnt pointer, use the struct nfs_client cl_rpcclient. remove the rpc_clnt parameter from nfs4 nfs4_init_session] Signed-off-by: Andy Adamson<andros@netapp.com> Signed-off-by: Benny Halevy <bhalevy@panasas.com> [Use the presence of a session to determine behaviour instead of the minorversion number.] Signed-off-by: Andy Adamson <andros@netapp.com> [constified nfs4_has_session's struct nfs_client parameter] Signed-off-by: Benny Halevy <bhalevy@panasas.com> [Rename nfs4_put_session() to nfs4_destroy_session() and call it from nfs4_free_client() not nfs4_free_server(). Also get rid of nfs4_get_session() and the ref_count in nfs4_session struct as keeping track of nfs_client should be sufficient] Signed-off-by: Alexandros Batsakis <Alexandros.Batsakis@netapp.com> [nfs41: pass rsize and wsize into nfs4_init_session] Signed-off-by: Andy Adamson <andros@netapp.com> [separated out removal of rpc_clnt parameter from nfs4_init_session ot a patch of its own] Signed-off-by: Benny Halevy <bhalevy@panasas.com> [Pass the nfs_client pointer into nfs4_alloc_session] Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Benny Halevy <bhalevy@panasas.com> [nfs41: don't assign to session->clp->cl_session in nfs4_destroy_session] [nfs41: fixup nfs4_clear_client_minor_version] [introduce nfs4_clear_client_minor_version() in this patch] Signed-off-by: Benny Halevy <bhalevy@panasas.com> [Refactor nfs4_init_session] Moved session allocation into nfs4_init_client_minor_version, called from nfs4_init_client. Leave rwise and wsize initialization in nfs4_init_session, called from nfs4_init_server. Reverted moving of nfs_fsid definition to nfs_fs_sb.h Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Benny Halevy <bhalevy@panasas.com> [nfs41: Move NFS4_MAX_SLOT_TABLE define from under CONFIG_NFS_V4_1] [Fix comile error when CONFIG_NFS_V4_1 is not set.] Signed-off-by: Andy Adamson <andros@netapp.com> Signed-off-by: Benny Halevy <bhalevy@panasas.com> [moved nfs4_init_slot_table definition to "create_session operation"] Signed-off-by: Benny Halevy <bhalevy@panasas.com> [nfs41: alloc session with GFP_KERNEL] Signed-off-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 4674f8092da8..cdd8e74c47d0 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3723,6 +3723,40 @@ int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name,
3723 return status; 3723 return status;
3724} 3724}
3725 3725
3726#ifdef CONFIG_NFS_V4_1
3727/* Destroy the slot table */
3728static void nfs4_destroy_slot_table(struct nfs4_session *session)
3729{
3730 if (session->fc_slot_table.slots == NULL)
3731 return;
3732 kfree(session->fc_slot_table.slots);
3733 session->fc_slot_table.slots = NULL;
3734 return;
3735}
3736
3737struct nfs4_session *nfs4_alloc_session(struct nfs_client *clp)
3738{
3739 struct nfs4_session *session;
3740 struct nfs4_slot_table *tbl;
3741
3742 session = kzalloc(sizeof(struct nfs4_session), GFP_KERNEL);
3743 if (!session)
3744 return NULL;
3745 tbl = &session->fc_slot_table;
3746 spin_lock_init(&tbl->slot_tbl_lock);
3747 rpc_init_wait_queue(&tbl->slot_tbl_waitq, "Slot table");
3748 session->clp = clp;
3749 return session;
3750}
3751
3752void nfs4_destroy_session(struct nfs4_session *session)
3753{
3754 nfs4_destroy_slot_table(session);
3755 kfree(session);
3756}
3757
3758#endif /* CONFIG_NFS_V4_1 */
3759
3726struct nfs4_state_recovery_ops nfs4_reboot_recovery_ops = { 3760struct nfs4_state_recovery_ops nfs4_reboot_recovery_ops = {
3727 .owner_flag_bit = NFS_OWNER_RECLAIM_REBOOT, 3761 .owner_flag_bit = NFS_OWNER_RECLAIM_REBOOT,
3728 .state_flag_bit = NFS_STATE_RECLAIM_REBOOT, 3762 .state_flag_bit = NFS_STATE_RECLAIM_REBOOT,