From f3d37f51b943bb1ef1ebbf2fad09a3946c3f1b67 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 16 May 2020 10:13:26 -0500 Subject: [PATCH] common/CDC: take const bufferlist Signed-off-by: Sage Weil --- src/common/CDC.h | 2 +- src/common/FastCDC.cc | 2 +- src/common/FastCDC.h | 2 +- src/common/FixedCDC.cc | 2 +- src/common/FixedCDC.h | 2 +- src/common/rabin.h | 5 +++-- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/common/CDC.h b/src/common/CDC.h index 4a90afa3a471a..e58377dffe897 100644 --- a/src/common/CDC.h +++ b/src/common/CDC.h @@ -13,7 +13,7 @@ public: virtual ~CDC() = default; virtual void calc_chunks( - ceph::buffer::list& inputdata, + const bufferlist& inputdata, std::vector> *chunks) = 0; virtual void set_target_bits(int bits, int windowbits = 2) = 0; diff --git a/src/common/FastCDC.cc b/src/common/FastCDC.cc index 01b240072841c..cacd084fc5c46 100644 --- a/src/common/FastCDC.cc +++ b/src/common/FastCDC.cc @@ -87,7 +87,7 @@ static inline bool _scan( } void FastCDC::calc_chunks( - bufferlist& bl, + const bufferlist& bl, std::vector> *chunks) { if (bl.length() == 0) { diff --git a/src/common/FastCDC.h b/src/common/FastCDC.h index 414bcc3be1f96..75b0fba954c49 100644 --- a/src/common/FastCDC.h +++ b/src/common/FastCDC.h @@ -41,6 +41,6 @@ public: } void calc_chunks( - bufferlist& bl, + const bufferlist& bl, std::vector> *chunks) override; }; diff --git a/src/common/FixedCDC.cc b/src/common/FixedCDC.cc index ff1355861b465..d2d55d5cfb65e 100644 --- a/src/common/FixedCDC.cc +++ b/src/common/FixedCDC.cc @@ -6,7 +6,7 @@ #include "FixedCDC.h" void FixedCDC::calc_chunks( - bufferlist& bl, + const bufferlist& bl, std::vector> *chunks) { size_t len = bl.length(); diff --git a/src/common/FixedCDC.h b/src/common/FixedCDC.h index e5559d77825fe..d3939753e731d 100644 --- a/src/common/FixedCDC.h +++ b/src/common/FixedCDC.h @@ -18,6 +18,6 @@ public: chunk_size = 1ul << target; } void calc_chunks( - bufferlist& bl, + const bufferlist& bl, std::vector> *chunks) override; }; diff --git a/src/common/rabin.h b/src/common/rabin.h index 607928a510ca5..acc5766e4ad78 100644 --- a/src/common/rabin.h +++ b/src/common/rabin.h @@ -50,9 +50,10 @@ public: } void calc_chunks( - ceph::buffer::list& inputdata, + const ceph::buffer::list& inputdata, std::vector> *chunks) override { - do_rabin_chunks(inputdata, *chunks); + bufferlist b = inputdata; + do_rabin_chunks(b, *chunks); } int do_rabin_chunks(ceph::buffer::list& inputdata, -- 2.39.5