]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commit
os/Transaction: change get_num_ops() return type to uint64_t
authorKefu Chai <tchaikov@gmail.com>
Mon, 14 Jul 2025 10:50:48 +0000 (18:50 +0800)
committerKefu Chai <k.chai@proxmox.com>
Sat, 21 Feb 2026 05:39:21 +0000 (13:39 +0800)
commit98f3454f0c1eeadecaffa237e575132675f9afff
tree8db578ed4649e4d1c2df09abfe3cdc8eeb139be5
parent7eb1e7b478bae35f04b0b595f6e5c1e0a5b1f998
os/Transaction: change get_num_ops() return type to uint64_t

Change Transaction::get_num_ops() to return uint64_t instead of int
to match the underlying data.ops type (ceph_le<__u64>) and eliminate
compiler warnings about signed/unsigned comparison.

Fixes warning in ECTransaction.cc:

```
/home/kefu/dev/ceph/src/osd/ECTransaction.cc: In constructor ‘ECTransaction::Generate::Generate(PGTransaction&, ceph::ErasureCodeInterfaceRef&, pg_t&, const ECUtil::stripe_info_t&, const std::map<hobject_t, ECUtil::shard_extent_map_t>&, std::map<hobject_t, ECUtil::shard_extent_map_t>*, shard_id_map<ceph::os::Transaction>&, const OSDMapRef&, const hobject_t&, PGTransaction::ObjectOperation&, ECTransaction::WritePlanObj&, DoutPrefixProvider*, pg_log_entry_t*)’:
/home/kefu/dev/ceph/src/osd/ECTransaction.cc:589:25: warning: comparison of integer expressions of different signedness: ‘int’ and ‘__gnu_cxx::__alloc_traits<std::allocator<unsigned int>, unsigned int>::value_type’ {aka ‘unsigned int’} [-Wsign-compare]
  589 |     if (t.get_num_ops() > old_transaction_counts[int(shard)] &&
```

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/os/Transaction.h