]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/Message: use an unsigned type for get_data_len()
authorKefu Chai <kchai@redhat.com>
Wed, 14 Apr 2021 03:21:42 +0000 (11:21 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 15 Apr 2021 04:37:44 +0000 (12:37 +0800)
to avoid warnings like:

../src/osd/PrimaryLogPG.cc:2123:27: warning: comparison of integer expressions of different signedness: ‘off_t’ {aka ‘long int’} and ‘uint64_t’ {aka ‘long unsigned int’} [-Wsign-compare]
 2123 |         m->get_data_len() > cct->_conf->osd_max_write_size << 20) {
      |         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

after change the size options' type to unsigned or uint64_t.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/msg/Message.h

index 8e1c4f967f05942855a6f34e9f1135a8470eb190..870ad0781c3b013ad57f56b18f01dc9bc81cdbcb 100644 (file)
@@ -430,7 +430,7 @@ public:
       byte_throttler->put(data.length());
     bl = std::move(data);
   }
-  off_t get_data_len() const { return data.length(); }
+  uint32_t get_data_len() const { return data.length(); }
 
   void set_recv_stamp(utime_t t) { recv_stamp = t; }
   const utime_t& get_recv_stamp() const { return recv_stamp; }