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);