]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
nfsd4: exchange_id cleanup: comments
authorJ. Bruce Fields <bfields@redhat.com>
Mon, 14 May 2012 13:47:11 +0000 (09:47 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 1 Jun 2012 00:29:53 +0000 (20:29 -0400)
Make these comments a bit more concise and uniform.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c

index 3b6d61008673ee2086b4e5d3c5527a3b2b45add7..93fcf53daee105f68506b9f0df18a1bd3cdc6e25 100644 (file)
@@ -1550,6 +1550,7 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
 
        strhashval = clientstr_hashval(dname);
 
+       /* Cases below refer to rfc 5661 section 18.35.4: */
        nfs4_lock_state();
        conf = find_confirmed_client_by_str(dname, strhashval);
        if (conf) {
@@ -1557,26 +1558,24 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
                bool verfs_match = same_verf(&verf, &conf->cl_verifier);
 
                if (!clp_used_exchangeid(conf)) {
-                       if (update) {
-                               status = nfserr_inval; /* buggy client */
+                       if (update) { /* buggy client */
+                               status = nfserr_inval;
                                goto out;
                        }
                }
-               if (!creds_match) {
-                       /* 18.35.4 case 9 */
+               if (!creds_match) { /* case 9 */
                        if (update)
                                status = nfserr_perm;
                        else /* case 3 */
                                status = nfserr_clid_inuse;
                        goto out;
                }
-               if (!verfs_match) {
-                       /* 18.35.4 case 8 */
+               if (!verfs_match) { /* case 8 */
                        if (update) {
                                status = nfserr_not_same;
                                goto out;
                        }
-                       /* Client reboot: destroy old state */
+                       /* case 5, client reboot */
                        expire_client(conf);
                        goto out_new;
                }
@@ -1584,38 +1583,23 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
                        status = nfserr_inval;
                        goto out;
                }
-               /*
-                * Set bit when the owner id and verifier map to an already
-                * confirmed client id (18.35.3).
-                */
+               /* case 2 */
                exid->flags |= EXCHGID4_FLAG_CONFIRMED_R;
-
-               /*
-                * Falling into 18.35.4 case 2, possible router replay.
-                * Leave confirmed record intact and return same result.
-                */
                new = conf;
                goto out_copy;
        }
 
-       /* 18.35.4 case 7 */
-       if (update) {
+       if (update) { /* case 7 */
                status = nfserr_noent;
                goto out;
        }
 
        unconf  = find_unconfirmed_client_by_str(dname, strhashval);
-       if (unconf) {
-               /*
-                * Possible retry or client restart.  Per 18.35.4 case 4,
-                * a new unconfirmed record should be generated regardless
-                * of whether any properties have changed.
-                */
+       if (unconf) /* case 4, possible retry or client restart */
                expire_client(unconf);
-       }
 
+       /* case 1 (normal case) */
 out_new:
-       /* Normal case */
        new = create_client(exid->clname, dname, rqstp, &verf);
        if (new == NULL) {
                status = nfserr_jukebox;