diff options
author | Kefu Chai <tchaikov@gmail.com> | 2018-04-21 03:28:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-21 03:28:05 +0200 |
commit | 6b83d99e09a77cf5e8d45954d04fec57b97c2b39 (patch) | |
tree | 707a1f2a16b5ea3bdfba8358bb2dd27b80df083b /src/librados | |
parent | Merge pull request #21521 from tchaikov/wip-stoll (diff) | |
parent | librados: yet another aio_operate method (diff) | |
download | ceph-6b83d99e09a77cf5e8d45954d04fec57b97c2b39.tar.xz ceph-6b83d99e09a77cf5e8d45954d04fec57b97c2b39.zip |
Merge pull request #20343 from trociny/wip-rados-ordersnap
librados: add OPERATION_ORDERSNAP flag and yet another aio_operate method
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
Diffstat (limited to 'src/librados')
-rw-r--r-- | src/librados/librados.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/librados/librados.cc b/src/librados/librados.cc index 7289a021312..77bc9ca9ad3 100644 --- a/src/librados/librados.cc +++ b/src/librados/librados.cc @@ -1502,6 +1502,8 @@ static int translate_flags(int flags) op_flags |= CEPH_OSD_FLAG_FULL_FORCE; if (flags & librados::OPERATION_IGNORE_REDIRECT) op_flags |= CEPH_OSD_FLAG_IGNORE_REDIRECT; + if (flags & librados::OPERATION_ORDERSNAP) + op_flags |= CEPH_OSD_FLAG_ORDERSNAP; return op_flags; } @@ -1564,6 +1566,21 @@ int librados::IoCtx::aio_operate(const std::string& oid, AioCompletion *c, } int librados::IoCtx::aio_operate(const std::string& oid, AioCompletion *c, + librados::ObjectWriteOperation *o, + snap_t snap_seq, std::vector<snap_t>& snaps, int flags, + const blkin_trace_info *trace_info) +{ + object_t obj(oid); + vector<snapid_t> snv; + snv.resize(snaps.size()); + for (size_t i = 0; i < snaps.size(); ++i) + snv[i] = snaps[i]; + SnapContext snapc(snap_seq, snv); + return io_ctx_impl->aio_operate(obj, &o->impl->o, c->pc, snapc, + translate_flags(flags), trace_info); +} + +int librados::IoCtx::aio_operate(const std::string& oid, AioCompletion *c, librados::ObjectReadOperation *o, bufferlist *pbl) { |