NFSv4.1: Move the RPC timestamp out of the slot.
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Sat, 15 Dec 2012 20:21:52 +0000 (15:21 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Sat, 15 Dec 2012 20:21:52 +0000 (15:21 -0500)
Shave a few bytes off the slot table size by moving the RPC timestamp
into the sequence results.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/nfs4proc.c
fs/nfs/nfs4session.c
fs/nfs/nfs4session.h
include/linux/nfs_xdr.h

index 9003b8f6b77fe25c3954323fda5feda6cdecc9f1..afb428e63b52a7090efe24c19d160e007051ba70 100644 (file)
@@ -419,7 +419,6 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *
 {
        struct nfs4_session *session;
        struct nfs4_slot *slot;
-       unsigned long timestamp;
        struct nfs_client *clp;
        int ret = 1;
 
@@ -444,9 +443,8 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *
        case 0:
                /* Update the slot's sequence and clientid lease timer */
                ++slot->seq_nr;
-               timestamp = slot->renewal_time;
                clp = session->clp;
-               do_renew_lease(clp, timestamp);
+               do_renew_lease(clp, res->sr_timestamp);
                /* Check sequence flags */
                if (res->sr_status_flags != 0)
                        nfs4_schedule_lease_recovery(clp);
@@ -473,10 +471,11 @@ static int nfs41_sequence_done(struct rpc_task *task, struct nfs4_sequence_res *
                 * Could this slot have been previously retired?
                 * If so, then the server may be expecting seq_nr = 1!
                 */
-               if (slot->seq_nr == 1)
-                       break;
-               slot->seq_nr = 1;
-               goto retry_nowait;
+               if (slot->seq_nr != 1) {
+                       slot->seq_nr = 1;
+                       goto retry_nowait;
+               }
+               break;
        case -NFS4ERR_SEQ_FALSE_RETRY:
                ++slot->seq_nr;
                goto retry_nowait;
@@ -567,6 +566,7 @@ int nfs41_setup_sequence(struct nfs4_session *session,
                        slot->slot_nr, slot->seq_nr);
 
        res->sr_slot = slot;
+       res->sr_timestamp = jiffies;
        res->sr_status_flags = 0;
        /*
         * sr_status is only set in decode_sequence, and so will remain
index 1e6c87c443a79ea911fa5516d6c8b6dee5595c9a..0e1cc1f4e51aa826aefb8f56e0fccdfeb0da86b3 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:
@@ -228,9 +227,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;
index 04f834cab16c4ca7d322e6735b2f1ac6c5800132..d17b08091d4b809daf4325a9b80263d932586956 100644 (file)
@@ -19,7 +19,6 @@ struct nfs4_slot {
        struct nfs4_slot_table  *table;
        struct nfs4_slot        *next;
        unsigned long           generation;
-       unsigned long           renewal_time;
        u32                     slot_nr;
        u32                     seq_nr;
 };
index a55abd499c2110ea8810f07be057020fb00e5bc4..29adb12c7ecffad9b58d6144d742489cb974de80 100644 (file)
@@ -194,6 +194,7 @@ struct nfs4_sequence_args {
 
 struct nfs4_sequence_res {
        struct nfs4_slot        *sr_slot;       /* slot used to send request */
+       unsigned long           sr_timestamp;
        int                     sr_status;      /* sequence operation status */
        u32                     sr_status_flags;
        u32                     sr_highest_slotid;