diff options
author | Sage Weil <sage@inktank.com> | 2013-09-24 12:48:07 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-09-24 12:48:07 -0700 |
commit | 3faf08f5f96ced6eecb3c2bc3a6b7bf4fc5a1b73 (patch) | |
tree | 2c7eb535bd72f6948e13647898bf1d0e3d6ff1bd | |
parent | 9322305c80e995e1c4a964edff0fc094329d951b (diff) | |
download | ceph-3faf08f5f96ced6eecb3c2bc3a6b7bf4fc5a1b73.tar.gz |
librados: add OPERATION_ORDER_READS_WRITES flag
This maps to the internal RWORDERED option, which indicates that a read
should be ordered the same way a write is.
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | src/include/rados/librados.hpp | 5 | ||||
-rw-r--r-- | src/librados/librados.cc | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/include/rados/librados.hpp b/src/include/rados/librados.hpp index 94d3d23a824..358142c8cb4 100644 --- a/src/include/rados/librados.hpp +++ b/src/include/rados/librados.hpp @@ -133,11 +133,16 @@ namespace librados * BALANCE_READS and LOCALIZE_READS should only be used * when reading from data you're certain won't change, * like a snapshot, or where eventual consistency is ok. + * + * ORDER_READS_WRITES will order reads the same way writes are + * ordered (e.g., waiting for degraded objects). In particular, it + * will make a write followed by a read sequence be preserved. */ enum ObjectOperationGlobalFlags { OPERATION_NOFLAG = 0, OPERATION_BALANCE_READS = 1, OPERATION_LOCALIZE_READS = 2, + OPERATION_ORDER_READS_WRITES = 4, }; /* diff --git a/src/librados/librados.cc b/src/librados/librados.cc index 852228ed383..63092d1093d 100644 --- a/src/librados/librados.cc +++ b/src/librados/librados.cc @@ -958,6 +958,8 @@ int librados::IoCtx::aio_operate(const std::string& oid, AioCompletion *c, op_flags |= CEPH_OSD_FLAG_BALANCE_READS; if (flags & OPERATION_LOCALIZE_READS) op_flags |= CEPH_OSD_FLAG_LOCALIZE_READS; + if (flags & OPERATION_ORDER_READS_WRITES) + op_flags |= CEPH_OSD_FLAG_RWORDERED; return io_ctx_impl->aio_operate_read(obj, (::ObjectOperation*)o->impl, c->pc, op_flags, pbl); |