diff options
author | Trond Myklebust <trondmy@gmail.com> | 2018-10-03 13:11:51 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2018-10-29 16:58:04 -0400 |
commit | ed00c2f65267f3a5a8727ac74a90d32470f91679 (patch) | |
tree | 8a95e9d7ad98c0a8ddd4e7ffb19b7ab9c9bb32c3 /fs/nfsd/cache.h | |
parent | 76ecec21197ab23bb821d8bf584949013efd0494 (diff) | |
download | linux-ed00c2f65267f3a5a8727ac74a90d32470f91679.tar.bz2 |
knfsd: Further simplify the cache lookup
Order the structure so that the key can be compared using memcmp().
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/cache.h')
-rw-r--r-- | fs/nfsd/cache.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/fs/nfsd/cache.h b/fs/nfsd/cache.h index b7559c6f2b97..745c861237ca 100644 --- a/fs/nfsd/cache.h +++ b/fs/nfsd/cache.h @@ -19,18 +19,21 @@ * is much larger than a sockaddr_in6. */ struct svc_cacherep { - struct list_head c_lru; + struct { + /* Keep often-read xid, csum in the same cache line: */ + __be32 k_xid; + __wsum k_csum; + u32 k_proc; + u32 k_prot; + u32 k_vers; + unsigned int k_len; + struct sockaddr_in6 k_addr; + } c_key; + struct list_head c_lru; unsigned char c_state, /* unused, inprog, done */ c_type, /* status, buffer */ c_secure : 1; /* req came from port < 1024 */ - struct sockaddr_in6 c_addr; - __be32 c_xid; - u32 c_prot; - u32 c_proc; - u32 c_vers; - unsigned int c_len; - __wsum c_csum; unsigned long c_timestamp; union { struct kvec u_vec; |