]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd: use uint64_t instead of size_t for SparseExtent::length 41239/head
authorKefu Chai <kchai@redhat.com>
Sat, 8 May 2021 13:02:54 +0000 (21:02 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 11 May 2021 01:31:52 +0000 (09:31 +0800)
commit3982d0ea2ca25457e78504afb7e559ef02f62055
tree7a70f3bdd34b993491d9fca846282901d870109b
parent52d1473f13eb47cbf3bb6412e09d6a1dc7879f0e
librbd: use uint64_t instead of size_t for SparseExtent::length

SparseBufferlistExtent's ctor accepts size_t, so, on a 32-bit platform,
the parameter would be narrowed before passing to the ctor, and GCC
complains at seeing this:

/builds/a16bitsysop/aports/community/ceph/src/ceph-16.2.3/src/librbd/deep_copy/ObjectCopyRequest.cc:789:60: warning: narrowing conversion of 'object_extent.striper::LightweightObjectExtent::length'
from 'uint64_t' {aka 'long long unsigned int'} to 'size_t' {aka 'unsigned int'} [-Wnarrowing]
  789 |             {io::SPARSE_EXTENT_STATE_ZEROED, object_extent.length});
      |                                              ~~~~~~~~~~~~~~^~~~~~

so change SparseExtent::length to uint64_t, as ReadExtent::length is
uint64_t and related length() methods in the surrounding classes all
return uint64_t.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/librbd/io/Types.h