]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
orangefs: Remove useless defines
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 30 May 2016 09:25:59 +0000 (11:25 +0200)
committerMike Marshall <hubcap@omnibond.com>
Tue, 5 Jul 2016 19:47:16 +0000 (15:47 -0400)
The ORANGEFS_XATTR_INDEX_ defines are unused; the ORANGEFS_XATTR_NAME_
defines only obfuscate the code.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
fs/orangefs/acl.c
fs/orangefs/file.c
fs/orangefs/orangefs-kernel.h
fs/orangefs/xattr.c

index 03f89dbb2512a8469ad9513c9a4d81613e1a243f..df2486402dc1d2fdb3e641a459e5870cb479394d 100644 (file)
@@ -18,10 +18,10 @@ struct posix_acl *orangefs_get_acl(struct inode *inode, int type)
 
        switch (type) {
        case ACL_TYPE_ACCESS:
-               key = ORANGEFS_XATTR_NAME_ACL_ACCESS;
+               key = XATTR_NAME_POSIX_ACL_ACCESS;
                break;
        case ACL_TYPE_DEFAULT:
-               key = ORANGEFS_XATTR_NAME_ACL_DEFAULT;
+               key = XATTR_NAME_POSIX_ACL_DEFAULT;
                break;
        default:
                gossip_err("orangefs_get_acl: bogus value of type %d\n", type);
@@ -74,7 +74,7 @@ int orangefs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
 
        switch (type) {
        case ACL_TYPE_ACCESS:
-               name = ORANGEFS_XATTR_NAME_ACL_ACCESS;
+               name = XATTR_NAME_POSIX_ACL_ACCESS;
                if (acl) {
                        umode_t mode = inode->i_mode;
                        /*
@@ -98,7 +98,7 @@ int orangefs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
                }
                break;
        case ACL_TYPE_DEFAULT:
-               name = ORANGEFS_XATTR_NAME_ACL_DEFAULT;
+               name = XATTR_NAME_POSIX_ACL_DEFAULT;
                break;
        default:
                gossip_err("%s: invalid type %d!\n", __func__, type);
index 491e82c6f705fc8d915a7f942b7f04a2bdcc16f6..5160a3f27e7176709797d32212b96e8dd2d37e56 100644 (file)
@@ -516,7 +516,7 @@ static long orangefs_ioctl(struct file *file, unsigned int cmd, unsigned long ar
        if (cmd == FS_IOC_GETFLAGS) {
                val = 0;
                ret = orangefs_inode_getxattr(file_inode(file),
-                                             ORANGEFS_XATTR_NAME_DEFAULT_PREFIX,
+                                             "",
                                              "user.pvfs2.meta_hint",
                                              &val, sizeof(val));
                if (ret < 0 && ret != -ENODATA)
@@ -549,7 +549,7 @@ static long orangefs_ioctl(struct file *file, unsigned int cmd, unsigned long ar
                             "orangefs_ioctl: FS_IOC_SETFLAGS: %llu\n",
                             (unsigned long long)val);
                ret = orangefs_inode_setxattr(file_inode(file),
-                                             ORANGEFS_XATTR_NAME_DEFAULT_PREFIX,
+                                             "",
                                              "user.pvfs2.meta_hint",
                                              &val, sizeof(val), 0);
        }
index 2281882f718eed1cd1e1cf50ec7aaf7b23ab3794..6503e376047ece2968e03d9f9e6944e467c27ef3 100644 (file)
@@ -119,17 +119,6 @@ struct client_debug_mask {
 #define ORANGEFS_CACHE_CREATE_FLAGS 0
 #endif /* ((defined ORANGEFS_KERNEL_DEBUG) && (defined CONFIG_DEBUG_SLAB)) */
 
-/* orangefs xattr and acl related defines */
-#define ORANGEFS_XATTR_INDEX_POSIX_ACL_ACCESS  1
-#define ORANGEFS_XATTR_INDEX_POSIX_ACL_DEFAULT 2
-#define ORANGEFS_XATTR_INDEX_TRUSTED           3
-#define ORANGEFS_XATTR_INDEX_DEFAULT           4
-
-#define ORANGEFS_XATTR_NAME_ACL_ACCESS XATTR_NAME_POSIX_ACL_ACCESS
-#define ORANGEFS_XATTR_NAME_ACL_DEFAULT XATTR_NAME_POSIX_ACL_DEFAULT
-#define ORANGEFS_XATTR_NAME_TRUSTED_PREFIX "trusted."
-#define ORANGEFS_XATTR_NAME_DEFAULT_PREFIX ""
-
 /* these functions are defined in orangefs-utils.c */
 int orangefs_prepare_cdm_array(char *debug_array_string);
 int orangefs_prepare_debugfs_help_string(int);
index 5893ddde0e4b6ad8680f5481ea3f61611060b307..f387e8ad477b220912ea6a5f00e4ef7af19ca411 100644 (file)
@@ -456,7 +456,7 @@ static int orangefs_xattr_set_default(const struct xattr_handler *handler,
                                      int flags)
 {
        return orangefs_inode_setxattr(inode,
-                                   ORANGEFS_XATTR_NAME_DEFAULT_PREFIX,
+                                   "",
                                    name,
                                    buffer,
                                    size,
@@ -471,7 +471,7 @@ static int orangefs_xattr_get_default(const struct xattr_handler *handler,
                                      size_t size)
 {
        return orangefs_inode_getxattr(inode,
-                                   ORANGEFS_XATTR_NAME_DEFAULT_PREFIX,
+                                   "",
                                    name,
                                    buffer,
                                    size);
@@ -487,7 +487,7 @@ static int orangefs_xattr_set_trusted(const struct xattr_handler *handler,
                                     int flags)
 {
        return orangefs_inode_setxattr(inode,
-                                   ORANGEFS_XATTR_NAME_TRUSTED_PREFIX,
+                                   XATTR_TRUSTED_PREFIX,
                                    name,
                                    buffer,
                                    size,
@@ -502,25 +502,20 @@ static int orangefs_xattr_get_trusted(const struct xattr_handler *handler,
                                      size_t size)
 {
        return orangefs_inode_getxattr(inode,
-                                   ORANGEFS_XATTR_NAME_TRUSTED_PREFIX,
+                                   XATTR_TRUSTED_PREFIX,
                                    name,
                                    buffer,
                                    size);
 }
 
 static struct xattr_handler orangefs_xattr_trusted_handler = {
-       .prefix = ORANGEFS_XATTR_NAME_TRUSTED_PREFIX,
+       .prefix = XATTR_TRUSTED_PREFIX,
        .get = orangefs_xattr_get_trusted,
        .set = orangefs_xattr_set_trusted,
 };
 
 static struct xattr_handler orangefs_xattr_default_handler = {
-       /*
-        * NOTE: this is set to be the empty string.
-        * so that all un-prefixed xattrs keys get caught
-        * here!
-        */
-       .prefix = ORANGEFS_XATTR_NAME_DEFAULT_PREFIX,
+       .prefix = "",  /* match any name => handlers called with full name */
        .get = orangefs_xattr_get_default,
        .set = orangefs_xattr_set_default,
 };