]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/include/rbd/librbd.hpp
import ceph quincy 17.2.6
[ceph.git] / ceph / src / include / rbd / librbd.hpp
index f1ddc2965e5451143fd09d8097481af519413ed3..669f17a2cf50aff91103163db38959abc96d460f 100644 (file)
@@ -710,6 +710,27 @@ public:
   ssize_t writesame(uint64_t ofs, size_t len, ceph::bufferlist &bl, int op_flags);
   ssize_t write_zeroes(uint64_t ofs, size_t len, int zero_flags, int op_flags);
 
+  /**
+   * compare and write from/to image
+   *
+   * Compare data in compare bufferlist to data at offset in image.
+   * len bytes of the compare bufferlist are compared, i.e. the compare
+   * bufferlist has to be at least len bytes long.
+   * If the compare is successful len bytes from the write bufferlist
+   * are written to the image, i.e. the write bufferlist also has to be
+   * at least len bytes long.
+   * If the compare is unsuccessful no data is written and the
+   * offset in the bufferlist where the compare first differed
+   * is returned through mismatch_off.
+   *
+   * @param off offset in image
+   * @param len length of compare, length of write
+   * @param cmp_bl bufferlist to compare from
+   * @param bl bufferlist to write to image if compare succeeds
+   * @param c aio completion to notify when compare and write is complete
+   * @param mismatch_off (out) offset in bufferlist where compare first differed
+   * @param op_flags see librados.h constants beginning with LIBRADOS_OP_FLAG
+   */
   ssize_t compare_and_write(uint64_t ofs, size_t len, ceph::bufferlist &cmp_bl,
                             ceph::bufferlist& bl, uint64_t *mismatch_off, int op_flags);