]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: overload operator to output BlockExtent
authorChangcheng Liu <changcheng.liu@aliyun.com>
Wed, 18 Mar 2020 02:57:59 +0000 (10:57 +0800)
committerChangcheng Liu <changcheng.liu@aliyun.com>
Wed, 18 Mar 2020 14:18:56 +0000 (22:18 +0800)
Signed-off-by: Changcheng Liu <changcheng.liu@aliyun.com>
src/librbd/BlockGuard.h

index a9c2fd8b3950020c75acd5dc7eceb035e33531c9..de1c0fcecc37fa89988e3f50c135167d6220dc73 100644 (file)
@@ -30,6 +30,12 @@ struct BlockExtent {
   BlockExtent(uint64_t block_start, uint64_t block_end)
     : block_start(block_start), block_end(block_end) {
   }
+
+  friend ostream& operator<< (ostream& os, const BlockExtent& block_extent) {
+    os << "[block_start = " << block_extent.block_start << ", "
+       << "block_end = " << block_extent.block_end << ")";
+    return os;
+  }
 };
 
 struct BlockGuardCell {