Linux: cache bypass: deal with the afs_serverHasNo64Bit case
authorMarc Dionne <marc.c.dionne@gmail.com>
Thu, 1 Jul 2010 20:07:40 +0000 (16:07 -0400)
committerDerrick Brashear <shadow@dementia.org>
Fri, 2 Jul 2010 16:14:13 +0000 (09:14 -0700)
Deal correctly with the case of a server with no 64-bit fetch
support.  In that case, the code needs to fallback to the standard
FetchData call, similar to what happens in afs_fetchstore.c.
Move existing check out of 64-bit-only branch so servers
already known to be non-64-bit and not merely those newly
discovered so execute the non-64-bit FetchData.

Change-Id: I505ce6d88072bc3ee5208863717395a78f8562fa
Reviewed-on: http://gerrit.openafs.org/2319
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/afs/afs_bypasscache.c

index baa79e1..1cd4bc9 100644 (file)
@@ -594,23 +594,23 @@ afs_PrefetchNoCache(register struct vcache *avc,
                        tcall = NULL;
                    }
                }
-               if (code == RXGEN_OPCODE || afs_serverHasNo64Bit(tc)) {
-                   if (auio->uio_offset > 0x7FFFFFFF) {
-                       code = EFBIG;
-                   } else {
-                       afs_int32 pos;
-                       pos = auio->uio_offset;
-                       COND_GUNLOCK(locked);
-                       if (!tcall)
-                           tcall = rx_NewCall(tc->id);
-                       code = StartRXAFS_FetchData(tcall,
-                                             (struct AFSFid *) &avc->f.fid.Fid,
-                                             pos, bparms->length);
-                       COND_RE_GLOCK(locked);
-                   }
-                   afs_serverSetNo64Bit(tc);
-               }
            } /* afs_serverHasNo64Bit */
+           if (code == RXGEN_OPCODE || afs_serverHasNo64Bit(tc)) {
+               if (auio->uio_offset > 0x7FFFFFFF) {
+                   code = EFBIG;
+               } else {
+                   afs_int32 pos;
+                   pos = auio->uio_offset;
+                   COND_GUNLOCK(locked);
+                   if (!tcall)
+                       tcall = rx_NewCall(tc->id);
+                   code = StartRXAFS_FetchData(tcall,
+                                       (struct AFSFid *) &avc->f.fid.Fid,
+                                       pos, bparms->length);
+                   COND_RE_GLOCK(locked);
+               }
+               afs_serverSetNo64Bit(tc);
+           }
 #else
            code = StartRXAFS_FetchData(tcall,
                                        (struct AFSFid *) &avc->f.fid.Fid,