From 58e49b9f5d29f99c2467b9672087f6dc77db3764 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 15 Jul 2025 14:40:09 +0800 Subject: [PATCH] common/options: change osd_target_transaction_size from int to uint MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change osd_target_transaction_size from signed int to unsigned int to match the return type of Transaction::get_num_opts() (ceph_le64). This change: - Eliminates compiler warnings when comparing signed/unsigned values - Enables automatic size conversion (e.g., "4_K" → 4096) via y2c.py for improved administrator usability - Maintains type consistency throughout the codebase Signed-off-by: Kefu Chai --- src/common/options/global.yaml.in | 2 +- src/osd/OSD.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/options/global.yaml.in b/src/common/options/global.yaml.in index f3ebf1b1a8e..035d8134685 100644 --- a/src/common/options/global.yaml.in +++ b/src/common/options/global.yaml.in @@ -3393,7 +3393,7 @@ options: with_legacy: true # to adjust various transactions that batch smaller items - name: osd_target_transaction_size - type: int + type: uint level: advanced default: 30 with_legacy: true diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 4de408d146f..d99ea15605b 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -5061,7 +5061,7 @@ void OSD::clear_temp_objects() } if (!temps.empty()) { ObjectStore::Transaction t; - int removed = 0; + unsigned removed = 0; for (vector::iterator q = temps.begin(); q != temps.end(); ++q) { dout(20) << " removing " << *p << " object " << *q << dendl; t.remove(*p, *q); -- 2.47.3