aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/nfsd
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-22 15:55:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-22 15:55:50 -0400
commit7e0338c0de18c50f09aea1fbef45110cf7d64a3c (patch)
tree30a935c1f6eee7125a9fbb802a33292b1f7268fa /include/linux/nfsd
parentdf36b439c5fedefe013d4449cb6a50d15e2f4d70 (diff)
parent47fcb03fefee2501e79176932a4184fc24d6f8ec (diff)
Merge branch 'for-2.6.31' of git://fieldses.org/git/linux-nfsd
* 'for-2.6.31' of git://fieldses.org/git/linux-nfsd: (60 commits) SUNRPC: Fix the TCP server's send buffer accounting nfsd41: Backchannel: minorversion support for the back channel nfsd41: Backchannel: cleanup nfs4.0 callback encode routines nfsd41: Remove ip address collision detection case nfsd: optimise the starting of zero threads when none are running. nfsd: don't take nfsd_mutex twice when setting number of threads. nfsd41: sanity check client drc maxreqs nfsd41: move channel attributes from nfsd4_session to a nfsd4_channel_attr struct NFS: kill off complicated macro 'PROC' sunrpc: potential memory leak in function rdma_read_xdr nfsd: minor nfsd_vfs_write cleanup nfsd: Pull write-gathering code out of nfsd_vfs_write nfsd: track last inode only in use_wgather case sunrpc: align cache_clean work's timer nfsd: Use write gathering only with NFSv2 NFSv4: kill off complicated macro 'PROC' NFSv4: do exact check about attribute specified knfsd: remove unreported filehandle stats counters knfsd: fix reply cache memory corruption knfsd: reply cache cleanups ...
Diffstat (limited to 'include/linux/nfsd')
-rw-r--r--include/linux/nfsd/cache.h3
-rw-r--r--include/linux/nfsd/nfsfh.h7
-rw-r--r--include/linux/nfsd/state.h44
-rw-r--r--include/linux/nfsd/xdr4.h28
4 files changed, 44 insertions, 38 deletions
diff --git a/include/linux/nfsd/cache.h b/include/linux/nfsd/cache.h
index 5bccaab81056..3a3f58934f5e 100644
--- a/include/linux/nfsd/cache.h
+++ b/include/linux/nfsd/cache.h
@@ -14,8 +14,7 @@
14#include <linux/uio.h> 14#include <linux/uio.h>
15 15
16/* 16/*
17 * Representation of a reply cache entry. The first two members *must* 17 * Representation of a reply cache entry.
18 * be hash_next and hash_prev.
19 */ 18 */
20struct svc_cacherep { 19struct svc_cacherep {
21 struct hlist_node c_hash; 20 struct hlist_node c_hash;
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index afa19016c4a8..8f641c908450 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -151,9 +151,15 @@ typedef struct svc_fh {
151 __u64 fh_pre_size; /* size before operation */ 151 __u64 fh_pre_size; /* size before operation */
152 struct timespec fh_pre_mtime; /* mtime before oper */ 152 struct timespec fh_pre_mtime; /* mtime before oper */
153 struct timespec fh_pre_ctime; /* ctime before oper */ 153 struct timespec fh_pre_ctime; /* ctime before oper */
154 /*
155 * pre-op nfsv4 change attr: note must check IS_I_VERSION(inode)
156 * to find out if it is valid.
157 */
158 u64 fh_pre_change;
154 159
155 /* Post-op attributes saved in fh_unlock */ 160 /* Post-op attributes saved in fh_unlock */
156 struct kstat fh_post_attr; /* full attrs after operation */ 161 struct kstat fh_post_attr; /* full attrs after operation */
162 u64 fh_post_change; /* nfsv4 change; see above */
157#endif /* CONFIG_NFSD_V3 */ 163#endif /* CONFIG_NFSD_V3 */
158 164
159} svc_fh; 165} svc_fh;
@@ -298,6 +304,7 @@ fill_pre_wcc(struct svc_fh *fhp)
298 fhp->fh_pre_mtime = inode->i_mtime; 304 fhp->fh_pre_mtime = inode->i_mtime;
299 fhp->fh_pre_ctime = inode->i_ctime; 305 fhp->fh_pre_ctime = inode->i_ctime;
300 fhp->fh_pre_size = inode->i_size; 306 fhp->fh_pre_size = inode->i_size;
307 fhp->fh_pre_change = inode->i_version;
301 fhp->fh_pre_saved = 1; 308 fhp->fh_pre_saved = 1;
302 } 309 }
303} 310}
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
index 7ef4b7ad1214..57ab2ed08459 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -60,15 +60,6 @@ typedef struct {
60#define si_stateownerid si_opaque.so_stateownerid 60#define si_stateownerid si_opaque.so_stateownerid
61#define si_fileid si_opaque.so_fileid 61#define si_fileid si_opaque.so_fileid
62 62
63
64struct nfs4_cb_recall {
65 u32 cbr_ident;
66 int cbr_trunc;
67 stateid_t cbr_stateid;
68 struct knfsd_fh cbr_fh;
69 struct nfs4_delegation *cbr_dp;
70};
71
72struct nfs4_delegation { 63struct nfs4_delegation {
73 struct list_head dl_perfile; 64 struct list_head dl_perfile;
74 struct list_head dl_perclnt; 65 struct list_head dl_perclnt;
@@ -80,22 +71,25 @@ struct nfs4_delegation {
80 struct file *dl_vfs_file; 71 struct file *dl_vfs_file;
81 u32 dl_type; 72 u32 dl_type;
82 time_t dl_time; 73 time_t dl_time;
83 struct nfs4_cb_recall dl_recall; 74/* For recall: */
75 u32 dl_ident;
76 stateid_t dl_stateid;
77 struct knfsd_fh dl_fh;
78 int dl_retries;
84}; 79};
85 80
86#define dl_stateid dl_recall.cbr_stateid
87#define dl_fh dl_recall.cbr_fh
88
89/* client delegation callback info */ 81/* client delegation callback info */
90struct nfs4_callback { 82struct nfs4_cb_conn {
91 /* SETCLIENTID info */ 83 /* SETCLIENTID info */
92 u32 cb_addr; 84 u32 cb_addr;
93 unsigned short cb_port; 85 unsigned short cb_port;
94 u32 cb_prog; 86 u32 cb_prog;
95 u32 cb_ident; 87 u32 cb_minorversion;
88 u32 cb_ident; /* minorversion 0 only */
96 /* RPC client info */ 89 /* RPC client info */
97 atomic_t cb_set; /* successful CB_NULL call */ 90 atomic_t cb_set; /* successful CB_NULL call */
98 struct rpc_clnt * cb_client; 91 struct rpc_clnt * cb_client;
92 struct rpc_cred * cb_cred;
99}; 93};
100 94
101/* Maximum number of slots per session. 128 is useful for long haul TCP */ 95/* Maximum number of slots per session. 128 is useful for long haul TCP */
@@ -121,6 +115,17 @@ struct nfsd4_slot {
121 struct nfsd4_cache_entry sl_cache_entry; 115 struct nfsd4_cache_entry sl_cache_entry;
122}; 116};
123 117
118struct nfsd4_channel_attrs {
119 u32 headerpadsz;
120 u32 maxreq_sz;
121 u32 maxresp_sz;
122 u32 maxresp_cached;
123 u32 maxops;
124 u32 maxreqs;
125 u32 nr_rdma_attrs;
126 u32 rdma_attrs;
127};
128
124struct nfsd4_session { 129struct nfsd4_session {
125 struct kref se_ref; 130 struct kref se_ref;
126 struct list_head se_hash; /* hash by sessionid */ 131 struct list_head se_hash; /* hash by sessionid */
@@ -128,11 +133,8 @@ struct nfsd4_session {
128 u32 se_flags; 133 u32 se_flags;
129 struct nfs4_client *se_client; /* for expire_client */ 134 struct nfs4_client *se_client; /* for expire_client */
130 struct nfs4_sessionid se_sessionid; 135 struct nfs4_sessionid se_sessionid;
131 u32 se_fmaxreq_sz; 136 struct nfsd4_channel_attrs se_fchannel;
132 u32 se_fmaxresp_sz; 137 struct nfsd4_channel_attrs se_bchannel;
133 u32 se_fmaxresp_cached;
134 u32 se_fmaxops;
135 u32 se_fnumslots;
136 struct nfsd4_slot se_slots[]; /* forward channel slots */ 138 struct nfsd4_slot se_slots[]; /* forward channel slots */
137}; 139};
138 140
@@ -184,7 +186,7 @@ struct nfs4_client {
184 struct svc_cred cl_cred; /* setclientid principal */ 186 struct svc_cred cl_cred; /* setclientid principal */
185 clientid_t cl_clientid; /* generated by server */ 187 clientid_t cl_clientid; /* generated by server */
186 nfs4_verifier cl_confirm; /* generated by server */ 188 nfs4_verifier cl_confirm; /* generated by server */
187 struct nfs4_callback cl_callback; /* callback info */ 189 struct nfs4_cb_conn cl_cb_conn; /* callback info */
188 atomic_t cl_count; /* ref count */ 190 atomic_t cl_count; /* ref count */
189 u32 cl_firststate; /* recovery dir creation */ 191 u32 cl_firststate; /* recovery dir creation */
190 192
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index f80d6013fdc3..2bacf7535069 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -64,10 +64,13 @@ static inline bool nfsd4_has_session(struct nfsd4_compound_state *cs)
64 64
65struct nfsd4_change_info { 65struct nfsd4_change_info {
66 u32 atomic; 66 u32 atomic;
67 bool change_supported;
67 u32 before_ctime_sec; 68 u32 before_ctime_sec;
68 u32 before_ctime_nsec; 69 u32 before_ctime_nsec;
70 u64 before_change;
69 u32 after_ctime_sec; 71 u32 after_ctime_sec;
70 u32 after_ctime_nsec; 72 u32 after_ctime_nsec;
73 u64 after_change;
71}; 74};
72 75
73struct nfsd4_access { 76struct nfsd4_access {
@@ -363,17 +366,6 @@ struct nfsd4_exchange_id {
363 int spa_how; 366 int spa_how;
364}; 367};
365 368
366struct nfsd4_channel_attrs {
367 u32 headerpadsz;
368 u32 maxreq_sz;
369 u32 maxresp_sz;
370 u32 maxresp_cached;
371 u32 maxops;
372 u32 maxreqs;
373 u32 nr_rdma_attrs;
374 u32 rdma_attrs;
375};
376
377struct nfsd4_create_session { 369struct nfsd4_create_session {
378 clientid_t clientid; 370 clientid_t clientid;
379 struct nfs4_sessionid sessionid; 371 struct nfs4_sessionid sessionid;
@@ -503,10 +495,16 @@ set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp)
503{ 495{
504 BUG_ON(!fhp->fh_pre_saved || !fhp->fh_post_saved); 496 BUG_ON(!fhp->fh_pre_saved || !fhp->fh_post_saved);
505 cinfo->atomic = 1; 497 cinfo->atomic = 1;
506 cinfo->before_ctime_sec = fhp->fh_pre_ctime.tv_sec; 498 cinfo->change_supported = IS_I_VERSION(fhp->fh_dentry->d_inode);
507 cinfo->before_ctime_nsec = fhp->fh_pre_ctime.tv_nsec; 499 if (cinfo->change_supported) {
508 cinfo->after_ctime_sec = fhp->fh_post_attr.ctime.tv_sec; 500 cinfo->before_change = fhp->fh_pre_change;
509 cinfo->after_ctime_nsec = fhp->fh_post_attr.ctime.tv_nsec; 501 cinfo->after_change = fhp->fh_post_change;
502 } else {
503 cinfo->before_ctime_sec = fhp->fh_pre_ctime.tv_sec;
504 cinfo->before_ctime_nsec = fhp->fh_pre_ctime.tv_nsec;
505 cinfo->after_ctime_sec = fhp->fh_post_attr.ctime.tv_sec;
506 cinfo->after_ctime_nsec = fhp->fh_post_attr.ctime.tv_nsec;
507 }
510} 508}
511 509
512int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *); 510int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *);