]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
objectstore: fix transaction get_num_bytes
authorSage Weil <sage@newdream.net>
Thu, 12 Aug 2010 19:58:25 +0000 (12:58 -0700)
committerSage Weil <sage@newdream.net>
Thu, 12 Aug 2010 20:10:19 +0000 (13:10 -0700)
The separate bytes field isn't used; use encoded bytes count for now.

src/os/ObjectStore.h

index b5622a5423c7ded5af2c19b03cc4c8b7ff65b93b..32c155c17a9989e2facee68d6446d64403ae6b5c 100644 (file)
@@ -114,7 +114,8 @@ public:
     static const int OP_RMATTRS =      28;  // cid, oid
 
   private:
-    uint64_t ops, bytes;
+    uint64_t ops;
+    uint64_t pad_unused_bytes;
     uint32_t largest_data_len, largest_data_off, largest_data_off_in_tbl;
     bufferlist tbl;
     bufferlist::iterator p;
@@ -148,7 +149,7 @@ public:
          s += bls.size() + 4096;
        return s;
       }
-      return bytes;
+      return get_encoded_bytes();
     }
 
     uint32_t get_data_length() {
@@ -159,7 +160,7 @@ public:
        return largest_data_off_in_tbl +
          sizeof(__u8) +  // struct_v
          sizeof(ops) +
-         sizeof(bytes) +
+         sizeof(pad_unused_bytes) +
          sizeof(largest_data_len) +
          sizeof(largest_data_off) +
          sizeof(largest_data_off_in_tbl) +
@@ -449,15 +450,15 @@ public:
 
     // etc.
     Transaction() :
-      ops(0), bytes(0), largest_data_len(0), largest_data_off(0), largest_data_off_in_tbl(0),
+      ops(0), pad_unused_bytes(0), largest_data_len(0), largest_data_off(0), largest_data_off_in_tbl(0),
       old(false), opp(0), blp(0), oidp(0), cidp(0), lengthp(0), attrnamep(0), attrsetp(0) { }
     Transaction(bufferlist::iterator &dp) :
-      ops(0), bytes(0), largest_data_len(0), largest_data_off(0), largest_data_off_in_tbl(0),
+      ops(0), pad_unused_bytes(0), largest_data_len(0), largest_data_off(0), largest_data_off_in_tbl(0),
       old(false), opp(0), blp(0), oidp(0), cidp(0), lengthp(0), attrnamep(0), attrsetp(0) {
       decode(dp);
     }
     Transaction(bufferlist &nbl) :
-      ops(0), bytes(0), largest_data_len(0), largest_data_off(0), largest_data_off_in_tbl(0),
+      ops(0), pad_unused_bytes(0), largest_data_len(0), largest_data_off(0), largest_data_off_in_tbl(0),
       old(false), opp(0), blp(0), oidp(0), cidp(0), lengthp(0), attrnamep(0), attrsetp(0) {
       bufferlist::iterator dp = nbl.begin();
       decode(dp); 
@@ -467,7 +468,7 @@ public:
       __u8 struct_v = 3;
       ::encode(struct_v, bl);
       ::encode(ops, bl);
-      ::encode(bytes, bl);
+      ::encode(pad_unused_bytes, bl);
       ::encode(largest_data_len, bl);
       ::encode(largest_data_off, bl);
       ::encode(largest_data_off_in_tbl, bl);
@@ -493,7 +494,7 @@ public:
       } else {
        assert(struct_v <= 3);
        ::decode(ops, bl);
-       ::decode(bytes, bl);
+       ::decode(pad_unused_bytes, bl);
        if (struct_v >= 3) {
          ::decode(largest_data_len, bl);
          ::decode(largest_data_off, bl);