From: Sage Weil Date: Tue, 22 Jul 2014 20:38:32 +0000 (-0700) Subject: os: make name/attr max methods unsigned X-Git-Tag: v0.84~75^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=253ca2b902a2254393edef1245dcdbdd598f3a2f;p=ceph.git 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 --- diff --git a/src/os/FileStore.h b/src/os/FileStore.h index bbd587a7c6e..e5334d3ba42 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 c0991cc2e5e..fd07055d9a7 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 531553ddec6..0fa9d58fc1e 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 75ea2498b8a..3a0c1412746 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;