Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 186142
b: refs/heads/master
c: 104aeba
h: refs/heads/master
v: v3
  • Loading branch information
Andy Adamson authored and Trond Myklebust committed Feb 10, 2010
1 parent ff0d980 commit 918d346
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 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: b9efa1b27e25b1286504973c0a6bf0f24106faa8
refs/heads/master: 104aeba484c9291cde2def6d037b836af46d8eb0
40 changes: 21 additions & 19 deletions trunk/fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4618,26 +4618,32 @@ int nfs4_proc_get_lease_time(struct nfs_client *clp, struct nfs_fsinfo *fsinfo)
/*
* Reset a slot table
*/
static int nfs4_reset_slot_table(struct nfs4_slot_table *tbl, int max_slots,
int old_max_slots, int ivalue)
static int nfs4_reset_slot_table(struct nfs4_slot_table *tbl, u32 max_reqs,
int ivalue)
{
struct nfs4_slot *new = NULL;
int i;
int ret = 0;

dprintk("--> %s: max_reqs=%u, tbl %p\n", __func__, max_slots, tbl);
dprintk("--> %s: max_reqs=%u, tbl->max_slots %d\n", __func__,
max_reqs, tbl->max_slots);

/*
* Until we have dynamic slot table adjustment, insist
* upon the same slot table size
*/
if (max_slots != old_max_slots) {
dprintk("%s reset slot table does't match old\n",
__func__);
ret = -EINVAL; /*XXX NFS4ERR_REQ_TOO_BIG ? */
goto out;
/* Does the newly negotiated max_reqs match the existing slot table? */
if (max_reqs != tbl->max_slots) {
ret = -ENOMEM;
new = kmalloc(max_reqs * sizeof(struct nfs4_slot),
GFP_KERNEL);
if (!new)
goto out;
ret = 0;
kfree(tbl->slots);
}
spin_lock(&tbl->slot_tbl_lock);
for (i = 0; i < max_slots; ++i)
if (new) {
tbl->slots = new;
tbl->max_slots = max_reqs;
}
for (i = 0; i < tbl->max_slots; ++i)
tbl->slots[i].seq_nr = ivalue;
spin_unlock(&tbl->slot_tbl_lock);
dprintk("%s: tbl=%p slots=%p max_slots=%d\n", __func__,
Expand All @@ -4655,16 +4661,12 @@ static int nfs4_reset_slot_tables(struct nfs4_session *session)
int status;

status = nfs4_reset_slot_table(&session->fc_slot_table,
session->fc_attrs.max_reqs,
session->fc_slot_table.max_slots,
1);
session->fc_attrs.max_reqs, 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);
session->bc_attrs.max_reqs, 0);
return status;
}

Expand Down

0 comments on commit 918d346

Please sign in to comment.