diff options
Diffstat (limited to 'include/linux/ceph/osd_client.h')
-rw-r--r-- | include/linux/ceph/osd_client.h | 74 |
1 files changed, 38 insertions, 36 deletions
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h index d9b880e977e6..1dd5d466b6f9 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/ceph/osdmap.h> | 10 | #include <linux/ceph/osdmap.h> |
11 | #include <linux/ceph/messenger.h> | 11 | #include <linux/ceph/messenger.h> |
12 | #include <linux/ceph/auth.h> | 12 | #include <linux/ceph/auth.h> |
13 | #include <linux/ceph/pagelist.h> | ||
13 | 14 | ||
14 | /* | 15 | /* |
15 | * Maximum object name size | 16 | * Maximum object name size |
@@ -22,7 +23,6 @@ struct ceph_snap_context; | |||
22 | struct ceph_osd_request; | 23 | struct ceph_osd_request; |
23 | struct ceph_osd_client; | 24 | struct ceph_osd_client; |
24 | struct ceph_authorizer; | 25 | struct ceph_authorizer; |
25 | struct ceph_pagelist; | ||
26 | 26 | ||
27 | /* | 27 | /* |
28 | * completion callback for async writepages | 28 | * completion callback for async writepages |
@@ -47,6 +47,9 @@ struct ceph_osd { | |||
47 | struct list_head o_keepalive_item; | 47 | struct list_head o_keepalive_item; |
48 | }; | 48 | }; |
49 | 49 | ||
50 | |||
51 | #define CEPH_OSD_MAX_OP 10 | ||
52 | |||
50 | /* an in-flight request */ | 53 | /* an in-flight request */ |
51 | struct ceph_osd_request { | 54 | struct ceph_osd_request { |
52 | u64 r_tid; /* unique for this client */ | 55 | u64 r_tid; /* unique for this client */ |
@@ -63,9 +66,23 @@ struct ceph_osd_request { | |||
63 | struct ceph_connection *r_con_filling_msg; | 66 | struct ceph_connection *r_con_filling_msg; |
64 | 67 | ||
65 | struct ceph_msg *r_request, *r_reply; | 68 | struct ceph_msg *r_request, *r_reply; |
66 | int r_result; | ||
67 | int r_flags; /* any additional flags for the osd */ | 69 | int r_flags; /* any additional flags for the osd */ |
68 | u32 r_sent; /* >0 if r_request is sending/sent */ | 70 | u32 r_sent; /* >0 if r_request is sending/sent */ |
71 | int r_num_ops; | ||
72 | |||
73 | /* encoded message content */ | ||
74 | struct ceph_osd_op *r_request_ops; | ||
75 | /* these are updated on each send */ | ||
76 | __le32 *r_request_osdmap_epoch; | ||
77 | __le32 *r_request_flags; | ||
78 | __le64 *r_request_pool; | ||
79 | void *r_request_pgid; | ||
80 | __le32 *r_request_attempts; | ||
81 | struct ceph_eversion *r_request_reassert_version; | ||
82 | |||
83 | int r_result; | ||
84 | int r_reply_op_len[CEPH_OSD_MAX_OP]; | ||
85 | s32 r_reply_op_result[CEPH_OSD_MAX_OP]; | ||
69 | int r_got_reply; | 86 | int r_got_reply; |
70 | int r_linger; | 87 | int r_linger; |
71 | 88 | ||
@@ -82,6 +99,7 @@ struct ceph_osd_request { | |||
82 | 99 | ||
83 | char r_oid[MAX_OBJ_NAME_SIZE]; /* object name */ | 100 | char r_oid[MAX_OBJ_NAME_SIZE]; /* object name */ |
84 | int r_oid_len; | 101 | int r_oid_len; |
102 | u64 r_snapid; | ||
85 | unsigned long r_stamp; /* send OR check time */ | 103 | unsigned long r_stamp; /* send OR check time */ |
86 | 104 | ||
87 | struct ceph_file_layout r_file_layout; | 105 | struct ceph_file_layout r_file_layout; |
@@ -95,7 +113,7 @@ struct ceph_osd_request { | |||
95 | struct bio *r_bio; /* instead of pages */ | 113 | struct bio *r_bio; /* instead of pages */ |
96 | #endif | 114 | #endif |
97 | 115 | ||
98 | struct ceph_pagelist *r_trail; /* trailing part of the data */ | 116 | struct ceph_pagelist r_trail; /* trailing part of the data */ |
99 | }; | 117 | }; |
100 | 118 | ||
101 | struct ceph_osd_event { | 119 | struct ceph_osd_event { |
@@ -107,7 +125,6 @@ struct ceph_osd_event { | |||
107 | struct rb_node node; | 125 | struct rb_node node; |
108 | struct list_head osd_node; | 126 | struct list_head osd_node; |
109 | struct kref kref; | 127 | struct kref kref; |
110 | struct completion completion; | ||
111 | }; | 128 | }; |
112 | 129 | ||
113 | struct ceph_osd_event_work { | 130 | struct ceph_osd_event_work { |
@@ -157,7 +174,7 @@ struct ceph_osd_client { | |||
157 | 174 | ||
158 | struct ceph_osd_req_op { | 175 | struct ceph_osd_req_op { |
159 | u16 op; /* CEPH_OSD_OP_* */ | 176 | u16 op; /* CEPH_OSD_OP_* */ |
160 | u32 flags; /* CEPH_OSD_FLAG_* */ | 177 | u32 payload_len; |
161 | union { | 178 | union { |
162 | struct { | 179 | struct { |
163 | u64 offset, length; | 180 | u64 offset, length; |
@@ -166,23 +183,24 @@ struct ceph_osd_req_op { | |||
166 | } extent; | 183 | } extent; |
167 | struct { | 184 | struct { |
168 | const char *name; | 185 | const char *name; |
169 | u32 name_len; | ||
170 | const char *val; | 186 | const char *val; |
187 | u32 name_len; | ||
171 | u32 value_len; | 188 | u32 value_len; |
172 | __u8 cmp_op; /* CEPH_OSD_CMPXATTR_OP_* */ | 189 | __u8 cmp_op; /* CEPH_OSD_CMPXATTR_OP_* */ |
173 | __u8 cmp_mode; /* CEPH_OSD_CMPXATTR_MODE_* */ | 190 | __u8 cmp_mode; /* CEPH_OSD_CMPXATTR_MODE_* */ |
174 | } xattr; | 191 | } xattr; |
175 | struct { | 192 | struct { |
176 | const char *class_name; | 193 | const char *class_name; |
177 | __u8 class_len; | ||
178 | const char *method_name; | 194 | const char *method_name; |
179 | __u8 method_len; | ||
180 | __u8 argc; | ||
181 | const char *indata; | 195 | const char *indata; |
182 | u32 indata_len; | 196 | u32 indata_len; |
197 | __u8 class_len; | ||
198 | __u8 method_len; | ||
199 | __u8 argc; | ||
183 | } cls; | 200 | } cls; |
184 | struct { | 201 | struct { |
185 | u64 cookie, count; | 202 | u64 cookie; |
203 | u64 count; | ||
186 | } pgls; | 204 | } pgls; |
187 | struct { | 205 | struct { |
188 | u64 snapid; | 206 | u64 snapid; |
@@ -190,12 +208,11 @@ struct ceph_osd_req_op { | |||
190 | struct { | 208 | struct { |
191 | u64 cookie; | 209 | u64 cookie; |
192 | u64 ver; | 210 | u64 ver; |
193 | __u8 flag; | ||
194 | u32 prot_ver; | 211 | u32 prot_ver; |
195 | u32 timeout; | 212 | u32 timeout; |
213 | __u8 flag; | ||
196 | } watch; | 214 | } watch; |
197 | }; | 215 | }; |
198 | u32 payload_len; | ||
199 | }; | 216 | }; |
200 | 217 | ||
201 | extern int ceph_osdc_init(struct ceph_osd_client *osdc, | 218 | extern int ceph_osdc_init(struct ceph_osd_client *osdc, |
@@ -207,29 +224,19 @@ extern void ceph_osdc_handle_reply(struct ceph_osd_client *osdc, | |||
207 | extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc, | 224 | extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc, |
208 | struct ceph_msg *msg); | 225 | struct ceph_msg *msg); |
209 | 226 | ||
210 | extern int ceph_calc_raw_layout(struct ceph_osd_client *osdc, | ||
211 | struct ceph_file_layout *layout, | ||
212 | u64 snapid, | ||
213 | u64 off, u64 *plen, u64 *bno, | ||
214 | struct ceph_osd_request *req, | ||
215 | struct ceph_osd_req_op *op); | ||
216 | |||
217 | extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc, | 227 | extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc, |
218 | int flags, | ||
219 | struct ceph_snap_context *snapc, | 228 | struct ceph_snap_context *snapc, |
220 | struct ceph_osd_req_op *ops, | 229 | unsigned int num_op, |
221 | bool use_mempool, | 230 | bool use_mempool, |
222 | gfp_t gfp_flags, | 231 | gfp_t gfp_flags); |
223 | struct page **pages, | ||
224 | struct bio *bio); | ||
225 | 232 | ||
226 | extern void ceph_osdc_build_request(struct ceph_osd_request *req, | 233 | extern void ceph_osdc_build_request(struct ceph_osd_request *req, |
227 | u64 off, u64 *plen, | 234 | u64 off, u64 len, |
235 | unsigned int num_op, | ||
228 | struct ceph_osd_req_op *src_ops, | 236 | struct ceph_osd_req_op *src_ops, |
229 | struct ceph_snap_context *snapc, | 237 | struct ceph_snap_context *snapc, |
230 | struct timespec *mtime, | 238 | u64 snap_id, |
231 | const char *oid, | 239 | struct timespec *mtime); |
232 | int oid_len); | ||
233 | 240 | ||
234 | extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *, | 241 | extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *, |
235 | struct ceph_file_layout *layout, | 242 | struct ceph_file_layout *layout, |
@@ -239,8 +246,7 @@ extern struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *, | |||
239 | int do_sync, u32 truncate_seq, | 246 | int do_sync, u32 truncate_seq, |
240 | u64 truncate_size, | 247 | u64 truncate_size, |
241 | struct timespec *mtime, | 248 | struct timespec *mtime, |
242 | bool use_mempool, int num_reply, | 249 | bool use_mempool, int page_align); |
243 | int page_align); | ||
244 | 250 | ||
245 | extern void ceph_osdc_set_request_linger(struct ceph_osd_client *osdc, | 251 | extern void ceph_osdc_set_request_linger(struct ceph_osd_client *osdc, |
246 | struct ceph_osd_request *req); | 252 | struct ceph_osd_request *req); |
@@ -279,17 +285,13 @@ extern int ceph_osdc_writepages(struct ceph_osd_client *osdc, | |||
279 | u64 off, u64 len, | 285 | u64 off, u64 len, |
280 | u32 truncate_seq, u64 truncate_size, | 286 | u32 truncate_seq, u64 truncate_size, |
281 | struct timespec *mtime, | 287 | struct timespec *mtime, |
282 | struct page **pages, int nr_pages, | 288 | struct page **pages, int nr_pages); |
283 | int flags, int do_sync, bool nofail); | ||
284 | 289 | ||
285 | /* watch/notify events */ | 290 | /* watch/notify events */ |
286 | extern int ceph_osdc_create_event(struct ceph_osd_client *osdc, | 291 | extern int ceph_osdc_create_event(struct ceph_osd_client *osdc, |
287 | void (*event_cb)(u64, u64, u8, void *), | 292 | void (*event_cb)(u64, u64, u8, void *), |
288 | int one_shot, void *data, | 293 | void *data, struct ceph_osd_event **pevent); |
289 | struct ceph_osd_event **pevent); | ||
290 | extern void ceph_osdc_cancel_event(struct ceph_osd_event *event); | 294 | extern void ceph_osdc_cancel_event(struct ceph_osd_event *event); |
291 | extern int ceph_osdc_wait_event(struct ceph_osd_event *event, | ||
292 | unsigned long timeout); | ||
293 | extern void ceph_osdc_put_event(struct ceph_osd_event *event); | 295 | extern void ceph_osdc_put_event(struct ceph_osd_event *event); |
294 | #endif | 296 | #endif |
295 | 297 | ||