summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Watkins <noahwatkins@gmail.com>2013-07-20 18:41:41 -0700
committerNoah Watkins <noahwatkins@gmail.com>2013-09-17 10:41:18 -0700
commit88cf1e7760d392e6f1710744e6fc6c0bbf91a279 (patch)
treeaff4bd7683b2dbf620b2af7ede4eb9678a9ffa68
parenta67404e96a8aa959b34ffe0879a1a8267c12b475 (diff)
downloadceph-88cf1e7760d392e6f1710744e6fc6c0bbf91a279.tar.gz
kvstore: use a standard errno value
Some of the high numbered errno.h values are only available on Linux. I couldn't find any users in the tree that would be effected by this change, and it wasn't clear if the value would collide with other errors or be leaked out to a client. Are there any users of this library? Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
-rw-r--r--src/key_value_store/cls_kvs.cc12
-rw-r--r--src/key_value_store/kv_flat_btree_async.cc4
2 files changed, 8 insertions, 8 deletions
diff --git a/src/key_value_store/cls_kvs.cc b/src/key_value_store/cls_kvs.cc
index 7aa26852db9..df54d975de8 100644
--- a/src/key_value_store/cls_kvs.cc
+++ b/src/key_value_store/cls_kvs.cc
@@ -277,7 +277,7 @@ static int check_writable_op(cls_method_context_t hctx,
}
/**
- * returns -EKEYREJECTED if size is outside of bound, according to comparator.
+ * returns -ERANGE if size is outside of bound, according to comparator.
*
* @bound: the limit to test
* @comparator: should be CEPH_OSD_CMPXATTR_OP_[EQ|GT|LT]
@@ -299,17 +299,17 @@ static int assert_size_in_bound(cls_method_context_t hctx, int bound,
switch (comparator) {
case CEPH_OSD_CMPXATTR_OP_EQ:
if (size != bound) {
- return -EKEYREJECTED;
+ return -ERANGE;
}
break;
case CEPH_OSD_CMPXATTR_OP_LT:
if (size >= bound) {
- return -EKEYREJECTED;
+ return -ERANGE;
}
break;
case CEPH_OSD_CMPXATTR_OP_GT:
if (size <= bound) {
- return -EKEYREJECTED;
+ return -ERANGE;
}
break;
default:
@@ -393,7 +393,7 @@ static int omap_insert(cls_method_context_t hctx,
CLS_LOG(20, "asserting size is less than %d (bound is %d)", assert_bound, bound);
if (old_size_int >= assert_bound) {
- return -EKEYREJECTED;
+ return -ERANGE;
}
int new_size_int = old_size_int + omap.size() - (assert_bound - bound);
@@ -536,7 +536,7 @@ static int omap_remove(cls_method_context_t hctx,
CLS_LOG(20, "asserting size is greater than %d", bound);
if (old_size_int <= bound) {
- return -EKEYREJECTED;
+ return -ERANGE;
}
int new_size_int = old_size_int - omap.size();
diff --git a/src/key_value_store/kv_flat_btree_async.cc b/src/key_value_store/kv_flat_btree_async.cc
index 7faf077ac33..a0ec523018d 100644
--- a/src/key_value_store/kv_flat_btree_async.cc
+++ b/src/key_value_store/kv_flat_btree_async.cc
@@ -1435,7 +1435,7 @@ int KvFlatBtreeAsync::set_op(const string &key, const bufferlist &val,
<< err << std::endl;
return err;
}
- case -EKEYREJECTED: {
+ case -ERANGE: {
//the object needs to be split.
do {
if (verbose) cout << "\t" << client_name << ": running split on "
@@ -1556,7 +1556,7 @@ int KvFlatBtreeAsync::remove_op(const string &key, index_data &idata,
//the key does not exist in the object
return err;
}
- case -EKEYREJECTED: {
+ case -ERANGE: {
//the object needs to be split.
do {
if (verbose) cerr << "\t" << client_name << ": running rebalance on "