Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 153614
b: refs/heads/master
c: f8625a6
h: refs/heads/master
v: v3
  • Loading branch information
Ricardo Labiaga authored and Benny Halevy committed Jun 17, 2009
1 parent 78d1d8f commit 96d90b2
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 050047ce71bcf60867d2af7a9dc965a9c6f15cb8
refs/heads/master: f8625a6a4bb76207302be58453603d8e324df490
48 changes: 36 additions & 12 deletions trunk/fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4414,9 +4414,30 @@ static int nfs4_reset_slot_tables(struct nfs4_session *session)
session->fc_attrs.max_reqs,
session->fc_slot_table.max_slots,
1);
if (status)
return status;

status = nfs4_reset_slot_table(&session->bc_slot_table,
session->bc_attrs.max_reqs,
session->bc_slot_table.max_slots,
0);
return status;
}

/* Destroy the slot table */
static void nfs4_destroy_slot_tables(struct nfs4_session *session)
{
if (session->fc_slot_table.slots != NULL) {
kfree(session->fc_slot_table.slots);
session->fc_slot_table.slots = NULL;
}
if (session->bc_slot_table.slots != NULL) {
kfree(session->bc_slot_table.slots);
session->bc_slot_table.slots = NULL;
}
return;
}

/*
* Initialize slot table
*/
Expand Down Expand Up @@ -4470,17 +4491,15 @@ static int nfs4_init_slot_tables(struct nfs4_session *session)

status = nfs4_init_slot_table(&session->fc_slot_table,
session->fc_attrs.max_reqs, 1);
return status;
}
if (status)
return status;

/* Destroy the slot table */
static void nfs4_destroy_slot_table(struct nfs4_session *session)
{
if (session->fc_slot_table.slots == NULL)
return;
kfree(session->fc_slot_table.slots);
session->fc_slot_table.slots = NULL;
return;
status = nfs4_init_slot_table(&session->bc_slot_table,
session->bc_attrs.max_reqs, 0);
if (status)
nfs4_destroy_slot_tables(session);

return status;
}

struct nfs4_session *nfs4_alloc_session(struct nfs_client *clp)
Expand All @@ -4503,7 +4522,12 @@ struct nfs4_session *nfs4_alloc_session(struct nfs_client *clp)

tbl = &session->fc_slot_table;
spin_lock_init(&tbl->slot_tbl_lock);
rpc_init_wait_queue(&tbl->slot_tbl_waitq, "Slot table");
rpc_init_wait_queue(&tbl->slot_tbl_waitq, "ForeChannel Slot table");

tbl = &session->bc_slot_table;
spin_lock_init(&tbl->slot_tbl_lock);
rpc_init_wait_queue(&tbl->slot_tbl_waitq, "BackChannel Slot table");

session->clp = clp;
return session;
}
Expand All @@ -4515,7 +4539,7 @@ void nfs4_destroy_session(struct nfs4_session *session)
__func__, session->clp->cl_rpcclient->cl_xprt);
xprt_destroy_backchannel(session->clp->cl_rpcclient->cl_xprt,
NFS41_BC_MIN_CALLBACKS);
nfs4_destroy_slot_table(session);
nfs4_destroy_slot_tables(session);
kfree(session);
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/nfs_fs_sb.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ struct nfs4_session {
struct nfs4_channel_attrs fc_attrs;
struct nfs4_slot_table fc_slot_table;
struct nfs4_channel_attrs bc_attrs;
/* back channel has one slot */
struct nfs4_slot_table bc_slot_table;
struct nfs_client *clp;
};

Expand Down

0 comments on commit 96d90b2

Please sign in to comment.