]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os: add ObjectStore::get_max_attr_name_length()
authorSage Weil <sage@redhat.com>
Fri, 18 Jul 2014 17:42:11 +0000 (10:42 -0700)
committerSage Weil <sage@redhat.com>
Fri, 18 Jul 2014 17:44:05 +0000 (10:44 -0700)
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 <sage@redhat.com>
src/os/FileStore.h
src/os/KeyValueStore.h
src/os/MemStore.h
src/os/ObjectStore.h

index bc6770c24563e8eb308cb34a7d13ff162266018c..6e407285073a892252ac7b39289dad5ca2770034 100644 (file)
@@ -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();
 
index d0adeddc815c1f6cda9fda3774f3ad5e9e589e6b..ae9b0c721332190b33fbbe6d63382c4fe13d819c 100644 (file)
@@ -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;}
 
index 77170b82f69b5e9c6e2703bad4cd915bdd27fd05..531553ddec61bf4d8f2a0c1d5fc3d029a9967bd5 100644 (file)
@@ -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() {
index 6766584875bb8905ab8e7cff1512ca7b6651e04c..75ea2498b8a3b3a071f9ca5a6067f11c066e4862 100644 (file)
@@ -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;