aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/nfsd/state.h27
-rw-r--r--include/linux/nfsd/xdr4.h5
2 files changed, 12 insertions, 20 deletions
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
index ff0b771efde6..70ef5f4abbbc 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -94,30 +94,23 @@ struct nfs4_cb_conn {
94 94
95/* Maximum number of slots per session. 160 is useful for long haul TCP */ 95/* Maximum number of slots per session. 160 is useful for long haul TCP */
96#define NFSD_MAX_SLOTS_PER_SESSION 160 96#define NFSD_MAX_SLOTS_PER_SESSION 160
97/* Maximum number of pages per slot cache entry */
98#define NFSD_PAGES_PER_SLOT 1
99#define NFSD_SLOT_CACHE_SIZE PAGE_SIZE
100/* Maximum number of operations per session compound */ 97/* Maximum number of operations per session compound */
101#define NFSD_MAX_OPS_PER_COMPOUND 16 98#define NFSD_MAX_OPS_PER_COMPOUND 16
99/* Maximum session per slot cache size */
100#define NFSD_SLOT_CACHE_SIZE 1024
102/* Maximum number of NFSD_SLOT_CACHE_SIZE slots per session */ 101/* Maximum number of NFSD_SLOT_CACHE_SIZE slots per session */
103#define NFSD_CACHE_SIZE_SLOTS_PER_SESSION 32 102#define NFSD_CACHE_SIZE_SLOTS_PER_SESSION 32
104#define NFSD_MAX_MEM_PER_SESSION \ 103#define NFSD_MAX_MEM_PER_SESSION \
105 (NFSD_CACHE_SIZE_SLOTS_PER_SESSION * NFSD_SLOT_CACHE_SIZE) 104 (NFSD_CACHE_SIZE_SLOTS_PER_SESSION * NFSD_SLOT_CACHE_SIZE)
106 105
107struct nfsd4_cache_entry {
108 __be32 ce_status;
109 struct kvec ce_datav; /* encoded NFSv4.1 data in rq_res.head[0] */
110 struct page *ce_respages[NFSD_PAGES_PER_SLOT + 1];
111 int ce_cachethis;
112 short ce_resused;
113 int ce_opcnt;
114 int ce_rpchdrlen;
115};
116
117struct nfsd4_slot { 106struct nfsd4_slot {
118 bool sl_inuse; 107 bool sl_inuse;
119 u32 sl_seqid; 108 bool sl_cachethis;
120 struct nfsd4_cache_entry sl_cache_entry; 109 u16 sl_opcnt;
110 u32 sl_seqid;
111 __be32 sl_status;
112 u32 sl_datalen;
113 char sl_data[];
121}; 114};
122 115
123struct nfsd4_channel_attrs { 116struct nfsd4_channel_attrs {
@@ -159,7 +152,7 @@ struct nfsd4_session {
159 struct nfs4_sessionid se_sessionid; 152 struct nfs4_sessionid se_sessionid;
160 struct nfsd4_channel_attrs se_fchannel; 153 struct nfsd4_channel_attrs se_fchannel;
161 struct nfsd4_channel_attrs se_bchannel; 154 struct nfsd4_channel_attrs se_bchannel;
162 struct nfsd4_slot se_slots[]; /* forward channel slots */ 155 struct nfsd4_slot *se_slots[]; /* forward channel slots */
163}; 156};
164 157
165static inline void 158static inline void
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index 3f716607c86d..73164c2b3d29 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -51,7 +51,7 @@ struct nfsd4_compound_state {
51 /* For sessions DRC */ 51 /* For sessions DRC */
52 struct nfsd4_session *session; 52 struct nfsd4_session *session;
53 struct nfsd4_slot *slot; 53 struct nfsd4_slot *slot;
54 __be32 *statp; 54 __be32 *datap;
55 size_t iovlen; 55 size_t iovlen;
56 u32 minorversion; 56 u32 minorversion;
57 u32 status; 57 u32 status;
@@ -472,8 +472,7 @@ static inline bool nfsd4_is_solo_sequence(struct nfsd4_compoundres *resp)
472 472
473static inline bool nfsd4_not_cached(struct nfsd4_compoundres *resp) 473static inline bool nfsd4_not_cached(struct nfsd4_compoundres *resp)
474{ 474{
475 return !resp->cstate.slot->sl_cache_entry.ce_cachethis || 475 return !resp->cstate.slot->sl_cachethis || nfsd4_is_solo_sequence(resp);
476 nfsd4_is_solo_sequence(resp);
477} 476}
478 477
479#define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs) 478#define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs)