vsprintf: move local vars to block local vars and remove unneeded ones
[safe/jmp/linux-2.6] / fs / ext3 / xattr_trusted.c
index f68bfd1..c7c41a4 100644 (file)
@@ -7,19 +7,17 @@
 
 #include <linux/module.h>
 #include <linux/string.h>
+#include <linux/capability.h>
 #include <linux/fs.h>
-#include <linux/smp_lock.h>
 #include <linux/ext3_jbd.h>
 #include <linux/ext3_fs.h>
 #include "xattr.h"
 
-#define XATTR_TRUSTED_PREFIX "trusted."
-
 static size_t
 ext3_xattr_trusted_list(struct inode *inode, char *list, size_t list_size,
                        const char *name, size_t name_len)
 {
-       const size_t prefix_len = sizeof(XATTR_TRUSTED_PREFIX)-1;
+       const size_t prefix_len = XATTR_TRUSTED_PREFIX_LEN;
        const size_t total_len = prefix_len + name_len + 1;
 
        if (!capable(CAP_SYS_ADMIN))
@@ -39,8 +37,6 @@ ext3_xattr_trusted_get(struct inode *inode, const char *name,
 {
        if (strcmp(name, "") == 0)
                return -EINVAL;
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
        return ext3_xattr_get(inode, EXT3_XATTR_INDEX_TRUSTED, name,
                              buffer, size);
 }
@@ -51,8 +47,6 @@ ext3_xattr_trusted_set(struct inode *inode, const char *name,
 {
        if (strcmp(name, "") == 0)
                return -EINVAL;
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
        return ext3_xattr_set(inode, EXT3_XATTR_INDEX_TRUSTED, name,
                              value, size, flags);
 }