Merge branch 'v4.4/topic/OPPv2' into linux-linaro-lsk-v4.4
[firefly-linux-kernel-4.4.55.git] / fs / reiserfs / xattr_security.c
index 9a3b0616f2838848c88dbf90497ebb9af0a68e2a..60de069225ba33a087f02de406eda2725a159e8e 100644 (file)
@@ -9,33 +9,32 @@
 #include <linux/uaccess.h>
 
 static int
-security_get(struct dentry *dentry, const char *name, void *buffer, size_t size,
-               int handler_flags)
+security_get(const struct xattr_handler *handler, struct dentry *dentry,
+            const char *name, void *buffer, size_t size)
 {
-       if (strlen(name) < sizeof(XATTR_SECURITY_PREFIX))
-               return -EINVAL;
-
        if (IS_PRIVATE(d_inode(dentry)))
                return -EPERM;
 
-       return reiserfs_xattr_get(d_inode(dentry), name, buffer, size);
+       return reiserfs_xattr_get(d_inode(dentry),
+                                 xattr_full_name(handler, name),
+                                 buffer, size);
 }
 
 static int
-security_set(struct dentry *dentry, const char *name, const void *buffer,
-            size_t size, int flags, int handler_flags)
+security_set(const struct xattr_handler *handler, struct dentry *dentry,
+            const char *name, const void *buffer, size_t size, int flags)
 {
-       if (strlen(name) < sizeof(XATTR_SECURITY_PREFIX))
-               return -EINVAL;
-
        if (IS_PRIVATE(d_inode(dentry)))
                return -EPERM;
 
-       return reiserfs_xattr_set(d_inode(dentry), name, buffer, size, flags);
+       return reiserfs_xattr_set(d_inode(dentry),
+                                 xattr_full_name(handler, name),
+                                 buffer, size, flags);
 }
 
-static size_t security_list(struct dentry *dentry, char *list, size_t list_len,
-                           const char *name, size_t namelen, int handler_flags)
+static size_t security_list(const struct xattr_handler *handler,
+                           struct dentry *dentry, char *list, size_t list_len,
+                           const char *name, size_t namelen)
 {
        const size_t len = namelen + 1;