diff options
Diffstat (limited to 'include/linux/ceph/osd_client.h')
-rw-r--r-- | include/linux/ceph/osd_client.h | 70 |
1 files changed, 34 insertions, 36 deletions
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h index af60dac1f9c0..f4c1a2a22a14 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h | |||
@@ -48,7 +48,7 @@ struct ceph_osd { | |||
48 | }; | 48 | }; |
49 | 49 | ||
50 | 50 | ||
51 | #define CEPH_OSD_MAX_OP 10 | 51 | #define CEPH_OSD_MAX_OP 2 |
52 | 52 | ||
53 | enum ceph_osd_data_type { | 53 | enum ceph_osd_data_type { |
54 | CEPH_OSD_DATA_TYPE_NONE, | 54 | CEPH_OSD_DATA_TYPE_NONE, |
@@ -79,6 +79,34 @@ struct ceph_osd_data { | |||
79 | }; | 79 | }; |
80 | }; | 80 | }; |
81 | 81 | ||
82 | struct ceph_osd_req_op { | ||
83 | u16 op; /* CEPH_OSD_OP_* */ | ||
84 | u32 payload_len; | ||
85 | union { | ||
86 | struct { | ||
87 | u64 offset, length; | ||
88 | u64 truncate_size; | ||
89 | u32 truncate_seq; | ||
90 | } extent; | ||
91 | struct { | ||
92 | const char *class_name; | ||
93 | const char *method_name; | ||
94 | const void *indata; | ||
95 | u32 indata_len; | ||
96 | __u8 class_len; | ||
97 | __u8 method_len; | ||
98 | __u8 argc; | ||
99 | } cls; | ||
100 | struct { | ||
101 | u64 cookie; | ||
102 | u64 ver; | ||
103 | u32 prot_ver; | ||
104 | u32 timeout; | ||
105 | __u8 flag; | ||
106 | } watch; | ||
107 | }; | ||
108 | }; | ||
109 | |||
82 | /* an in-flight request */ | 110 | /* an in-flight request */ |
83 | struct ceph_osd_request { | 111 | struct ceph_osd_request { |
84 | u64 r_tid; /* unique for this client */ | 112 | u64 r_tid; /* unique for this client */ |
@@ -95,10 +123,11 @@ struct ceph_osd_request { | |||
95 | struct ceph_msg *r_request, *r_reply; | 123 | struct ceph_msg *r_request, *r_reply; |
96 | int r_flags; /* any additional flags for the osd */ | 124 | int r_flags; /* any additional flags for the osd */ |
97 | u32 r_sent; /* >0 if r_request is sending/sent */ | 125 | u32 r_sent; /* >0 if r_request is sending/sent */ |
98 | int r_num_ops; | ||
99 | 126 | ||
100 | /* encoded message content */ | 127 | /* request osd ops array */ |
101 | struct ceph_osd_op *r_request_ops; | 128 | unsigned int r_num_ops; |
129 | struct ceph_osd_req_op r_ops[CEPH_OSD_MAX_OP]; | ||
130 | |||
102 | /* these are updated on each send */ | 131 | /* these are updated on each send */ |
103 | __le32 *r_request_osdmap_epoch; | 132 | __le32 *r_request_osdmap_epoch; |
104 | __le32 *r_request_flags; | 133 | __le32 *r_request_flags; |
@@ -193,34 +222,6 @@ struct ceph_osd_client { | |||
193 | struct workqueue_struct *notify_wq; | 222 | struct workqueue_struct *notify_wq; |
194 | }; | 223 | }; |
195 | 224 | ||
196 | struct ceph_osd_req_op { | ||
197 | u16 op; /* CEPH_OSD_OP_* */ | ||
198 | u32 payload_len; | ||
199 | union { | ||
200 | struct { | ||
201 | u64 offset, length; | ||
202 | u64 truncate_size; | ||
203 | u32 truncate_seq; | ||
204 | } extent; | ||
205 | struct { | ||
206 | const char *class_name; | ||
207 | const char *method_name; | ||
208 | const void *indata; | ||
209 | u32 indata_len; | ||
210 | __u8 class_len; | ||
211 | __u8 method_len; | ||
212 | __u8 argc; | ||
213 | } cls; | ||
214 | struct { | ||
215 | u64 cookie; | ||
216 | u64 ver; | ||
217 | u32 prot_ver; | ||
218 | u32 timeout; | ||
219 | __u8 flag; | ||
220 | } watch; | ||
221 | }; | ||
222 | }; | ||
223 | |||
224 | extern int ceph_osdc_init(struct ceph_osd_client *osdc, | 225 | extern int ceph_osdc_init(struct ceph_osd_client *osdc, |
225 | struct ceph_client *client); | 226 | struct ceph_client *client); |
226 | extern void ceph_osdc_stop(struct ceph_osd_client *osdc); | 227 | extern void ceph_osdc_stop(struct ceph_osd_client *osdc); |
@@ -249,8 +250,6 @@ extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client * | |||
249 | gfp_t gfp_flags); | 250 | gfp_t gfp_flags); |
250 | 251 | ||
251 | extern void ceph_osdc_build_request(struct ceph_osd_request *req, u64 off, | 252 | extern void ceph_osdc_build_request(struct ceph_osd_request *req, u64 off, |
252 | unsigned int num_ops, | ||
253 | struct ceph_osd_req_op *src_ops, | ||
254 | struct ceph_snap_context *snapc, | 253 | struct ceph_snap_context *snapc, |
255 | u64 snap_id, | 254 | u64 snap_id, |
256 | struct timespec *mtime); | 255 | struct timespec *mtime); |
@@ -259,8 +258,7 @@ extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *, | |||
259 | struct ceph_file_layout *layout, | 258 | struct ceph_file_layout *layout, |
260 | struct ceph_vino vino, | 259 | struct ceph_vino vino, |
261 | u64 offset, u64 *len, | 260 | u64 offset, u64 *len, |
262 | int num_ops, struct ceph_osd_req_op *ops, | 261 | int num_ops, int opcode, int flags, |
263 | int opcode, int flags, | ||
264 | struct ceph_snap_context *snapc, | 262 | struct ceph_snap_context *snapc, |
265 | u32 truncate_seq, u64 truncate_size, | 263 | u32 truncate_seq, u64 truncate_size, |
266 | bool use_mempool); | 264 | bool use_mempool); |