diff options
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 34 |
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 */ | ||
3728 | static 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 | |||
3737 | struct 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 | |||
3752 | void 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 | |||
3726 | struct nfs4_state_recovery_ops nfs4_reboot_recovery_ops = { | 3760 | struct 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, |