From: Sage Weil Date: Fri, 18 Jul 2014 17:42:11 +0000 (-0700) Subject: os: add ObjectStore::get_max_attr_name_length() X-Git-Tag: v0.84~84^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7c0b2a05b962b61a8778f97a6e36883d53a0724a;p=ceph.git os: add ObjectStore::get_max_attr_name_length() Most importantly, capture that attrs on FileStore can't be more than about 100 chars. The Linux xattrs can only be 128 chars, but we also have some prefixing we do. Signed-off-by: Sage Weil --- diff --git a/src/os/FileStore.h b/src/os/FileStore.h index bc6770c24563..6e407285073a 100644 --- a/src/os/FileStore.h +++ b/src/os/FileStore.h @@ -411,6 +411,11 @@ public: int mount(); int umount(); int get_max_object_name_length(); + int get_max_attr_name_length() { + // xattr limit is 128; leave room for our prefixes (user.ceph._), + // some margin, and cap at 100 + return 100; + } int mkfs(); int mkjournal(); diff --git a/src/os/KeyValueStore.h b/src/os/KeyValueStore.h index d0adeddc815c..ae9b0c721332 100644 --- a/src/os/KeyValueStore.h +++ b/src/os/KeyValueStore.h @@ -492,6 +492,9 @@ class KeyValueStore : public ObjectStore, int mount(); int umount(); int get_max_object_name_length(); + int get_max_attr_name_length() { + return 256; // arbitrary; there is no real limit internally + } int mkfs(); int mkjournal() {return 0;} diff --git a/src/os/MemStore.h b/src/os/MemStore.h index 77170b82f69b..531553ddec61 100644 --- a/src/os/MemStore.h +++ b/src/os/MemStore.h @@ -252,6 +252,9 @@ public: int get_max_object_name_length() { return 4096; } + int get_max_attr_name_length() { + return 256; // arbitrary; there is no real limit internally + } int mkfs(); int mkjournal() { diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index 6766584875bb..75ea2498b8a3 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -1193,6 +1193,7 @@ public: 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 int mkfs() = 0; // wipe virtual int mkjournal() = 0; // journal only virtual void set_allow_sharded_objects() = 0;