Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346622
b: refs/heads/master
c: b0ef964
h: refs/heads/master
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Dec 11, 2012
1 parent 4884134 commit dd5f456
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 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: 85563073741bd7935a6900d567ddaf907192270d
refs/heads/master: b0ef9647a0cd6cfd63fed48fbbe6005e4ba92571
22 changes: 16 additions & 6 deletions trunk/fs/nfs/nfs4session.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,20 +273,28 @@ void nfs41_wake_slot_table(struct nfs4_slot_table *tbl)
}
}

static void nfs41_set_max_slotid_locked(struct nfs4_slot_table *tbl,
u32 target_highest_slotid)
{
u32 max_slotid;

max_slotid = min(NFS4_MAX_SLOT_TABLE - 1, target_highest_slotid);
if (max_slotid > tbl->server_highest_slotid)
max_slotid = tbl->server_highest_slotid;
if (max_slotid > tbl->target_highest_slotid)
max_slotid = tbl->target_highest_slotid;
tbl->max_slotid = max_slotid;
nfs41_wake_slot_table(tbl);
}

/* Update the client's idea of target_highest_slotid */
static void nfs41_set_target_slotid_locked(struct nfs4_slot_table *tbl,
u32 target_highest_slotid)
{
unsigned int max_slotid;

if (tbl->target_highest_slotid == target_highest_slotid)
return;
tbl->target_highest_slotid = target_highest_slotid;
tbl->generation++;

max_slotid = min(NFS4_MAX_SLOT_TABLE - 1, tbl->target_highest_slotid);
tbl->max_slotid = max_slotid;
nfs41_wake_slot_table(tbl);
}

void nfs41_set_target_slotid(struct nfs4_slot_table *tbl,
Expand All @@ -296,6 +304,7 @@ void nfs41_set_target_slotid(struct nfs4_slot_table *tbl,
nfs41_set_target_slotid_locked(tbl, target_highest_slotid);
tbl->d_target_highest_slotid = 0;
tbl->d2_target_highest_slotid = 0;
nfs41_set_max_slotid_locked(tbl, target_highest_slotid);
spin_unlock(&tbl->slot_tbl_lock);
}

Expand Down Expand Up @@ -370,6 +379,7 @@ void nfs41_update_target_slotid(struct nfs4_slot_table *tbl,
nfs41_set_target_slotid_locked(tbl, res->sr_target_highest_slotid);
if (tbl->generation == slot->generation)
nfs41_set_server_slotid_locked(tbl, res->sr_highest_slotid);
nfs41_set_max_slotid_locked(tbl, res->sr_target_highest_slotid);
spin_unlock(&tbl->slot_tbl_lock);
}

Expand Down

0 comments on commit dd5f456

Please sign in to comment.