]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/nfs/nfs4session.c
Merge branch 'acpi-lpss'
[karo-tx-linux.git] / fs / nfs / nfs4session.c
index ed5aa9fa9c7b5d9d76d034329944e370185e3664..ebda5f4a031b74d2c890d4c1e6cf932d869e8f2b 100644 (file)
@@ -143,7 +143,6 @@ struct nfs4_slot *nfs4_alloc_slot(struct nfs4_slot_table *tbl)
        if (slotid > tbl->highest_used_slotid ||
                        tbl->highest_used_slotid == NFS4_NO_SLOT)
                tbl->highest_used_slotid = slotid;
-       ret->renewal_time = jiffies;
        ret->generation = tbl->generation;
 
 out:
@@ -173,6 +172,7 @@ static void nfs4_reset_slot_table(struct nfs4_slot_table *tbl,
        p = &tbl->slots;
        while (*p) {
                (*p)->seq_nr = ivalue;
+               (*p)->interrupted = 0;
                p = &(*p)->next;
        }
        tbl->highest_used_slotid = NFS4_NO_SLOT;
@@ -228,9 +228,9 @@ static bool nfs41_assign_slot(struct rpc_task *task, void *pslot)
 
        if (nfs4_session_draining(tbl->session) && !args->sa_privileged)
                return false;
-       slot->renewal_time = jiffies;
        slot->generation = tbl->generation;
        args->sa_slot = slot;
+       res->sr_timestamp = jiffies;
        res->sr_slot = slot;
        res->sr_status_flags = 0;
        res->sr_status = 1;
@@ -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,
@@ -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);
 }
 
@@ -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);
 }