]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/DaemonServer: use "unsigned" to represent the pgp num 42168/head
authorKefu Chai <kchai@redhat.com>
Sun, 4 Jul 2021 05:48:26 +0000 (13:48 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 4 Jul 2021 08:30:26 +0000 (16:30 +0800)
as pgp num should alwayes be unsigned, and this change silences the
GCC warning like:

../src/mgr/DaemonServer.cc: In lambda function:
../src/mgr/DaemonServer.cc:2862:15: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
 2862 |      if (next != p.get_pgp_num()) {
      |          ~~~~~^~~~~~~~~~~~~~~~~~

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mgr/DaemonServer.cc

index a9d785177c1c067f98ed5d47dea7131ac0988e9f..552f8322ff597ff8f6e1e088c8d57c0a2debd329 100644 (file)
@@ -2816,7 +2816,7 @@ void DaemonServer::adjust_pgs()
            // single adjustment that's more than half of the
            // max_misplaced, to somewhat limit the magnitude of
            // our potential error here.
-           int next;
+           unsigned next;
            static constexpr unsigned MAX_NUM_OBJECTS_PER_PG_FOR_LEAP = 1;
            pool_stat_t s = pg_map.get_pg_pool_sum_stat(i.first);
            if (aggro ||