hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/include/linux/ceph/osd_client.h
....@@ -8,6 +8,7 @@
88 #include <linux/mempool.h>
99 #include <linux/rbtree.h>
1010 #include <linux/refcount.h>
11
+#include <linux/ktime.h>
1112
1213 #include <linux/ceph/types.h>
1314 #include <linux/ceph/osdmap.h>
....@@ -135,7 +136,15 @@
135136 struct {
136137 u64 expected_object_size;
137138 u64 expected_write_size;
139
+ u32 flags; /* CEPH_OSD_OP_ALLOC_HINT_FLAG_* */
138140 } 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;
139148 };
140149 };
141150
....@@ -157,6 +166,7 @@
157166 bool recovery_deletes;
158167
159168 unsigned int flags; /* CEPH_OSD_FLAG_* */
169
+ bool used_replica;
160170 bool paused;
161171
162172 u32 epoch;
....@@ -191,9 +201,9 @@
191201 bool r_mempool;
192202 struct completion r_completion; /* private to osd_client.c */
193203 ceph_osdc_callback_t r_callback;
194
- struct list_head r_unsafe_item;
195204
196205 struct inode *r_inode; /* for use by callbacks */
206
+ struct list_head r_private_item; /* ditto */
197207 void *r_priv; /* ditto */
198208
199209 /* set by submitter */
....@@ -206,6 +216,8 @@
206216 /* internal */
207217 unsigned long r_stamp; /* jiffies, send or check time */
208218 unsigned long r_start_stamp; /* jiffies */
219
+ ktime_t r_start_latency; /* ktime_t */
220
+ ktime_t r_end_latency; /* ktime_t */
209221 int r_attempts;
210222 u32 r_map_dne_bound;
211223
....@@ -274,6 +286,9 @@
274286 rados_watchcb2_t wcb;
275287 rados_watcherrcb_t errcb;
276288 void *data;
289
+
290
+ struct ceph_pagelist *request_pl;
291
+ struct page **notify_id_pages;
277292
278293 struct page ***preply_pages;
279294 size_t *preply_len;
....@@ -347,7 +362,6 @@
347362 struct rb_root linger_map_checks;
348363 atomic_t num_requests;
349364 atomic_t num_homeless;
350
- bool abort_on_full; /* abort w/ ENOSPC when full */
351365 int abort_err;
352366 struct delayed_work timeout_work;
353367 struct delayed_work osds_timeout_work;
....@@ -375,6 +389,7 @@
375389 extern int ceph_osdc_init(struct ceph_osd_client *osdc,
376390 struct ceph_client *client);
377391 extern void ceph_osdc_stop(struct ceph_osd_client *osdc);
392
+extern void ceph_osdc_reopen_osds(struct ceph_osd_client *osdc);
378393
379394 extern void ceph_osdc_handle_reply(struct ceph_osd_client *osdc,
380395 struct ceph_msg *msg);
....@@ -382,8 +397,17 @@
382397 struct ceph_msg *msg);
383398 void ceph_osdc_update_epoch_barrier(struct ceph_osd_client *osdc, u32 eb);
384399 void ceph_osdc_abort_requests(struct ceph_osd_client *osdc, int err);
400
+void ceph_osdc_clear_abort_err(struct ceph_osd_client *osdc);
385401
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,
387411 unsigned int which, u16 opcode, u32 flags);
388412
389413 extern void osd_req_op_raw_data_in_pages(struct ceph_osd_request *,
....@@ -444,16 +468,16 @@
444468 struct page **pages, u64 length,
445469 u32 alignment, bool pages_from_pool,
446470 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);
450473 extern int osd_req_op_xattr_init(struct ceph_osd_request *osd_req, unsigned int which,
451474 u16 opcode, const char *name, const void *value,
452475 size_t size, u8 cmp_op, u8 cmp_mode);
453476 extern void osd_req_op_alloc_hint_init(struct ceph_osd_request *osd_req,
454477 unsigned int which,
455478 u64 expected_object_size,
456
- u64 expected_write_size);
479
+ u64 expected_write_size,
480
+ u32 flags);
457481
458482 extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc,
459483 struct ceph_snap_context *snapc,
....@@ -492,24 +516,18 @@
492516 const char *class, const char *method,
493517 unsigned int flags,
494518 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);
496520
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);
513531
514532 /* watch/notify */
515533 struct ceph_osd_linger_request *