summaryrefslogtreecommitdiffstats
path: root/src/osdc
diff options
context:
space:
mode:
authorJason Dillaman <dillaman@redhat.com>2017-03-30 19:53:28 +0200
committerJason Dillaman <dillaman@redhat.com>2017-04-18 04:54:27 +0200
commitfcb42c7076c40f68835e503b063ab872d59a8a14 (patch)
treeabe6e8c61867a0cb5f638039a994a0c70351a83d /src/osdc
parentosd: new op for retrieving an extent checksum (diff)
downloadceph-fcb42c7076c40f68835e503b063ab872d59a8a14.tar.xz
ceph-fcb42c7076c40f68835e503b063ab872d59a8a14.zip
librados: expose new checksum osd operation
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Diffstat (limited to 'src/osdc')
-rw-r--r--src/osdc/Objecter.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h
index 19efc500685..3ce5e256c24 100644
--- a/src/osdc/Objecter.h
+++ b/src/osdc/Objecter.h
@@ -367,6 +367,22 @@ struct ObjectOperation {
add_data(CEPH_OSD_OP_SPARSE_READ, off, len, bl);
}
+ void checksum(uint8_t type, const bufferlist &init_value_bl,
+ uint64_t off, uint64_t len, size_t chunk_size,
+ bufferlist *pbl, int *prval, Context *ctx) {
+ OSDOp& osd_op = add_op(CEPH_OSD_OP_CHECKSUM);
+ osd_op.op.checksum.offset = off;
+ osd_op.op.checksum.length = len;
+ osd_op.op.checksum.type = type;
+ osd_op.op.checksum.chunk_size = chunk_size;
+ osd_op.indata.append(init_value_bl);
+
+ unsigned p = ops.size() - 1;
+ out_bl[p] = pbl;
+ out_rval[p] = prval;
+ out_handler[p] = ctx;
+ }
+
// object attrs
void getxattr(const char *name, bufferlist *pbl, int *prval) {
bufferlist bl;