diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-27 16:23:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-27 16:23:02 -0400 |
commit | 28890d3598c352ae065b560e0fded3e79c800ba1 (patch) | |
tree | 93267c5b29b9e81185e66a6c2e70e67dc626b63f /include/linux | |
parent | 91d41fdf31f74e6e2e5f3cb018eca4200e36e202 (diff) | |
parent | ed1e6211a0a134ff23592c6f057af982ad5dab52 (diff) |
Merge branch 'nfs-for-3.1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
* 'nfs-for-3.1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (44 commits)
NFSv4: Don't use the delegation->inode in nfs_mark_return_delegation()
nfs: don't use d_move in nfs_async_rename_done
RDMA: Increasing RPCRDMA_MAX_DATA_SEGS
SUNRPC: Replace xprt->resend and xprt->sending with a priority queue
SUNRPC: Allow caller of rpc_sleep_on() to select priority levels
SUNRPC: Support dynamic slot allocation for TCP connections
SUNRPC: Clean up the slot table allocation
SUNRPC: Initalise the struct xprt upon allocation
SUNRPC: Ensure that we grab the XPRT_LOCK before calling xprt_alloc_slot
pnfs: simplify pnfs files module autoloading
nfs: document nfsv4 sillyrename issues
NFS: Convert nfs4_set_ds_client to EXPORT_SYMBOL_GPL
SUNRPC: Convert the backchannel exports to EXPORT_SYMBOL_GPL
SUNRPC: sunrpc should not explicitly depend on NFS config options
NFS: Clean up - simplify the switch to read/write-through-MDS
NFS: Move the pnfs write code into pnfs.c
NFS: Move the pnfs read code into pnfs.c
NFS: Allow the nfs_pageio_descriptor to signal that a re-coalesce is needed
NFS: Use the nfs_pageio_descriptor->pg_bsize in the read/write request
NFS: Cache rpc_ops in struct nfs_pageio_descriptor
...
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/nfs4.h | 3 | ||||
-rw-r--r-- | include/linux/nfs_fs_sb.h | 5 | ||||
-rw-r--r-- | include/linux/nfs_page.h | 17 | ||||
-rw-r--r-- | include/linux/nfs_xdr.h | 34 | ||||
-rw-r--r-- | include/linux/pnfs_osd_xdr.h | 31 | ||||
-rw-r--r-- | include/linux/sunrpc/bc_xprt.h | 6 | ||||
-rw-r--r-- | include/linux/sunrpc/sched.h | 4 | ||||
-rw-r--r-- | include/linux/sunrpc/svc.h | 4 | ||||
-rw-r--r-- | include/linux/sunrpc/xprt.h | 34 |
9 files changed, 81 insertions, 57 deletions
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 504b289ba680..a3c4bc800dce 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -563,6 +563,9 @@ enum { | |||
563 | NFSPROC4_CLNT_GETDEVICEINFO, | 563 | NFSPROC4_CLNT_GETDEVICEINFO, |
564 | NFSPROC4_CLNT_LAYOUTCOMMIT, | 564 | NFSPROC4_CLNT_LAYOUTCOMMIT, |
565 | NFSPROC4_CLNT_LAYOUTRETURN, | 565 | NFSPROC4_CLNT_LAYOUTRETURN, |
566 | NFSPROC4_CLNT_SECINFO_NO_NAME, | ||
567 | NFSPROC4_CLNT_TEST_STATEID, | ||
568 | NFSPROC4_CLNT_FREE_STATEID, | ||
566 | }; | 569 | }; |
567 | 570 | ||
568 | /* nfs41 types */ | 571 | /* nfs41 types */ |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 08c444aa0411..50a661f8b45a 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
@@ -16,6 +16,7 @@ struct nfs4_sequence_args; | |||
16 | struct nfs4_sequence_res; | 16 | struct nfs4_sequence_res; |
17 | struct nfs_server; | 17 | struct nfs_server; |
18 | struct nfs4_minor_version_ops; | 18 | struct nfs4_minor_version_ops; |
19 | struct server_scope; | ||
19 | 20 | ||
20 | /* | 21 | /* |
21 | * The nfs_client identifies our client state to the server. | 22 | * The nfs_client identifies our client state to the server. |
@@ -77,12 +78,13 @@ struct nfs_client { | |||
77 | /* The flags used for obtaining the clientid during EXCHANGE_ID */ | 78 | /* The flags used for obtaining the clientid during EXCHANGE_ID */ |
78 | u32 cl_exchange_flags; | 79 | u32 cl_exchange_flags; |
79 | struct nfs4_session *cl_session; /* sharred session */ | 80 | struct nfs4_session *cl_session; /* sharred session */ |
80 | struct list_head cl_layouts; | ||
81 | #endif /* CONFIG_NFS_V4 */ | 81 | #endif /* CONFIG_NFS_V4 */ |
82 | 82 | ||
83 | #ifdef CONFIG_NFS_FSCACHE | 83 | #ifdef CONFIG_NFS_FSCACHE |
84 | struct fscache_cookie *fscache; /* client index cache cookie */ | 84 | struct fscache_cookie *fscache; /* client index cache cookie */ |
85 | #endif | 85 | #endif |
86 | |||
87 | struct server_scope *server_scope; /* from exchange_id */ | ||
86 | }; | 88 | }; |
87 | 89 | ||
88 | /* | 90 | /* |
@@ -149,6 +151,7 @@ struct nfs_server { | |||
149 | struct rb_root openowner_id; | 151 | struct rb_root openowner_id; |
150 | struct rb_root lockowner_id; | 152 | struct rb_root lockowner_id; |
151 | #endif | 153 | #endif |
154 | struct list_head layouts; | ||
152 | struct list_head delegations; | 155 | struct list_head delegations; |
153 | void (*destroy)(struct nfs_server *); | 156 | void (*destroy)(struct nfs_server *); |
154 | 157 | ||
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index 25311b3bedf8..e2791a27a901 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h | |||
@@ -55,20 +55,28 @@ struct nfs_page { | |||
55 | struct nfs_writeverf wb_verf; /* Commit cookie */ | 55 | struct nfs_writeverf wb_verf; /* Commit cookie */ |
56 | }; | 56 | }; |
57 | 57 | ||
58 | struct nfs_pageio_descriptor; | ||
59 | struct nfs_pageio_ops { | ||
60 | void (*pg_init)(struct nfs_pageio_descriptor *, struct nfs_page *); | ||
61 | bool (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *); | ||
62 | int (*pg_doio)(struct nfs_pageio_descriptor *); | ||
63 | }; | ||
64 | |||
58 | struct nfs_pageio_descriptor { | 65 | struct nfs_pageio_descriptor { |
59 | struct list_head pg_list; | 66 | struct list_head pg_list; |
60 | unsigned long pg_bytes_written; | 67 | unsigned long pg_bytes_written; |
61 | size_t pg_count; | 68 | size_t pg_count; |
62 | size_t pg_bsize; | 69 | size_t pg_bsize; |
63 | unsigned int pg_base; | 70 | unsigned int pg_base; |
64 | char pg_moreio; | 71 | unsigned char pg_moreio : 1, |
72 | pg_recoalesce : 1; | ||
65 | 73 | ||
66 | struct inode *pg_inode; | 74 | struct inode *pg_inode; |
67 | int (*pg_doio)(struct nfs_pageio_descriptor *); | 75 | const struct nfs_pageio_ops *pg_ops; |
68 | int pg_ioflags; | 76 | int pg_ioflags; |
69 | int pg_error; | 77 | int pg_error; |
78 | const struct rpc_call_ops *pg_rpc_callops; | ||
70 | struct pnfs_layout_segment *pg_lseg; | 79 | struct pnfs_layout_segment *pg_lseg; |
71 | bool (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *); | ||
72 | }; | 80 | }; |
73 | 81 | ||
74 | #define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) | 82 | #define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) |
@@ -85,7 +93,7 @@ extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *dst, | |||
85 | pgoff_t idx_start, unsigned int npages, int tag); | 93 | pgoff_t idx_start, unsigned int npages, int tag); |
86 | extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc, | 94 | extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc, |
87 | struct inode *inode, | 95 | struct inode *inode, |
88 | int (*doio)(struct nfs_pageio_descriptor *desc), | 96 | const struct nfs_pageio_ops *pg_ops, |
89 | size_t bsize, | 97 | size_t bsize, |
90 | int how); | 98 | int how); |
91 | extern int nfs_pageio_add_request(struct nfs_pageio_descriptor *, | 99 | extern int nfs_pageio_add_request(struct nfs_pageio_descriptor *, |
@@ -100,7 +108,6 @@ extern void nfs_unlock_request(struct nfs_page *req); | |||
100 | extern int nfs_set_page_tag_locked(struct nfs_page *req); | 108 | extern int nfs_set_page_tag_locked(struct nfs_page *req); |
101 | extern void nfs_clear_page_tag_locked(struct nfs_page *req); | 109 | extern void nfs_clear_page_tag_locked(struct nfs_page *req); |
102 | 110 | ||
103 | |||
104 | /* | 111 | /* |
105 | * Lock the page of an asynchronous request without getting a new reference | 112 | * Lock the page of an asynchronous request without getting a new reference |
106 | */ | 113 | */ |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 00848d86ffb2..5b115956abac 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -269,9 +269,10 @@ struct nfs4_layoutcommit_data { | |||
269 | }; | 269 | }; |
270 | 270 | ||
271 | struct nfs4_layoutreturn_args { | 271 | struct nfs4_layoutreturn_args { |
272 | __u32 layout_type; | 272 | struct pnfs_layout_hdr *layout; |
273 | struct inode *inode; | 273 | struct inode *inode; |
274 | nfs4_stateid stateid; | 274 | nfs4_stateid stateid; |
275 | __u32 layout_type; | ||
275 | struct nfs4_sequence_args seq_args; | 276 | struct nfs4_sequence_args seq_args; |
276 | }; | 277 | }; |
277 | 278 | ||
@@ -1060,6 +1061,7 @@ struct server_scope { | |||
1060 | struct nfs41_exchange_id_res { | 1061 | struct nfs41_exchange_id_res { |
1061 | struct nfs_client *client; | 1062 | struct nfs_client *client; |
1062 | u32 flags; | 1063 | u32 flags; |
1064 | struct server_scope *server_scope; | ||
1063 | }; | 1065 | }; |
1064 | 1066 | ||
1065 | struct nfs41_create_session_args { | 1067 | struct nfs41_create_session_args { |
@@ -1083,6 +1085,34 @@ struct nfs41_reclaim_complete_args { | |||
1083 | struct nfs41_reclaim_complete_res { | 1085 | struct nfs41_reclaim_complete_res { |
1084 | struct nfs4_sequence_res seq_res; | 1086 | struct nfs4_sequence_res seq_res; |
1085 | }; | 1087 | }; |
1088 | |||
1089 | #define SECINFO_STYLE_CURRENT_FH 0 | ||
1090 | #define SECINFO_STYLE_PARENT 1 | ||
1091 | struct nfs41_secinfo_no_name_args { | ||
1092 | int style; | ||
1093 | struct nfs4_sequence_args seq_args; | ||
1094 | }; | ||
1095 | |||
1096 | struct nfs41_test_stateid_args { | ||
1097 | nfs4_stateid *stateid; | ||
1098 | struct nfs4_sequence_args seq_args; | ||
1099 | }; | ||
1100 | |||
1101 | struct nfs41_test_stateid_res { | ||
1102 | unsigned int status; | ||
1103 | struct nfs4_sequence_res seq_res; | ||
1104 | }; | ||
1105 | |||
1106 | struct nfs41_free_stateid_args { | ||
1107 | nfs4_stateid *stateid; | ||
1108 | struct nfs4_sequence_args seq_args; | ||
1109 | }; | ||
1110 | |||
1111 | struct nfs41_free_stateid_res { | ||
1112 | unsigned int status; | ||
1113 | struct nfs4_sequence_res seq_res; | ||
1114 | }; | ||
1115 | |||
1086 | #endif /* CONFIG_NFS_V4_1 */ | 1116 | #endif /* CONFIG_NFS_V4_1 */ |
1087 | 1117 | ||
1088 | struct nfs_page; | 1118 | struct nfs_page; |
@@ -1096,6 +1126,7 @@ struct nfs_read_data { | |||
1096 | struct rpc_cred *cred; | 1126 | struct rpc_cred *cred; |
1097 | struct nfs_fattr fattr; /* fattr storage */ | 1127 | struct nfs_fattr fattr; /* fattr storage */ |
1098 | struct list_head pages; /* Coalesced read requests */ | 1128 | struct list_head pages; /* Coalesced read requests */ |
1129 | struct list_head list; /* lists of struct nfs_read_data */ | ||
1099 | struct nfs_page *req; /* multi ops per nfs_page */ | 1130 | struct nfs_page *req; /* multi ops per nfs_page */ |
1100 | struct page **pagevec; | 1131 | struct page **pagevec; |
1101 | unsigned int npages; /* Max length of pagevec */ | 1132 | unsigned int npages; /* Max length of pagevec */ |
@@ -1119,6 +1150,7 @@ struct nfs_write_data { | |||
1119 | struct nfs_fattr fattr; | 1150 | struct nfs_fattr fattr; |
1120 | struct nfs_writeverf verf; | 1151 | struct nfs_writeverf verf; |
1121 | struct list_head pages; /* Coalesced requests we wish to flush */ | 1152 | struct list_head pages; /* Coalesced requests we wish to flush */ |
1153 | struct list_head list; /* lists of struct nfs_write_data */ | ||
1122 | struct nfs_page *req; /* multi ops per nfs_page */ | 1154 | struct nfs_page *req; /* multi ops per nfs_page */ |
1123 | struct page **pagevec; | 1155 | struct page **pagevec; |
1124 | unsigned int npages; /* Max length of pagevec */ | 1156 | unsigned int npages; /* Max length of pagevec */ |
diff --git a/include/linux/pnfs_osd_xdr.h b/include/linux/pnfs_osd_xdr.h index 76efbdd01622..435dd5fa7453 100644 --- a/include/linux/pnfs_osd_xdr.h +++ b/include/linux/pnfs_osd_xdr.h | |||
@@ -41,9 +41,6 @@ | |||
41 | 41 | ||
42 | #include <linux/nfs_fs.h> | 42 | #include <linux/nfs_fs.h> |
43 | #include <linux/nfs_page.h> | 43 | #include <linux/nfs_page.h> |
44 | #include <scsi/osd_protocol.h> | ||
45 | |||
46 | #define PNFS_OSD_OSDNAME_MAXSIZE 256 | ||
47 | 44 | ||
48 | /* | 45 | /* |
49 | * draft-ietf-nfsv4-minorversion-22 | 46 | * draft-ietf-nfsv4-minorversion-22 |
@@ -99,12 +96,6 @@ struct pnfs_osd_objid { | |||
99 | #define _DEVID_HI(oid_device_id) \ | 96 | #define _DEVID_HI(oid_device_id) \ |
100 | (unsigned long long)be64_to_cpup(((__be64 *)(oid_device_id)->data) + 1) | 97 | (unsigned long long)be64_to_cpup(((__be64 *)(oid_device_id)->data) + 1) |
101 | 98 | ||
102 | static inline int | ||
103 | pnfs_osd_objid_xdr_sz(void) | ||
104 | { | ||
105 | return (NFS4_DEVICEID4_SIZE / 4) + 2 + 2; | ||
106 | } | ||
107 | |||
108 | enum pnfs_osd_version { | 99 | enum pnfs_osd_version { |
109 | PNFS_OSD_MISSING = 0, | 100 | PNFS_OSD_MISSING = 0, |
110 | PNFS_OSD_VERSION_1 = 1, | 101 | PNFS_OSD_VERSION_1 = 1, |
@@ -189,8 +180,6 @@ struct pnfs_osd_targetid { | |||
189 | struct nfs4_string oti_scsi_device_id; | 180 | struct nfs4_string oti_scsi_device_id; |
190 | }; | 181 | }; |
191 | 182 | ||
192 | enum { PNFS_OSD_TARGETID_MAX = 1 + PNFS_OSD_OSDNAME_MAXSIZE / 4 }; | ||
193 | |||
194 | /* struct netaddr4 { | 183 | /* struct netaddr4 { |
195 | * // see struct rpcb in RFC1833 | 184 | * // see struct rpcb in RFC1833 |
196 | * string r_netid<>; // network id | 185 | * string r_netid<>; // network id |
@@ -207,12 +196,6 @@ struct pnfs_osd_targetaddr { | |||
207 | struct pnfs_osd_net_addr ota_netaddr; | 196 | struct pnfs_osd_net_addr ota_netaddr; |
208 | }; | 197 | }; |
209 | 198 | ||
210 | enum { | ||
211 | NETWORK_ID_MAX = 16 / 4, | ||
212 | UNIVERSAL_ADDRESS_MAX = 64 / 4, | ||
213 | PNFS_OSD_TARGETADDR_MAX = 3 + NETWORK_ID_MAX + UNIVERSAL_ADDRESS_MAX, | ||
214 | }; | ||
215 | |||
216 | struct pnfs_osd_deviceaddr { | 199 | struct pnfs_osd_deviceaddr { |
217 | struct pnfs_osd_targetid oda_targetid; | 200 | struct pnfs_osd_targetid oda_targetid; |
218 | struct pnfs_osd_targetaddr oda_targetaddr; | 201 | struct pnfs_osd_targetaddr oda_targetaddr; |
@@ -222,15 +205,6 @@ struct pnfs_osd_deviceaddr { | |||
222 | struct nfs4_string oda_osdname; | 205 | struct nfs4_string oda_osdname; |
223 | }; | 206 | }; |
224 | 207 | ||
225 | enum { | ||
226 | ODA_OSDNAME_MAX = PNFS_OSD_OSDNAME_MAXSIZE / 4, | ||
227 | PNFS_OSD_DEVICEADDR_MAX = | ||
228 | PNFS_OSD_TARGETID_MAX + PNFS_OSD_TARGETADDR_MAX + | ||
229 | 2 /*oda_lun*/ + | ||
230 | 1 + OSD_SYSTEMID_LEN + | ||
231 | 1 + ODA_OSDNAME_MAX, | ||
232 | }; | ||
233 | |||
234 | /* LAYOUTCOMMIT: layoutupdate */ | 208 | /* LAYOUTCOMMIT: layoutupdate */ |
235 | 209 | ||
236 | /* union pnfs_osd_deltaspaceused4 switch (bool dsu_valid) { | 210 | /* union pnfs_osd_deltaspaceused4 switch (bool dsu_valid) { |
@@ -279,7 +253,7 @@ struct pnfs_osd_ioerr { | |||
279 | u32 oer_errno; | 253 | u32 oer_errno; |
280 | }; | 254 | }; |
281 | 255 | ||
282 | /* OSD XDR API */ | 256 | /* OSD XDR Client API */ |
283 | /* Layout helpers */ | 257 | /* Layout helpers */ |
284 | /* Layout decoding is done in two parts: | 258 | /* Layout decoding is done in two parts: |
285 | * 1. First Call pnfs_osd_xdr_decode_layout_map to read in only the header part | 259 | * 1. First Call pnfs_osd_xdr_decode_layout_map to read in only the header part |
@@ -337,8 +311,7 @@ extern int | |||
337 | pnfs_osd_xdr_encode_layoutupdate(struct xdr_stream *xdr, | 311 | pnfs_osd_xdr_encode_layoutupdate(struct xdr_stream *xdr, |
338 | struct pnfs_osd_layoutupdate *lou); | 312 | struct pnfs_osd_layoutupdate *lou); |
339 | 313 | ||
340 | /* osd_ioerror encoding/decoding (layout_return) */ | 314 | /* osd_ioerror encoding (layout_return) */ |
341 | /* Client */ | ||
342 | extern __be32 *pnfs_osd_xdr_ioerr_reserve_space(struct xdr_stream *xdr); | 315 | extern __be32 *pnfs_osd_xdr_ioerr_reserve_space(struct xdr_stream *xdr); |
343 | extern void pnfs_osd_xdr_encode_ioerr(__be32 *p, struct pnfs_osd_ioerr *ioerr); | 316 | extern void pnfs_osd_xdr_encode_ioerr(__be32 *p, struct pnfs_osd_ioerr *ioerr); |
344 | 317 | ||
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h index 082884295f80..f7f3ce340c08 100644 --- a/include/linux/sunrpc/bc_xprt.h +++ b/include/linux/sunrpc/bc_xprt.h | |||
@@ -31,7 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
31 | #include <linux/sunrpc/xprt.h> | 31 | #include <linux/sunrpc/xprt.h> |
32 | #include <linux/sunrpc/sched.h> | 32 | #include <linux/sunrpc/sched.h> |
33 | 33 | ||
34 | #ifdef CONFIG_NFS_V4_1 | 34 | #ifdef CONFIG_SUNRPC_BACKCHANNEL |
35 | struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt); | 35 | struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt); |
36 | void xprt_free_bc_request(struct rpc_rqst *req); | 36 | void xprt_free_bc_request(struct rpc_rqst *req); |
37 | int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); | 37 | int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); |
@@ -47,7 +47,7 @@ static inline int svc_is_backchannel(const struct svc_rqst *rqstp) | |||
47 | return 1; | 47 | return 1; |
48 | return 0; | 48 | return 0; |
49 | } | 49 | } |
50 | #else /* CONFIG_NFS_V4_1 */ | 50 | #else /* CONFIG_SUNRPC_BACKCHANNEL */ |
51 | static inline int xprt_setup_backchannel(struct rpc_xprt *xprt, | 51 | static inline int xprt_setup_backchannel(struct rpc_xprt *xprt, |
52 | unsigned int min_reqs) | 52 | unsigned int min_reqs) |
53 | { | 53 | { |
@@ -62,6 +62,6 @@ static inline int svc_is_backchannel(const struct svc_rqst *rqstp) | |||
62 | static inline void xprt_free_bc_request(struct rpc_rqst *req) | 62 | static inline void xprt_free_bc_request(struct rpc_rqst *req) |
63 | { | 63 | { |
64 | } | 64 | } |
65 | #endif /* CONFIG_NFS_V4_1 */ | 65 | #endif /* CONFIG_SUNRPC_BACKCHANNEL */ |
66 | #endif /* _LINUX_SUNRPC_BC_XPRT_H */ | 66 | #endif /* _LINUX_SUNRPC_BC_XPRT_H */ |
67 | 67 | ||
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index fe2d8e6b923b..e7756896f3ca 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -227,6 +227,10 @@ void rpc_init_wait_queue(struct rpc_wait_queue *, const char *); | |||
227 | void rpc_destroy_wait_queue(struct rpc_wait_queue *); | 227 | void rpc_destroy_wait_queue(struct rpc_wait_queue *); |
228 | void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *, | 228 | void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *, |
229 | rpc_action action); | 229 | rpc_action action); |
230 | void rpc_sleep_on_priority(struct rpc_wait_queue *, | ||
231 | struct rpc_task *, | ||
232 | rpc_action action, | ||
233 | int priority); | ||
230 | void rpc_wake_up_queued_task(struct rpc_wait_queue *, | 234 | void rpc_wake_up_queued_task(struct rpc_wait_queue *, |
231 | struct rpc_task *); | 235 | struct rpc_task *); |
232 | void rpc_wake_up(struct rpc_wait_queue *); | 236 | void rpc_wake_up(struct rpc_wait_queue *); |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 2f1e5186e049..223588a976a0 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -92,7 +92,7 @@ struct svc_serv { | |||
92 | struct module * sv_module; /* optional module to count when | 92 | struct module * sv_module; /* optional module to count when |
93 | * adding threads */ | 93 | * adding threads */ |
94 | svc_thread_fn sv_function; /* main function for threads */ | 94 | svc_thread_fn sv_function; /* main function for threads */ |
95 | #if defined(CONFIG_NFS_V4_1) | 95 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |
96 | struct list_head sv_cb_list; /* queue for callback requests | 96 | struct list_head sv_cb_list; /* queue for callback requests |
97 | * that arrive over the same | 97 | * that arrive over the same |
98 | * connection */ | 98 | * connection */ |
@@ -100,7 +100,7 @@ struct svc_serv { | |||
100 | wait_queue_head_t sv_cb_waitq; /* sleep here if there are no | 100 | wait_queue_head_t sv_cb_waitq; /* sleep here if there are no |
101 | * entries in the svc_cb_list */ | 101 | * entries in the svc_cb_list */ |
102 | struct svc_xprt *sv_bc_xprt; /* callback on fore channel */ | 102 | struct svc_xprt *sv_bc_xprt; /* callback on fore channel */ |
103 | #endif /* CONFIG_NFS_V4_1 */ | 103 | #endif /* CONFIG_SUNRPC_BACKCHANNEL */ |
104 | }; | 104 | }; |
105 | 105 | ||
106 | /* | 106 | /* |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 81cce3b3ee66..15518a152ac3 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #define RPC_MIN_SLOT_TABLE (2U) | 22 | #define RPC_MIN_SLOT_TABLE (2U) |
23 | #define RPC_DEF_SLOT_TABLE (16U) | 23 | #define RPC_DEF_SLOT_TABLE (16U) |
24 | #define RPC_MAX_SLOT_TABLE (128U) | 24 | #define RPC_MAX_SLOT_TABLE (128U) |
25 | #define RPC_MAX_SLOT_TABLE_LIMIT (65536U) | ||
25 | 26 | ||
26 | /* | 27 | /* |
27 | * This describes a timeout strategy | 28 | * This describes a timeout strategy |
@@ -100,18 +101,18 @@ struct rpc_rqst { | |||
100 | ktime_t rq_xtime; /* transmit time stamp */ | 101 | ktime_t rq_xtime; /* transmit time stamp */ |
101 | int rq_ntrans; | 102 | int rq_ntrans; |
102 | 103 | ||
103 | #if defined(CONFIG_NFS_V4_1) | 104 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |
104 | struct list_head rq_bc_list; /* Callback service list */ | 105 | struct list_head rq_bc_list; /* Callback service list */ |
105 | unsigned long rq_bc_pa_state; /* Backchannel prealloc state */ | 106 | unsigned long rq_bc_pa_state; /* Backchannel prealloc state */ |
106 | struct list_head rq_bc_pa_list; /* Backchannel prealloc list */ | 107 | struct list_head rq_bc_pa_list; /* Backchannel prealloc list */ |
107 | #endif /* CONFIG_NFS_V4_1 */ | 108 | #endif /* CONFIG_SUNRPC_BACKCHANEL */ |
108 | }; | 109 | }; |
109 | #define rq_svec rq_snd_buf.head | 110 | #define rq_svec rq_snd_buf.head |
110 | #define rq_slen rq_snd_buf.len | 111 | #define rq_slen rq_snd_buf.len |
111 | 112 | ||
112 | struct rpc_xprt_ops { | 113 | struct rpc_xprt_ops { |
113 | void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); | 114 | void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); |
114 | int (*reserve_xprt)(struct rpc_task *task); | 115 | int (*reserve_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); |
115 | void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); | 116 | void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); |
116 | void (*rpcbind)(struct rpc_task *task); | 117 | void (*rpcbind)(struct rpc_task *task); |
117 | void (*set_port)(struct rpc_xprt *xprt, unsigned short port); | 118 | void (*set_port)(struct rpc_xprt *xprt, unsigned short port); |
@@ -164,12 +165,12 @@ struct rpc_xprt { | |||
164 | 165 | ||
165 | struct rpc_wait_queue binding; /* requests waiting on rpcbind */ | 166 | struct rpc_wait_queue binding; /* requests waiting on rpcbind */ |
166 | struct rpc_wait_queue sending; /* requests waiting to send */ | 167 | struct rpc_wait_queue sending; /* requests waiting to send */ |
167 | struct rpc_wait_queue resend; /* requests waiting to resend */ | ||
168 | struct rpc_wait_queue pending; /* requests in flight */ | 168 | struct rpc_wait_queue pending; /* requests in flight */ |
169 | struct rpc_wait_queue backlog; /* waiting for slot */ | 169 | struct rpc_wait_queue backlog; /* waiting for slot */ |
170 | struct list_head free; /* free slots */ | 170 | struct list_head free; /* free slots */ |
171 | struct rpc_rqst * slot; /* slot table storage */ | 171 | unsigned int max_reqs; /* max number of slots */ |
172 | unsigned int max_reqs; /* total slots */ | 172 | unsigned int min_reqs; /* min number of slots */ |
173 | atomic_t num_reqs; /* total slots */ | ||
173 | unsigned long state; /* transport state */ | 174 | unsigned long state; /* transport state */ |
174 | unsigned char shutdown : 1, /* being shut down */ | 175 | unsigned char shutdown : 1, /* being shut down */ |
175 | resvport : 1; /* use a reserved port */ | 176 | resvport : 1; /* use a reserved port */ |
@@ -200,7 +201,7 @@ struct rpc_xprt { | |||
200 | u32 xid; /* Next XID value to use */ | 201 | u32 xid; /* Next XID value to use */ |
201 | struct rpc_task * snd_task; /* Task blocked in send */ | 202 | struct rpc_task * snd_task; /* Task blocked in send */ |
202 | struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ | 203 | struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ |
203 | #if defined(CONFIG_NFS_V4_1) | 204 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |
204 | struct svc_serv *bc_serv; /* The RPC service which will */ | 205 | struct svc_serv *bc_serv; /* The RPC service which will */ |
205 | /* process the callback */ | 206 | /* process the callback */ |
206 | unsigned int bc_alloc_count; /* Total number of preallocs */ | 207 | unsigned int bc_alloc_count; /* Total number of preallocs */ |
@@ -208,7 +209,7 @@ struct rpc_xprt { | |||
208 | * items */ | 209 | * items */ |
209 | struct list_head bc_pa_list; /* List of preallocated | 210 | struct list_head bc_pa_list; /* List of preallocated |
210 | * backchannel rpc_rqst's */ | 211 | * backchannel rpc_rqst's */ |
211 | #endif /* CONFIG_NFS_V4_1 */ | 212 | #endif /* CONFIG_SUNRPC_BACKCHANNEL */ |
212 | struct list_head recv; | 213 | struct list_head recv; |
213 | 214 | ||
214 | struct { | 215 | struct { |
@@ -228,15 +229,15 @@ struct rpc_xprt { | |||
228 | const char *address_strings[RPC_DISPLAY_MAX]; | 229 | const char *address_strings[RPC_DISPLAY_MAX]; |
229 | }; | 230 | }; |
230 | 231 | ||
231 | #if defined(CONFIG_NFS_V4_1) | 232 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |
232 | /* | 233 | /* |
233 | * Backchannel flags | 234 | * Backchannel flags |
234 | */ | 235 | */ |
235 | #define RPC_BC_PA_IN_USE 0x0001 /* Preallocated backchannel */ | 236 | #define RPC_BC_PA_IN_USE 0x0001 /* Preallocated backchannel */ |
236 | /* buffer in use */ | 237 | /* buffer in use */ |
237 | #endif /* CONFIG_NFS_V4_1 */ | 238 | #endif /* CONFIG_SUNRPC_BACKCHANNEL */ |
238 | 239 | ||
239 | #if defined(CONFIG_NFS_V4_1) | 240 | #if defined(CONFIG_SUNRPC_BACKCHANNEL) |
240 | static inline int bc_prealloc(struct rpc_rqst *req) | 241 | static inline int bc_prealloc(struct rpc_rqst *req) |
241 | { | 242 | { |
242 | return test_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state); | 243 | return test_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state); |
@@ -246,7 +247,7 @@ static inline int bc_prealloc(struct rpc_rqst *req) | |||
246 | { | 247 | { |
247 | return 0; | 248 | return 0; |
248 | } | 249 | } |
249 | #endif /* CONFIG_NFS_V4_1 */ | 250 | #endif /* CONFIG_SUNRPC_BACKCHANNEL */ |
250 | 251 | ||
251 | struct xprt_create { | 252 | struct xprt_create { |
252 | int ident; /* XPRT_TRANSPORT identifier */ | 253 | int ident; /* XPRT_TRANSPORT identifier */ |
@@ -271,8 +272,8 @@ struct xprt_class { | |||
271 | struct rpc_xprt *xprt_create_transport(struct xprt_create *args); | 272 | struct rpc_xprt *xprt_create_transport(struct xprt_create *args); |
272 | void xprt_connect(struct rpc_task *task); | 273 | void xprt_connect(struct rpc_task *task); |
273 | void xprt_reserve(struct rpc_task *task); | 274 | void xprt_reserve(struct rpc_task *task); |
274 | int xprt_reserve_xprt(struct rpc_task *task); | 275 | int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task); |
275 | int xprt_reserve_xprt_cong(struct rpc_task *task); | 276 | int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); |
276 | int xprt_prepare_transmit(struct rpc_task *task); | 277 | int xprt_prepare_transmit(struct rpc_task *task); |
277 | void xprt_transmit(struct rpc_task *task); | 278 | void xprt_transmit(struct rpc_task *task); |
278 | void xprt_end_transmit(struct rpc_task *task); | 279 | void xprt_end_transmit(struct rpc_task *task); |
@@ -282,7 +283,9 @@ void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); | |||
282 | void xprt_release(struct rpc_task *task); | 283 | void xprt_release(struct rpc_task *task); |
283 | struct rpc_xprt * xprt_get(struct rpc_xprt *xprt); | 284 | struct rpc_xprt * xprt_get(struct rpc_xprt *xprt); |
284 | void xprt_put(struct rpc_xprt *xprt); | 285 | void xprt_put(struct rpc_xprt *xprt); |
285 | struct rpc_xprt * xprt_alloc(struct net *net, int size, int max_req); | 286 | struct rpc_xprt * xprt_alloc(struct net *net, size_t size, |
287 | unsigned int num_prealloc, | ||
288 | unsigned int max_req); | ||
286 | void xprt_free(struct rpc_xprt *); | 289 | void xprt_free(struct rpc_xprt *); |
287 | 290 | ||
288 | static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *p) | 291 | static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *p) |
@@ -321,7 +324,6 @@ void xprt_conditional_disconnect(struct rpc_xprt *xprt, unsigned int cookie); | |||
321 | #define XPRT_CLOSING (6) | 324 | #define XPRT_CLOSING (6) |
322 | #define XPRT_CONNECTION_ABORT (7) | 325 | #define XPRT_CONNECTION_ABORT (7) |
323 | #define XPRT_CONNECTION_CLOSE (8) | 326 | #define XPRT_CONNECTION_CLOSE (8) |
324 | #define XPRT_INITIALIZED (9) | ||
325 | 327 | ||
326 | static inline void xprt_set_connected(struct rpc_xprt *xprt) | 328 | static inline void xprt_set_connected(struct rpc_xprt *xprt) |
327 | { | 329 | { |