From 59903e546393a8b162e1c44d90769f20134cd85f Mon Sep 17 00:00:00 2001 From: xie xingguo Date: Fri, 24 Jun 2016 15:13:15 +0800 Subject: [PATCH] os/bluestore: literal tidy-ups There error codes are improperly arranged, which looks weird. Signed-off-by: xie xingguo --- src/os/bluestore/BlueStore.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 6bec2f3c8beb..0131f1fc1edf 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -270,7 +270,7 @@ static int get_key_bnode(const string& key, shard_id_t *shard, { const char *p = key.c_str(); if (key.length() < 2 + 8 + 4) - return -2; + return -1; p = _key_decode_shard(p, shard); p = _key_decode_u64(p, (uint64_t*)pool); pool -= 0x8000000000000000ull; @@ -336,7 +336,7 @@ static int get_key_object(const string& key, ghobject_t *oid) const char *p = key.c_str(); if (key.length() < 2 + 8 + 4) - return -2; + return -1; p = _key_decode_shard(p, &oid->shard_id); uint64_t pool; @@ -348,12 +348,12 @@ static int get_key_object(const string& key, ghobject_t *oid) oid->hobj.set_bitwise_key_u32(hash); if (*p != '.') - return -5; + return -2; ++p; r = decode_escaped(p, &oid->hobj.nspace); if (r < 0) - return -6; + return -3; p += r + 1; if (*p == '=') { @@ -361,7 +361,7 @@ static int get_key_object(const string& key, ghobject_t *oid) ++p; r = decode_escaped(p, &oid->hobj.oid.name); if (r < 0) - return -7; + return -4; p += r + 1; } else if (*p == '<' || *p == '>') { // key + name @@ -369,16 +369,16 @@ static int get_key_object(const string& key, ghobject_t *oid) string okey; r = decode_escaped(p, &okey); if (r < 0) - return -8; + return -5; p += r + 1; r = decode_escaped(p, &oid->hobj.oid.name); if (r < 0) - return -9; + return -6; p += r + 1; oid->hobj.set_key(okey); } else { // malformed - return -10; + return -7; } p = _key_decode_u64(p, &oid->hobj.snap.val); @@ -386,7 +386,7 @@ static int get_key_object(const string& key, ghobject_t *oid) if (*p) { // if we get something other than a null terminator here, // something goes wrong. - return -12; + return -8; } return 0; -- 2.47.3