.. | .. |
---|
8 | 8 | #include <linux/mempool.h> |
---|
9 | 9 | #include <linux/rbtree.h> |
---|
10 | 10 | #include <linux/refcount.h> |
---|
| 11 | +#include <linux/ktime.h> |
---|
11 | 12 | |
---|
12 | 13 | #include <linux/ceph/types.h> |
---|
13 | 14 | #include <linux/ceph/osdmap.h> |
---|
.. | .. |
---|
135 | 136 | struct { |
---|
136 | 137 | u64 expected_object_size; |
---|
137 | 138 | u64 expected_write_size; |
---|
| 139 | + u32 flags; /* CEPH_OSD_OP_ALLOC_HINT_FLAG_* */ |
---|
138 | 140 | } alloc_hint; |
---|
| 141 | + struct { |
---|
| 142 | + u64 snapid; |
---|
| 143 | + u64 src_version; |
---|
| 144 | + u8 flags; |
---|
| 145 | + u32 src_fadvise_flags; |
---|
| 146 | + struct ceph_osd_data osd_data; |
---|
| 147 | + } copy_from; |
---|
139 | 148 | }; |
---|
140 | 149 | }; |
---|
141 | 150 | |
---|
.. | .. |
---|
157 | 166 | bool recovery_deletes; |
---|
158 | 167 | |
---|
159 | 168 | unsigned int flags; /* CEPH_OSD_FLAG_* */ |
---|
| 169 | + bool used_replica; |
---|
160 | 170 | bool paused; |
---|
161 | 171 | |
---|
162 | 172 | u32 epoch; |
---|
.. | .. |
---|
191 | 201 | bool r_mempool; |
---|
192 | 202 | struct completion r_completion; /* private to osd_client.c */ |
---|
193 | 203 | ceph_osdc_callback_t r_callback; |
---|
194 | | - struct list_head r_unsafe_item; |
---|
195 | 204 | |
---|
196 | 205 | struct inode *r_inode; /* for use by callbacks */ |
---|
| 206 | + struct list_head r_private_item; /* ditto */ |
---|
197 | 207 | void *r_priv; /* ditto */ |
---|
198 | 208 | |
---|
199 | 209 | /* set by submitter */ |
---|
.. | .. |
---|
206 | 216 | /* internal */ |
---|
207 | 217 | unsigned long r_stamp; /* jiffies, send or check time */ |
---|
208 | 218 | unsigned long r_start_stamp; /* jiffies */ |
---|
| 219 | + ktime_t r_start_latency; /* ktime_t */ |
---|
| 220 | + ktime_t r_end_latency; /* ktime_t */ |
---|
209 | 221 | int r_attempts; |
---|
210 | 222 | u32 r_map_dne_bound; |
---|
211 | 223 | |
---|
.. | .. |
---|
274 | 286 | rados_watchcb2_t wcb; |
---|
275 | 287 | rados_watcherrcb_t errcb; |
---|
276 | 288 | void *data; |
---|
| 289 | + |
---|
| 290 | + struct ceph_pagelist *request_pl; |
---|
| 291 | + struct page **notify_id_pages; |
---|
277 | 292 | |
---|
278 | 293 | struct page ***preply_pages; |
---|
279 | 294 | size_t *preply_len; |
---|
.. | .. |
---|
347 | 362 | struct rb_root linger_map_checks; |
---|
348 | 363 | atomic_t num_requests; |
---|
349 | 364 | atomic_t num_homeless; |
---|
350 | | - bool abort_on_full; /* abort w/ ENOSPC when full */ |
---|
351 | 365 | int abort_err; |
---|
352 | 366 | struct delayed_work timeout_work; |
---|
353 | 367 | struct delayed_work osds_timeout_work; |
---|
.. | .. |
---|
375 | 389 | extern int ceph_osdc_init(struct ceph_osd_client *osdc, |
---|
376 | 390 | struct ceph_client *client); |
---|
377 | 391 | extern void ceph_osdc_stop(struct ceph_osd_client *osdc); |
---|
| 392 | +extern void ceph_osdc_reopen_osds(struct ceph_osd_client *osdc); |
---|
378 | 393 | |
---|
379 | 394 | extern void ceph_osdc_handle_reply(struct ceph_osd_client *osdc, |
---|
380 | 395 | struct ceph_msg *msg); |
---|
.. | .. |
---|
382 | 397 | struct ceph_msg *msg); |
---|
383 | 398 | void ceph_osdc_update_epoch_barrier(struct ceph_osd_client *osdc, u32 eb); |
---|
384 | 399 | void ceph_osdc_abort_requests(struct ceph_osd_client *osdc, int err); |
---|
| 400 | +void ceph_osdc_clear_abort_err(struct ceph_osd_client *osdc); |
---|
385 | 401 | |
---|
386 | | -extern void osd_req_op_init(struct ceph_osd_request *osd_req, |
---|
| 402 | +#define osd_req_op_data(oreq, whch, typ, fld) \ |
---|
| 403 | +({ \ |
---|
| 404 | + struct ceph_osd_request *__oreq = (oreq); \ |
---|
| 405 | + unsigned int __whch = (whch); \ |
---|
| 406 | + BUG_ON(__whch >= __oreq->r_num_ops); \ |
---|
| 407 | + &__oreq->r_ops[__whch].typ.fld; \ |
---|
| 408 | +}) |
---|
| 409 | + |
---|
| 410 | +struct ceph_osd_req_op *osd_req_op_init(struct ceph_osd_request *osd_req, |
---|
387 | 411 | unsigned int which, u16 opcode, u32 flags); |
---|
388 | 412 | |
---|
389 | 413 | extern void osd_req_op_raw_data_in_pages(struct ceph_osd_request *, |
---|
.. | .. |
---|
444 | 468 | struct page **pages, u64 length, |
---|
445 | 469 | u32 alignment, bool pages_from_pool, |
---|
446 | 470 | bool own_pages); |
---|
447 | | -extern int osd_req_op_cls_init(struct ceph_osd_request *osd_req, |
---|
448 | | - unsigned int which, u16 opcode, |
---|
449 | | - const char *class, const char *method); |
---|
| 471 | +int osd_req_op_cls_init(struct ceph_osd_request *osd_req, unsigned int which, |
---|
| 472 | + const char *class, const char *method); |
---|
450 | 473 | extern int osd_req_op_xattr_init(struct ceph_osd_request *osd_req, unsigned int which, |
---|
451 | 474 | u16 opcode, const char *name, const void *value, |
---|
452 | 475 | size_t size, u8 cmp_op, u8 cmp_mode); |
---|
453 | 476 | extern void osd_req_op_alloc_hint_init(struct ceph_osd_request *osd_req, |
---|
454 | 477 | unsigned int which, |
---|
455 | 478 | u64 expected_object_size, |
---|
456 | | - u64 expected_write_size); |
---|
| 479 | + u64 expected_write_size, |
---|
| 480 | + u32 flags); |
---|
457 | 481 | |
---|
458 | 482 | extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc, |
---|
459 | 483 | struct ceph_snap_context *snapc, |
---|
.. | .. |
---|
492 | 516 | const char *class, const char *method, |
---|
493 | 517 | unsigned int flags, |
---|
494 | 518 | struct page *req_page, size_t req_len, |
---|
495 | | - struct page *resp_page, size_t *resp_len); |
---|
| 519 | + struct page **resp_pages, size_t *resp_len); |
---|
496 | 520 | |
---|
497 | | -extern int ceph_osdc_readpages(struct ceph_osd_client *osdc, |
---|
498 | | - struct ceph_vino vino, |
---|
499 | | - struct ceph_file_layout *layout, |
---|
500 | | - u64 off, u64 *plen, |
---|
501 | | - u32 truncate_seq, u64 truncate_size, |
---|
502 | | - struct page **pages, int nr_pages, |
---|
503 | | - int page_align); |
---|
504 | | - |
---|
505 | | -extern int ceph_osdc_writepages(struct ceph_osd_client *osdc, |
---|
506 | | - struct ceph_vino vino, |
---|
507 | | - struct ceph_file_layout *layout, |
---|
508 | | - struct ceph_snap_context *sc, |
---|
509 | | - u64 off, u64 len, |
---|
510 | | - u32 truncate_seq, u64 truncate_size, |
---|
511 | | - struct timespec64 *mtime, |
---|
512 | | - struct page **pages, int nr_pages); |
---|
| 521 | +int ceph_osdc_copy_from(struct ceph_osd_client *osdc, |
---|
| 522 | + u64 src_snapid, u64 src_version, |
---|
| 523 | + struct ceph_object_id *src_oid, |
---|
| 524 | + struct ceph_object_locator *src_oloc, |
---|
| 525 | + u32 src_fadvise_flags, |
---|
| 526 | + struct ceph_object_id *dst_oid, |
---|
| 527 | + struct ceph_object_locator *dst_oloc, |
---|
| 528 | + u32 dst_fadvise_flags, |
---|
| 529 | + u32 truncate_seq, u64 truncate_size, |
---|
| 530 | + u8 copy_from_flags); |
---|
513 | 531 | |
---|
514 | 532 | /* watch/notify */ |
---|
515 | 533 | struct ceph_osd_linger_request * |
---|