]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
key_value_store: fixup errno handling
authorGreg Farnum <greg@inktank.com>
Mon, 1 Jul 2013 21:57:39 +0000 (14:57 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Tue, 2 Jul 2013 19:39:12 +0000 (12:39 -0700)
Don't use "errno" as a variable name, and include <errno.h>
instead of some of the specific paths.

Signed-off-by: Greg Farnum <greg@inktank.com>
src/key_value_store/cls_kvs.cc
src/key_value_store/kv_flat_btree_async.cc
src/key_value_store/kv_flat_btree_async.h

index ab3095fe76362905aefa400ea5d3f22c0945d902..7aa26852db9fe56f80fa3fef14948a3d17fd60f8 100644 (file)
@@ -6,8 +6,7 @@
  */
 
 #include "objclass/objclass.h"
-#include "/usr/include/asm-generic/errno-base.h"
-#include "/usr/include/asm-generic/errno.h"
+#include <errno.h>
 #include "key_value_store/kvs_arg_types.h"
 #include "include/types.h"
 #include <iostream>
index 7b0ed2bc4c474a1e66c19fa4be54df6c322678e0..1ce272951408458c99351c6f4752adf5c7c4078d 100644 (file)
@@ -990,7 +990,7 @@ int KvFlatBtreeAsync::perform_ops(const string &debug_prefix,
   return err;
 }
 
-int KvFlatBtreeAsync::cleanup(const index_data &idata, const int &errno) {
+int KvFlatBtreeAsync::cleanup(const index_data &idata, const int &error) {
   if (verbose) cout << "\t\t" << client_name << ": cleaning up after "
       << idata.str()
       << std::endl;
@@ -998,7 +998,7 @@ int KvFlatBtreeAsync::cleanup(const index_data &idata, const int &errno) {
   assert(idata.prefix != "");
   map<std::string,bufferlist> new_index;
   map<std::string, pair<bufferlist, int> > assertions;
-  switch (errno) {
+  switch (error) {
   case -EFIRSTOBJ: {
     //this happens if the split or rebalance failed to mark the first object,
     //meaning only the index needs to be changed.
index 132d7987492cacdefff51beefda497d3a2987e7f..ea13fad6553aee3d7da1ab7bb27f41002cdf1185 100644 (file)
@@ -693,7 +693,7 @@ protected:
    * died (should be -ENOENT or -ETIMEDOUT)
    * @post: rolls forward if -ENOENT, otherwise rolls back.
    */
-  int cleanup(const index_data &idata, const int &errno);
+  int cleanup(const index_data &idata, const int &error);
 
   /**
    * does the ObjectWriteOperation and splits, reads the index, and/or retries