libceph: support the RADOS copy-from operation
[sfrench/cifs-2.6.git] / include / linux / ceph / osd_client.h
index 02096da01845c992d5b8217a9291337fed3ff6cd..7a2af5034278f1d4f868a2617e615d1d0eb71d4f 100644 (file)
@@ -136,6 +136,13 @@ struct ceph_osd_req_op {
                        u64 expected_object_size;
                        u64 expected_write_size;
                } alloc_hint;
+               struct {
+                       u64 snapid;
+                       u64 src_version;
+                       u8 flags;
+                       u32 src_fadvise_flags;
+                       struct ceph_osd_data osd_data;
+               } copy_from;
        };
 };
 
@@ -444,9 +451,8 @@ extern void osd_req_op_cls_response_data_pages(struct ceph_osd_request *,
                                        struct page **pages, u64 length,
                                        u32 alignment, bool pages_from_pool,
                                        bool own_pages);
-extern int osd_req_op_cls_init(struct ceph_osd_request *osd_req,
-                                       unsigned int which, u16 opcode,
-                                       const char *class, const char *method);
+int osd_req_op_cls_init(struct ceph_osd_request *osd_req, unsigned int which,
+                       const char *class, const char *method);
 extern int osd_req_op_xattr_init(struct ceph_osd_request *osd_req, unsigned int which,
                                 u16 opcode, const char *name, const void *value,
                                 size_t size, u8 cmp_op, u8 cmp_mode);
@@ -511,6 +517,16 @@ extern int ceph_osdc_writepages(struct ceph_osd_client *osdc,
                                struct timespec64 *mtime,
                                struct page **pages, int nr_pages);
 
+int ceph_osdc_copy_from(struct ceph_osd_client *osdc,
+                       u64 src_snapid, u64 src_version,
+                       struct ceph_object_id *src_oid,
+                       struct ceph_object_locator *src_oloc,
+                       u32 src_fadvise_flags,
+                       struct ceph_object_id *dst_oid,
+                       struct ceph_object_locator *dst_oloc,
+                       u32 dst_fadvise_flags,
+                       u8 copy_from_flags);
+
 /* watch/notify */
 struct ceph_osd_linger_request *
 ceph_osdc_watch(struct ceph_osd_client *osdc,