]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: literal tidy-ups 9916/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Fri, 24 Jun 2016 07:13:15 +0000 (15:13 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Fri, 24 Jun 2016 07:13:15 +0000 (15:13 +0800)
There error codes are improperly arranged, which looks weird.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/bluestore/BlueStore.cc

index 6bec2f3c8beb37383039d481becac0f5fba051c0..0131f1fc1edfbbf33f3726eaea3c276b1548bfad 100644 (file)
@@ -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;