fs/xfs/quota: Add missing mutex_unlock
[safe/jmp/linux-2.6] / fs / ext2 / xattr_trusted.c
index 52b30ee..2a26d71 100644 (file)
@@ -7,18 +7,16 @@
 
 #include <linux/module.h>
 #include <linux/string.h>
+#include <linux/capability.h>
 #include <linux/fs.h>
-#include <linux/smp_lock.h>
 #include <linux/ext2_fs.h>
 #include "xattr.h"
 
-#define XATTR_TRUSTED_PREFIX "trusted."
-
 static size_t
-ext2_xattr_trusted_list(struct inode *inode, char *list, size_t list_size,
-                       const char *name, size_t name_len)
+ext2_xattr_trusted_list(struct dentry *dentry, char *list, size_t list_size,
+               const char *name, size_t name_len, int type)
 {
-       const int prefix_len = sizeof(XATTR_TRUSTED_PREFIX)-1;
+       const int prefix_len = XATTR_TRUSTED_PREFIX_LEN;
        const size_t total_len = prefix_len + name_len + 1;
 
        if (!capable(CAP_SYS_ADMIN))
@@ -33,26 +31,22 @@ ext2_xattr_trusted_list(struct inode *inode, char *list, size_t list_size,
 }
 
 static int
-ext2_xattr_trusted_get(struct inode *inode, const char *name,
-                      void *buffer, size_t size)
+ext2_xattr_trusted_get(struct dentry *dentry, const char *name,
+               void *buffer, size_t size, int type)
 {
        if (strcmp(name, "") == 0)
                return -EINVAL;
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
-       return ext2_xattr_get(inode, EXT2_XATTR_INDEX_TRUSTED, name,
+       return ext2_xattr_get(dentry->d_inode, EXT2_XATTR_INDEX_TRUSTED, name,
                              buffer, size);
 }
 
 static int
-ext2_xattr_trusted_set(struct inode *inode, const char *name,
-                      const void *value, size_t size, int flags)
+ext2_xattr_trusted_set(struct dentry *dentry, const char *name,
+               const void *value, size_t size, int flags, int type)
 {
        if (strcmp(name, "") == 0)
                return -EINVAL;
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
-       return ext2_xattr_set(inode, EXT2_XATTR_INDEX_TRUSTED, name,
+       return ext2_xattr_set(dentry->d_inode, EXT2_XATTR_INDEX_TRUSTED, name,
                              value, size, flags);
 }