xattr_handler: pass dentry and inode as separate arguments of ->get()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 11 Apr 2016 00:48:24 +0000 (20:48 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 11 Apr 2016 00:48:24 +0000 (20:48 -0400)
... and do not assume they are already attached to each other

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
31 files changed:
fs/9p/acl.c
fs/9p/xattr.c
fs/btrfs/xattr.c
fs/ext2/xattr_security.c
fs/ext2/xattr_trusted.c
fs/ext2/xattr_user.c
fs/ext4/xattr_security.c
fs/ext4/xattr_trusted.c
fs/ext4/xattr_user.c
fs/f2fs/xattr.c
fs/gfs2/xattr.c
fs/hfsplus/xattr.c
fs/hfsplus/xattr.h
fs/hfsplus/xattr_security.c
fs/hfsplus/xattr_trusted.c
fs/hfsplus/xattr_user.c
fs/jffs2/security.c
fs/jffs2/xattr_trusted.c
fs/jffs2/xattr_user.c
fs/nfs/nfs4proc.c
fs/ocfs2/xattr.c
fs/orangefs/xattr.c
fs/posix_acl.c
fs/reiserfs/xattr_security.c
fs/reiserfs/xattr_trusted.c
fs/reiserfs/xattr_user.c
fs/squashfs/xattr.c
fs/xattr.c
fs/xfs/xfs_xattr.c
include/linux/xattr.h
mm/shmem.c

index 2d94e94b6b591277753e0f7f8dd66663fa0db1ed..eb3589edf485c0e165790f68c6def83ceab8dac2 100644 (file)
@@ -213,8 +213,8 @@ int v9fs_acl_mode(struct inode *dir, umode_t *modep,
 }
 
 static int v9fs_xattr_get_acl(const struct xattr_handler *handler,
-                             struct dentry *dentry, const char *name,
-                             void *buffer, size_t size)
+                             struct dentry *dentry, struct inode *inode,
+                             const char *name, void *buffer, size_t size)
 {
        struct v9fs_session_info *v9ses;
        struct posix_acl *acl;
@@ -227,7 +227,7 @@ static int v9fs_xattr_get_acl(const struct xattr_handler *handler,
        if ((v9ses->flags & V9FS_ACCESS_MASK) != V9FS_ACCESS_CLIENT)
                return v9fs_xattr_get(dentry, handler->name, buffer, size);
 
-       acl = v9fs_get_cached_acl(d_inode(dentry), handler->flags);
+       acl = v9fs_get_cached_acl(inode, handler->flags);
        if (IS_ERR(acl))
                return PTR_ERR(acl);
        if (acl == NULL)
index 9dd9b47a6c1a1f095f15aeeff96e41638cd85a5e..18c62bae95917d40653e1ffc5c62e372c3b99456 100644 (file)
@@ -138,8 +138,8 @@ ssize_t v9fs_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size)
 }
 
 static int v9fs_xattr_handler_get(const struct xattr_handler *handler,
-                                 struct dentry *dentry, const char *name,
-                                 void *buffer, size_t size)
+                                 struct dentry *dentry, struct inode *inode,
+                                 const char *name, void *buffer, size_t size)
 {
        const char *full_name = xattr_full_name(handler, name);
 
index 145d2b89e62dce075903cb73234fd726e8fcec2f..03224b00ea70fb7cd190d8119e5e6eac4fbda8f8 100644 (file)
@@ -369,11 +369,9 @@ err:
 }
 
 static int btrfs_xattr_handler_get(const struct xattr_handler *handler,
-                                  struct dentry *dentry, const char *name,
-                                  void *buffer, size_t size)
+                                  struct dentry *unused, struct inode *inode,
+                                  const char *name, void *buffer, size_t size)
 {
-       struct inode *inode = d_inode(dentry);
-
        name = xattr_full_name(handler, name);
        return __btrfs_getxattr(inode, name, buffer, size);
 }
index ba97f243b0504498d16bde66b55b653d76a8f175..7fd3b867ce65fec8d7310fa021fba9821e238c14 100644 (file)
@@ -9,10 +9,10 @@
 
 static int
 ext2_xattr_security_get(const struct xattr_handler *handler,
-                       struct dentry *dentry, const char *name,
-                       void *buffer, size_t size)
+                       struct dentry *unused, struct inode *inode,
+                       const char *name, void *buffer, size_t size)
 {
-       return ext2_xattr_get(d_inode(dentry), EXT2_XATTR_INDEX_SECURITY, name,
+       return ext2_xattr_get(inode, EXT2_XATTR_INDEX_SECURITY, name,
                              buffer, size);
 }
 
index 2c94d1930626269e0e4c2155ae924cd8b30e9e41..0f85705ff519860b86e278a57152a9708d8d1d17 100644 (file)
@@ -16,10 +16,10 @@ ext2_xattr_trusted_list(struct dentry *dentry)
 
 static int
 ext2_xattr_trusted_get(const struct xattr_handler *handler,
-                      struct dentry *dentry, const char *name,
-                      void *buffer, size_t size)
+                      struct dentry *unused, struct inode *inode,
+                      const char *name, void *buffer, size_t size)
 {
-       return ext2_xattr_get(d_inode(dentry), EXT2_XATTR_INDEX_TRUSTED, name,
+       return ext2_xattr_get(inode, EXT2_XATTR_INDEX_TRUSTED, name,
                              buffer, size);
 }
 
index 72a2a96d677f9ed455e0ac92cdeaf241b5ab188b..1fafd27037ccd72a5c7a59cfb3afa1eb9ef356ca 100644 (file)
@@ -18,12 +18,12 @@ ext2_xattr_user_list(struct dentry *dentry)
 
 static int
 ext2_xattr_user_get(const struct xattr_handler *handler,
-                   struct dentry *dentry, const char *name,
-                   void *buffer, size_t size)
+                   struct dentry *unused, struct inode *inode,
+                   const char *name, void *buffer, size_t size)
 {
-       if (!test_opt(dentry->d_sb, XATTR_USER))
+       if (!test_opt(inode->i_sb, XATTR_USER))
                return -EOPNOTSUPP;
-       return ext2_xattr_get(d_inode(dentry), EXT2_XATTR_INDEX_USER,
+       return ext2_xattr_get(inode, EXT2_XATTR_INDEX_USER,
                              name, buffer, size);
 }
 
index 3e81bdca071a6776fa16422bdd9006ddb2abf1e6..123a7d010efeb9f3db00c1c448a53321fa4f8855 100644 (file)
 
 static int
 ext4_xattr_security_get(const struct xattr_handler *handler,
-                       struct dentry *dentry, const char *name,
-                       void *buffer, size_t size)
+                       struct dentry *unused, struct inode *inode,
+                       const char *name, void *buffer, size_t size)
 {
-       return ext4_xattr_get(d_inode(dentry), EXT4_XATTR_INDEX_SECURITY,
+       return ext4_xattr_get(inode, EXT4_XATTR_INDEX_SECURITY,
                              name, buffer, size);
 }
 
index 2a3c6f9b8cb8452115aaaa4fadb786d3a2ca2612..60652fa24cbced4a6b6bb7e4a1a17fd95b677130 100644 (file)
@@ -20,10 +20,10 @@ ext4_xattr_trusted_list(struct dentry *dentry)
 
 static int
 ext4_xattr_trusted_get(const struct xattr_handler *handler,
-                      struct dentry *dentry, const char *name, void *buffer,
-                      size_t size)
+                      struct dentry *unused, struct inode *inode,
+                      const char *name, void *buffer, size_t size)
 {
-       return ext4_xattr_get(d_inode(dentry), EXT4_XATTR_INDEX_TRUSTED,
+       return ext4_xattr_get(inode, EXT4_XATTR_INDEX_TRUSTED,
                              name, buffer, size);
 }
 
index d152f431e432affe701e4c0729bb8e97517f4075..17a446ffecd30c1ace66c1a2f2fb349f0a24211c 100644 (file)
@@ -19,12 +19,12 @@ ext4_xattr_user_list(struct dentry *dentry)
 
 static int
 ext4_xattr_user_get(const struct xattr_handler *handler,
-                   struct dentry *dentry, const char *name,
-                   void *buffer, size_t size)
+                   struct dentry *unused, struct inode *inode,
+                   const char *name, void *buffer, size_t size)
 {
-       if (!test_opt(dentry->d_sb, XATTR_USER))
+       if (!test_opt(inode->i_sb, XATTR_USER))
                return -EOPNOTSUPP;
-       return ext4_xattr_get(d_inode(dentry), EXT4_XATTR_INDEX_USER,
+       return ext4_xattr_get(inode, EXT4_XATTR_INDEX_USER,
                              name, buffer, size);
 }
 
index 06a72dc0191a022049bbf48ad26e127bb6211c02..17fd2b1a6848138bb8d284f56c0ef8f78d39719c 100644 (file)
 #include "xattr.h"
 
 static int f2fs_xattr_generic_get(const struct xattr_handler *handler,
-               struct dentry *dentry, const char *name, void *buffer,
-               size_t size)
+               struct dentry *unused, struct inode *inode,
+               const char *name, void *buffer, size_t size)
 {
-       struct f2fs_sb_info *sbi = F2FS_SB(dentry->d_sb);
+       struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
 
        switch (handler->flags) {
        case F2FS_XATTR_INDEX_USER:
@@ -45,7 +45,7 @@ static int f2fs_xattr_generic_get(const struct xattr_handler *handler,
        default:
                return -EINVAL;
        }
-       return f2fs_getxattr(d_inode(dentry), handler->flags, name,
+       return f2fs_getxattr(inode, handler->flags, name,
                             buffer, size, NULL);
 }
 
@@ -86,11 +86,9 @@ static bool f2fs_xattr_trusted_list(struct dentry *dentry)
 }
 
 static int f2fs_xattr_advise_get(const struct xattr_handler *handler,
-               struct dentry *dentry, const char *name, void *buffer,
-               size_t size)
+               struct dentry *unused, struct inode *inode,
+               const char *name, void *buffer, size_t size)
 {
-       struct inode *inode = d_inode(dentry);
-
        if (buffer)
                *((char *)buffer) = F2FS_I(inode)->i_advise;
        return sizeof(char);
index e8dfb4740c0491844f26be8aaa414cda42638d6f..619886ba6e78527001860299fcee9eef4816436f 100644 (file)
@@ -584,10 +584,10 @@ out:
  * Returns: actual size of data on success, -errno on error
  */
 static int gfs2_xattr_get(const struct xattr_handler *handler,
-                         struct dentry *dentry, const char *name,
-                         void *buffer, size_t size)
+                         struct dentry *unused, struct inode *inode,
+                         const char *name, void *buffer, size_t size)
 {
-       struct gfs2_inode *ip = GFS2_I(d_inode(dentry));
+       struct gfs2_inode *ip = GFS2_I(inode);
        struct gfs2_ea_location el;
        int type = handler->flags;
        int error;
index ab01530b4930f4bf49aec02659a8fd903ee4a047..45dc4ae3791ad3150684513e507b541e20d5e3e5 100644 (file)
@@ -579,7 +579,7 @@ failed_getxattr_init:
        return res;
 }
 
-ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name,
+ssize_t hfsplus_getxattr(struct inode *inode, const char *name,
                         void *value, size_t size,
                         const char *prefix, size_t prefixlen)
 {
@@ -594,7 +594,7 @@ ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name,
        strcpy(xattr_name, prefix);
        strcpy(xattr_name + prefixlen, name);
 
-       res = __hfsplus_getxattr(d_inode(dentry), xattr_name, value, size);
+       res = __hfsplus_getxattr(inode, xattr_name, value, size);
        kfree(xattr_name);
        return res;
 
@@ -844,8 +844,8 @@ end_removexattr:
 }
 
 static int hfsplus_osx_getxattr(const struct xattr_handler *handler,
-                               struct dentry *dentry, const char *name,
-                               void *buffer, size_t size)
+                               struct dentry *unused, struct inode *inode,
+                               const char *name, void *buffer, size_t size)
 {
        /*
         * Don't allow retrieving properly prefixed attributes
@@ -860,7 +860,7 @@ static int hfsplus_osx_getxattr(const struct xattr_handler *handler,
         * creates), so we pass the name through unmodified (after
         * ensuring it doesn't conflict with another namespace).
         */
-       return __hfsplus_getxattr(d_inode(dentry), name, buffer, size);
+       return __hfsplus_getxattr(inode, name, buffer, size);
 }
 
 static int hfsplus_osx_setxattr(const struct xattr_handler *handler,
index f9b0955b3d281ee93deedf398905bf1c1c64469d..d04ba6f58df284f7a0cd8d4f5d92cceba13bab58 100644 (file)
@@ -28,7 +28,7 @@ int hfsplus_setxattr(struct dentry *dentry, const char *name,
 ssize_t __hfsplus_getxattr(struct inode *inode, const char *name,
                           void *value, size_t size);
 
-ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name,
+ssize_t hfsplus_getxattr(struct inode *inode, const char *name,
                         void *value, size_t size,
                         const char *prefix, size_t prefixlen);
 
index 72a68a3a0c996e1ca73fb2ec462c30f19b56f247..ae2ca8c2e3353428adb4b2fe09c43c470a736f81 100644 (file)
 #include "acl.h"
 
 static int hfsplus_security_getxattr(const struct xattr_handler *handler,
-                                    struct dentry *dentry, const char *name,
-                                    void *buffer, size_t size)
+                                    struct dentry *unused, struct inode *inode,
+                                    const char *name, void *buffer, size_t size)
 {
-       return hfsplus_getxattr(dentry, name, buffer, size,
+       return hfsplus_getxattr(inode, name, buffer, size,
                                XATTR_SECURITY_PREFIX,
                                XATTR_SECURITY_PREFIX_LEN);
 }
index 95a7704c7abb7b82358d5516c366ead6091d4fda..eae2947060aa1892f425dd4eb2377d035a9e06b2 100644 (file)
 #include "xattr.h"
 
 static int hfsplus_trusted_getxattr(const struct xattr_handler *handler,
-                                   struct dentry *dentry, const char *name,
-                                   void *buffer, size_t size)
+                                   struct dentry *unused, struct inode *inode,
+                                   const char *name, void *buffer, size_t size)
 {
-       return hfsplus_getxattr(dentry, name, buffer, size,
+       return hfsplus_getxattr(inode, name, buffer, size,
                                XATTR_TRUSTED_PREFIX,
                                XATTR_TRUSTED_PREFIX_LEN);
 }
index 6fc269baf959a34bb9889b2be5c8a0711e895c94..3c9eec3e4c7befa138983c4bcec755308ebf1b1d 100644 (file)
 #include "xattr.h"
 
 static int hfsplus_user_getxattr(const struct xattr_handler *handler,
-                                struct dentry *dentry, const char *name,
-                                void *buffer, size_t size)
+                                struct dentry *unused, struct inode *inode,
+                                const char *name, void *buffer, size_t size)
 {
 
-       return hfsplus_getxattr(dentry, name, buffer, size,
+       return hfsplus_getxattr(inode, name, buffer, size,
                                XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN);
 }
 
index 7a28facd71750c80f087db06f50e71be8d556710..3ed9a4b49778d8650168a7de1e62b3149827636d 100644 (file)
@@ -49,10 +49,10 @@ int jffs2_init_security(struct inode *inode, struct inode *dir,
 
 /* ---- XATTR Handler for "security.*" ----------------- */
 static int jffs2_security_getxattr(const struct xattr_handler *handler,
-                                  struct dentry *dentry, const char *name,
-                                  void *buffer, size_t size)
+                                  struct dentry *unused, struct inode *inode,
+                                  const char *name, void *buffer, size_t size)
 {
-       return do_jffs2_getxattr(d_inode(dentry), JFFS2_XPREFIX_SECURITY,
+       return do_jffs2_getxattr(inode, JFFS2_XPREFIX_SECURITY,
                                 name, buffer, size);
 }
 
index b2555ef07a12b1f969f63cac461e0f06f7517533..4ebecff1d922441879010e4b77ced01e70ab970c 100644 (file)
 #include "nodelist.h"
 
 static int jffs2_trusted_getxattr(const struct xattr_handler *handler,
-                                 struct dentry *dentry, const char *name,
-                                 void *buffer, size_t size)
+                                 struct dentry *unused, struct inode *inode,
+                                 const char *name, void *buffer, size_t size)
 {
-       return do_jffs2_getxattr(d_inode(dentry), JFFS2_XPREFIX_TRUSTED,
+       return do_jffs2_getxattr(inode, JFFS2_XPREFIX_TRUSTED,
                                 name, buffer, size);
 }
 
index 539bd630b5e42120c7c185394959c05036df629a..bce249e1b277c1805c37cc64b808220691fb6765 100644 (file)
 #include "nodelist.h"
 
 static int jffs2_user_getxattr(const struct xattr_handler *handler,
-                              struct dentry *dentry, const char *name,
-                              void *buffer, size_t size)
+                              struct dentry *unused, struct inode *inode,
+                              const char *name, void *buffer, size_t size)
 {
-       return do_jffs2_getxattr(d_inode(dentry), JFFS2_XPREFIX_USER,
+       return do_jffs2_getxattr(inode, JFFS2_XPREFIX_USER,
                                 name, buffer, size);
 }
 
index 327b8c34d3606e5d234f006fd26a3293f12b1d36..7a7ac1dafa020c630edd72529be5fb3898728dd4 100644 (file)
@@ -6263,10 +6263,10 @@ static int nfs4_xattr_set_nfs4_acl(const struct xattr_handler *handler,
 }
 
 static int nfs4_xattr_get_nfs4_acl(const struct xattr_handler *handler,
-                                  struct dentry *dentry, const char *key,
-                                  void *buf, size_t buflen)
+                                  struct dentry *unused, struct inode *inode,
+                                  const char *key, void *buf, size_t buflen)
 {
-       return nfs4_proc_get_acl(d_inode(dentry), buf, buflen);
+       return nfs4_proc_get_acl(inode, buf, buflen);
 }
 
 static bool nfs4_xattr_list_nfs4_acl(struct dentry *dentry)
@@ -6288,11 +6288,11 @@ static int nfs4_xattr_set_nfs4_label(const struct xattr_handler *handler,
 }
 
 static int nfs4_xattr_get_nfs4_label(const struct xattr_handler *handler,
-                                    struct dentry *dentry, const char *key,
-                                    void *buf, size_t buflen)
+                                    struct dentry *unused, struct inode *inode,
+                                    const char *key, void *buf, size_t buflen)
 {
        if (security_ismaclabel(key))
-               return nfs4_get_security_label(d_inode(dentry), buf, buflen);
+               return nfs4_get_security_label(inode, buf, buflen);
        return -EOPNOTSUPP;
 }
 
index 7d3d979f57d9142169f93f2c88b27a612dc06dc4..72eef4cfe8a939df55c3504a5e6ae33b20fe165e 100644 (file)
@@ -7250,10 +7250,10 @@ leave:
  * 'security' attributes support
  */
 static int ocfs2_xattr_security_get(const struct xattr_handler *handler,
-                                   struct dentry *dentry, const char *name,
-                                   void *buffer, size_t size)
+                                   struct dentry *unused, struct inode *inode,
+                                   const char *name, void *buffer, size_t size)
 {
-       return ocfs2_xattr_get(d_inode(dentry), OCFS2_XATTR_INDEX_SECURITY,
+       return ocfs2_xattr_get(inode, OCFS2_XATTR_INDEX_SECURITY,
                               name, buffer, size);
 }
 
@@ -7321,10 +7321,10 @@ const struct xattr_handler ocfs2_xattr_security_handler = {
  * 'trusted' attributes support
  */
 static int ocfs2_xattr_trusted_get(const struct xattr_handler *handler,
-                                  struct dentry *dentry, const char *name,
-                                  void *buffer, size_t size)
+                                  struct dentry *unused, struct inode *inode,
+                                  const char *name, void *buffer, size_t size)
 {
-       return ocfs2_xattr_get(d_inode(dentry), OCFS2_XATTR_INDEX_TRUSTED,
+       return ocfs2_xattr_get(inode, OCFS2_XATTR_INDEX_TRUSTED,
                               name, buffer, size);
 }
 
@@ -7346,14 +7346,14 @@ const struct xattr_handler ocfs2_xattr_trusted_handler = {
  * 'user' attributes support
  */
 static int ocfs2_xattr_user_get(const struct xattr_handler *handler,
-                               struct dentry *dentry, const char *name,
-                               void *buffer, size_t size)
+                               struct dentry *unusde, struct inode *inode,
+                               const char *name, void *buffer, size_t size)
 {
-       struct ocfs2_super *osb = OCFS2_SB(dentry->d_sb);
+       struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
 
        if (osb->s_mount_opt & OCFS2_MOUNT_NOUSERXATTR)
                return -EOPNOTSUPP;
-       return ocfs2_xattr_get(d_inode(dentry), OCFS2_XATTR_INDEX_USER, name,
+       return ocfs2_xattr_get(inode, OCFS2_XATTR_INDEX_USER, name,
                               buffer, size);
 }
 
index ef5da7538cd5177f78c31542121ad36f2d24115e..6a4c0f7ce5c16b316133526d8c25ec629cc55aa7 100644 (file)
@@ -478,12 +478,13 @@ static int orangefs_xattr_set_default(const struct xattr_handler *handler,
 }
 
 static int orangefs_xattr_get_default(const struct xattr_handler *handler,
-                                     struct dentry *dentry,
+                                     struct dentry *unused,
+                                     struct inode *inode,
                                      const char *name,
                                      void *buffer,
                                      size_t size)
 {
-       return orangefs_inode_getxattr(dentry->d_inode,
+       return orangefs_inode_getxattr(inode,
                                    ORANGEFS_XATTR_NAME_DEFAULT_PREFIX,
                                    name,
                                    buffer,
@@ -507,12 +508,13 @@ static int orangefs_xattr_set_trusted(const struct xattr_handler *handler,
 }
 
 static int orangefs_xattr_get_trusted(const struct xattr_handler *handler,
-                                     struct dentry *dentry,
+                                     struct dentry *unused,
+                                     struct inode *inode,
                                      const char *name,
                                      void *buffer,
                                      size_t size)
 {
-       return orangefs_inode_getxattr(dentry->d_inode,
+       return orangefs_inode_getxattr(inode,
                                    ORANGEFS_XATTR_NAME_TRUSTED_PREFIX,
                                    name,
                                    buffer,
index db1fb0f5d9ff4e5db81a9dae7fffe6fe24a99924..2c60f17e7d923f654c3cd8e4aec1cbdc61ba386f 100644 (file)
@@ -797,18 +797,18 @@ EXPORT_SYMBOL (posix_acl_to_xattr);
 
 static int
 posix_acl_xattr_get(const struct xattr_handler *handler,
-                   struct dentry *dentry, const char *name,
-                   void *value, size_t size)
+                   struct dentry *unused, struct inode *inode,
+                   const char *name, void *value, size_t size)
 {
        struct posix_acl *acl;
        int error;
 
-       if (!IS_POSIXACL(d_backing_inode(dentry)))
+       if (!IS_POSIXACL(inode))
                return -EOPNOTSUPP;
-       if (d_is_symlink(dentry))
+       if (S_ISLNK(inode->i_mode))
                return -EOPNOTSUPP;
 
-       acl = get_acl(d_backing_inode(dentry), handler->flags);
+       acl = get_acl(inode, handler->flags);
        if (IS_ERR(acl))
                return PTR_ERR(acl);
        if (acl == NULL)
index ac7e104ada6bf6e1c24bfd1ec80de3162851e334..86aeb9dd805a9189073fe4e605d01d8103da36c4 100644 (file)
@@ -9,14 +9,13 @@
 #include <linux/uaccess.h>
 
 static int
-security_get(const struct xattr_handler *handler, struct dentry *dentry,
-            const char *name, void *buffer, size_t size)
+security_get(const struct xattr_handler *handler, struct dentry *unused,
+            struct inode *inode, const char *name, void *buffer, size_t size)
 {
-       if (IS_PRIVATE(d_inode(dentry)))
+       if (IS_PRIVATE(inode))
                return -EPERM;
 
-       return reiserfs_xattr_get(d_inode(dentry),
-                                 xattr_full_name(handler, name),
+       return reiserfs_xattr_get(inode, xattr_full_name(handler, name),
                                  buffer, size);
 }
 
index cc248a581b6095245c4acab359a6cb1a583923fe..31837f031f597d4f71b2a428058b20cd3024abca 100644 (file)
@@ -8,14 +8,13 @@
 #include <linux/uaccess.h>
 
 static int
-trusted_get(const struct xattr_handler *handler, struct dentry *dentry,
-           const char *name, void *buffer, size_t size)
+trusted_get(const struct xattr_handler *handler, struct dentry *unused,
+           struct inode *inode, const char *name, void *buffer, size_t size)
 {
-       if (!capable(CAP_SYS_ADMIN) || IS_PRIVATE(d_inode(dentry)))
+       if (!capable(CAP_SYS_ADMIN) || IS_PRIVATE(inode))
                return -EPERM;
 
-       return reiserfs_xattr_get(d_inode(dentry),
-                                 xattr_full_name(handler, name),
+       return reiserfs_xattr_get(inode, xattr_full_name(handler, name),
                                  buffer, size);
 }
 
index caad583086af0e326c3384117fe818d645f922dd..f7c39731684bcf9cb39ff8b54f68981ab2aa440a 100644 (file)
@@ -7,13 +7,12 @@
 #include <linux/uaccess.h>
 
 static int
-user_get(const struct xattr_handler *handler, struct dentry *dentry,
-        const char *name, void *buffer, size_t size)
+user_get(const struct xattr_handler *handler, struct dentry *unused,
+        struct inode *inode, const char *name, void *buffer, size_t size)
 {
-       if (!reiserfs_xattrs_user(dentry->d_sb))
+       if (!reiserfs_xattrs_user(inode->i_sb))
                return -EOPNOTSUPP;
-       return reiserfs_xattr_get(d_inode(dentry),
-                                 xattr_full_name(handler, name),
+       return reiserfs_xattr_get(inode, xattr_full_name(handler, name),
                                  buffer, size);
 }
 
index 1e9de96288d8f8ff106ff23a248b3f654569d0ca..1548b3784548df685de0bdebf9ab92969bb7752b 100644 (file)
@@ -214,10 +214,12 @@ failed:
 
 
 static int squashfs_xattr_handler_get(const struct xattr_handler *handler,
-                                     struct dentry *d, const char *name,
+                                     struct dentry *unused,
+                                     struct inode *inode,
+                                     const char *name,
                                      void *buffer, size_t size)
 {
-       return squashfs_xattr_get(d_inode(d), handler->flags, name,
+       return squashfs_xattr_get(inode, handler->flags, name,
                buffer, size);
 }
 
index 4861322e28e8da2154f46b7b92cbeda576ee1438..461ba45b7da9ab4a058f4d3bc1dbe550ffc79d14 100644 (file)
@@ -698,7 +698,8 @@ generic_getxattr(struct dentry *dentry, const char *name, void *buffer, size_t s
        handler = xattr_resolve_name(dentry->d_sb->s_xattr, &name);
        if (IS_ERR(handler))
                return PTR_ERR(handler);
-       return handler->get(handler, dentry, name, buffer, size);
+       return handler->get(handler, dentry, d_inode(dentry),
+                           name, buffer, size);
 }
 
 /*
index 110f1d7d86b0b4ab5a0fa72d8f752d5b29ea9e5f..d111f691f313fdc980a9d9e9f6519d9bd30e06a0 100644 (file)
 
 
 static int
-xfs_xattr_get(const struct xattr_handler *handler, struct dentry *dentry,
-               const char *name, void *value, size_t size)
+xfs_xattr_get(const struct xattr_handler *handler, struct dentry *unused,
+               struct inode *inode, const char *name, void *value, size_t size)
 {
        int xflags = handler->flags;
-       struct xfs_inode *ip = XFS_I(d_inode(dentry));
+       struct xfs_inode *ip = XFS_I(inode);
        int error, asize = size;
 
        /* Convert Linux syscall to XFS internal ATTR flags */
index 4457541de3c9be14997fe3b4631d60a32fcdb810..c11c022298b96b7336744177d7c0b888d0b3f14e 100644 (file)
@@ -30,7 +30,8 @@ struct xattr_handler {
        int flags;      /* fs private flags */
        bool (*list)(struct dentry *dentry);
        int (*get)(const struct xattr_handler *, struct dentry *dentry,
-                  const char *name, void *buffer, size_t size);
+                  struct inode *inode, const char *name, void *buffer,
+                  size_t size);
        int (*set)(const struct xattr_handler *, struct dentry *dentry,
                   const char *name, const void *buffer, size_t size,
                   int flags);
index 9428c51ab2d6b026ee9a10afc7e21c70e0a33d80..00d5d025eece0cae829b1470db660333eb99a639 100644 (file)
@@ -2646,10 +2646,10 @@ static int shmem_initxattrs(struct inode *inode,
 }
 
 static int shmem_xattr_handler_get(const struct xattr_handler *handler,
-                                  struct dentry *dentry, const char *name,
-                                  void *buffer, size_t size)
+                                  struct dentry *unused, struct inode *inode,
+                                  const char *name, void *buffer, size_t size)
 {
-       struct shmem_inode_info *info = SHMEM_I(d_inode(dentry));
+       struct shmem_inode_info *info = SHMEM_I(inode);
 
        name = xattr_full_name(handler, name);
        return simple_xattr_get(&info->xattrs, name, buffer, size);