]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
objectstore: implement Transaction::swap()
authorSage Weil <sage@newdream.net>
Tue, 26 Apr 2011 17:17:47 +0000 (10:17 -0700)
committerSage Weil <sage@newdream.net>
Tue, 26 Apr 2011 17:29:49 +0000 (10:29 -0700)
Signed-off-by: Sage Weil <sage@newdream.net>
src/os/ObjectStore.h

index 16cc2f6b408c7ac8ade5b4af31d7115dc6f7a3ba..d582712ec392c0df3e6778a5340bd21f1fcdcbab 100644 (file)
@@ -159,6 +159,14 @@ public:
 
   public:
 
+    void swap(Transaction& other) {
+      std::swap(ops, other.ops);
+      std::swap(largest_data_len, other.largest_data_len);
+      std::swap(largest_data_off, other.largest_data_off);
+      std::swap(largest_data_off_in_tbl, other.largest_data_off_in_tbl);
+      tbl.swap(other.tbl);
+    }
+
     void append(Transaction& other) {
       ops += other.ops;
       assert(pad_unused_bytes == 0);