From 253ca2b902a2254393edef1245dcdbdd598f3a2f Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 22 Jul 2014 13:38:32 -0700 Subject: [PATCH] os: make name/attr max methods unsigned This fixes warnings when we use these in MIN/MAX macros against other unsigned values. Fixes: #8897 Signed-off-by: Sage Weil --- src/os/FileStore.h | 4 ++-- src/os/KeyValueStore.h | 4 ++-- src/os/MemStore.h | 4 ++-- src/os/ObjectStore.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/os/FileStore.h b/src/os/FileStore.h index bbd587a7c6ed..e5334d3ba423 100644 --- a/src/os/FileStore.h +++ b/src/os/FileStore.h @@ -410,11 +410,11 @@ public: int write_op_seq(int, uint64_t seq); int mount(); int umount(); - int get_max_object_name_length() { + unsigned get_max_object_name_length() { // not safe for all file systems, btw! use the tunable to limit this. return 4096; } - int get_max_attr_name_length() { + unsigned get_max_attr_name_length() { // xattr limit is 128; leave room for our prefixes (user.ceph._), // some margin, and cap at 100 return 100; diff --git a/src/os/KeyValueStore.h b/src/os/KeyValueStore.h index c0991cc2e5e2..fd07055d9a75 100644 --- a/src/os/KeyValueStore.h +++ b/src/os/KeyValueStore.h @@ -491,10 +491,10 @@ class KeyValueStore : public ObjectStore, int write_version_stamp(); int mount(); int umount(); - int get_max_object_name_length() { + unsigned get_max_object_name_length() { return 4096; // no real limit for leveldb } - int get_max_attr_name_length() { + unsigned get_max_attr_name_length() { return 256; // arbitrary; there is no real limit internally } int mkfs(); diff --git a/src/os/MemStore.h b/src/os/MemStore.h index 531553ddec61..0fa9d58fc1e6 100644 --- a/src/os/MemStore.h +++ b/src/os/MemStore.h @@ -249,10 +249,10 @@ public: int mount(); int umount(); - int get_max_object_name_length() { + unsigned get_max_object_name_length() { return 4096; } - int get_max_attr_name_length() { + unsigned get_max_attr_name_length() { return 256; // arbitrary; there is no real limit internally } diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index 75ea2498b8a3..3a0c1412746a 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -1192,8 +1192,8 @@ public: virtual bool test_mount_in_use() = 0; virtual int mount() = 0; virtual int umount() = 0; - virtual int get_max_object_name_length() = 0; - virtual int get_max_attr_name_length() = 0; + virtual unsigned get_max_object_name_length() = 0; + virtual unsigned get_max_attr_name_length() = 0; virtual int mkfs() = 0; // wipe virtual int mkjournal() = 0; // journal only virtual void set_allow_sharded_objects() = 0; -- 2.47.3