Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 153613
b: refs/heads/master
c: 050047c
h: refs/heads/master
i:
  153611: 799eb5b
v: v3
  • Loading branch information
Ricardo Labiaga authored and Benny Halevy committed Jun 17, 2009
1 parent f2fe772 commit 78d1d8f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 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: b73dafa7ac94ca8387f65c57cb63a7ffac91bf2c
refs/heads/master: 050047ce71bcf60867d2af7a9dc965a9c6f15cb8
26 changes: 19 additions & 7 deletions trunk/fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4420,23 +4420,22 @@ static int nfs4_reset_slot_tables(struct nfs4_session *session)
/*
* Initialize slot table
*/
static int nfs4_init_slot_table(struct nfs4_session *session)
static int nfs4_init_slot_table(struct nfs4_slot_table *tbl,
int max_slots, int ivalue)
{
struct nfs4_slot_table *tbl = &session->fc_slot_table;
int i, max_slots = session->fc_attrs.max_reqs;
int i;
struct nfs4_slot *slot;
int ret = -ENOMEM;

BUG_ON(max_slots > NFS4_MAX_SLOT_TABLE);

dprintk("--> %s: max_reqs=%u\n", __func__,
session->fc_attrs.max_reqs);
dprintk("--> %s: max_reqs=%u\n", __func__, max_slots);

slot = kcalloc(max_slots, sizeof(struct nfs4_slot), GFP_KERNEL);
if (!slot)
goto out;
for (i = 0; i < max_slots; ++i)
slot[i].seq_nr = 1;
slot[i].seq_nr = ivalue;
ret = 0;

spin_lock(&tbl->slot_tbl_lock);
Expand All @@ -4456,11 +4455,24 @@ static int nfs4_init_slot_table(struct nfs4_session *session)
out:
dprintk("<-- %s: return %d\n", __func__, ret);
return ret;

out_free:
kfree(slot);
goto out;
}

/*
* Initialize the forechannel and backchannel tables
*/
static int nfs4_init_slot_tables(struct nfs4_session *session)
{
int status;

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

/* Destroy the slot table */
static void nfs4_destroy_slot_table(struct nfs4_session *session)
{
Expand Down Expand Up @@ -4657,7 +4669,7 @@ int nfs4_proc_create_session(struct nfs_client *clp, int reset)
if (reset)
status = nfs4_reset_slot_tables(session);
else
status = nfs4_init_slot_table(session);
status = nfs4_init_slot_tables(session);
dprintk("fore channel slot table initialization returned %d\n", status);
if (status)
goto out;
Expand Down

0 comments on commit 78d1d8f

Please sign in to comment.