aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/cache.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/cache.h')
-rw-r--r--fs/nfsd/cache.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/fs/nfsd/cache.h b/fs/nfsd/cache.h
index 93cc9d34c459..87fd1410b737 100644
--- a/fs/nfsd/cache.h
+++ b/fs/nfsd/cache.h
@@ -12,6 +12,10 @@
12 12
13/* 13/*
14 * Representation of a reply cache entry. 14 * Representation of a reply cache entry.
15 *
16 * Note that we use a sockaddr_in6 to hold the address instead of the more
17 * typical sockaddr_storage. This is for space reasons, since sockaddr_storage
18 * is much larger than a sockaddr_in6.
15 */ 19 */
16struct svc_cacherep { 20struct svc_cacherep {
17 struct hlist_node c_hash; 21 struct hlist_node c_hash;
@@ -20,11 +24,13 @@ struct svc_cacherep {
20 unsigned char c_state, /* unused, inprog, done */ 24 unsigned char c_state, /* unused, inprog, done */
21 c_type, /* status, buffer */ 25 c_type, /* status, buffer */
22 c_secure : 1; /* req came from port < 1024 */ 26 c_secure : 1; /* req came from port < 1024 */
23 struct sockaddr_in c_addr; 27 struct sockaddr_in6 c_addr;
24 __be32 c_xid; 28 __be32 c_xid;
25 u32 c_prot; 29 u32 c_prot;
26 u32 c_proc; 30 u32 c_proc;
27 u32 c_vers; 31 u32 c_vers;
32 unsigned int c_len;
33 __wsum c_csum;
28 unsigned long c_timestamp; 34 unsigned long c_timestamp;
29 union { 35 union {
30 struct kvec u_vec; 36 struct kvec u_vec;
@@ -46,8 +52,7 @@ enum {
46enum { 52enum {
47 RC_DROPIT, 53 RC_DROPIT,
48 RC_REPLY, 54 RC_REPLY,
49 RC_DOIT, 55 RC_DOIT
50 RC_INTR
51}; 56};
52 57
53/* 58/*
@@ -67,6 +72,12 @@ enum {
67 */ 72 */
68#define RC_DELAY (HZ/5) 73#define RC_DELAY (HZ/5)
69 74
75/* Cache entries expire after this time period */
76#define RC_EXPIRE (120 * HZ)
77
78/* Checksum this amount of the request */
79#define RC_CSUMLEN (256U)
80
70int nfsd_reply_cache_init(void); 81int nfsd_reply_cache_init(void);
71void nfsd_reply_cache_shutdown(void); 82void nfsd_reply_cache_shutdown(void);
72int nfsd_cache_lookup(struct svc_rqst *); 83int nfsd_cache_lookup(struct svc_rqst *);