diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-04-10 20:48:24 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-04-10 20:48:24 -0400 |
commit | b296821a7c42fa58baa17513b2b7b30ae66f3336 (patch) | |
tree | 5cb6593218b793ff77df1c21ea74b756af9c8540 | |
parent | 79a628d14ec7ee9adfdc3ce04343d5ff7ec20c18 (diff) |
xattr_handler: pass dentry and inode as separate arguments of ->get()
... and do not assume they are already attached to each other
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/9p/acl.c | 6 | ||||
-rw-r--r-- | fs/9p/xattr.c | 4 | ||||
-rw-r--r-- | fs/btrfs/xattr.c | 6 | ||||
-rw-r--r-- | fs/ext2/xattr_security.c | 6 | ||||
-rw-r--r-- | fs/ext2/xattr_trusted.c | 6 | ||||
-rw-r--r-- | fs/ext2/xattr_user.c | 8 | ||||
-rw-r--r-- | fs/ext4/xattr_security.c | 6 | ||||
-rw-r--r-- | fs/ext4/xattr_trusted.c | 6 | ||||
-rw-r--r-- | fs/ext4/xattr_user.c | 8 | ||||
-rw-r--r-- | fs/f2fs/xattr.c | 14 | ||||
-rw-r--r-- | fs/gfs2/xattr.c | 6 | ||||
-rw-r--r-- | fs/hfsplus/xattr.c | 10 | ||||
-rw-r--r-- | fs/hfsplus/xattr.h | 2 | ||||
-rw-r--r-- | fs/hfsplus/xattr_security.c | 6 | ||||
-rw-r--r-- | fs/hfsplus/xattr_trusted.c | 6 | ||||
-rw-r--r-- | fs/hfsplus/xattr_user.c | 6 | ||||
-rw-r--r-- | fs/jffs2/security.c | 6 | ||||
-rw-r--r-- | fs/jffs2/xattr_trusted.c | 6 | ||||
-rw-r--r-- | fs/jffs2/xattr_user.c | 6 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 12 | ||||
-rw-r--r-- | fs/ocfs2/xattr.c | 20 | ||||
-rw-r--r-- | fs/orangefs/xattr.c | 10 | ||||
-rw-r--r-- | fs/posix_acl.c | 10 | ||||
-rw-r--r-- | fs/reiserfs/xattr_security.c | 9 | ||||
-rw-r--r-- | fs/reiserfs/xattr_trusted.c | 9 | ||||
-rw-r--r-- | fs/reiserfs/xattr_user.c | 9 | ||||
-rw-r--r-- | fs/squashfs/xattr.c | 6 | ||||
-rw-r--r-- | fs/xattr.c | 3 | ||||
-rw-r--r-- | fs/xfs/xfs_xattr.c | 6 | ||||
-rw-r--r-- | include/linux/xattr.h | 3 | ||||
-rw-r--r-- | mm/shmem.c | 6 |
31 files changed, 113 insertions, 114 deletions
diff --git a/fs/9p/acl.c b/fs/9p/acl.c index 2d94e94b6b59..eb3589edf485 100644 --- a/fs/9p/acl.c +++ b/fs/9p/acl.c | |||
@@ -213,8 +213,8 @@ int v9fs_acl_mode(struct inode *dir, umode_t *modep, | |||
213 | } | 213 | } |
214 | 214 | ||
215 | static int v9fs_xattr_get_acl(const struct xattr_handler *handler, | 215 | static int v9fs_xattr_get_acl(const struct xattr_handler *handler, |
216 | struct dentry *dentry, const char *name, | 216 | struct dentry *dentry, struct inode *inode, |
217 | void *buffer, size_t size) | 217 | const char *name, void *buffer, size_t size) |
218 | { | 218 | { |
219 | struct v9fs_session_info *v9ses; | 219 | struct v9fs_session_info *v9ses; |
220 | struct posix_acl *acl; | 220 | struct posix_acl *acl; |
@@ -227,7 +227,7 @@ static int v9fs_xattr_get_acl(const struct xattr_handler *handler, | |||
227 | if ((v9ses->flags & V9FS_ACCESS_MASK) != V9FS_ACCESS_CLIENT) | 227 | if ((v9ses->flags & V9FS_ACCESS_MASK) != V9FS_ACCESS_CLIENT) |
228 | return v9fs_xattr_get(dentry, handler->name, buffer, size); | 228 | return v9fs_xattr_get(dentry, handler->name, buffer, size); |
229 | 229 | ||
230 | acl = v9fs_get_cached_acl(d_inode(dentry), handler->flags); | 230 | acl = v9fs_get_cached_acl(inode, handler->flags); |
231 | if (IS_ERR(acl)) | 231 | if (IS_ERR(acl)) |
232 | return PTR_ERR(acl); | 232 | return PTR_ERR(acl); |
233 | if (acl == NULL) | 233 | if (acl == NULL) |
diff --git a/fs/9p/xattr.c b/fs/9p/xattr.c index 9dd9b47a6c1a..18c62bae9591 100644 --- a/fs/9p/xattr.c +++ b/fs/9p/xattr.c | |||
@@ -138,8 +138,8 @@ ssize_t v9fs_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size) | |||
138 | } | 138 | } |
139 | 139 | ||
140 | static int v9fs_xattr_handler_get(const struct xattr_handler *handler, | 140 | static int v9fs_xattr_handler_get(const struct xattr_handler *handler, |
141 | struct dentry *dentry, const char *name, | 141 | struct dentry *dentry, struct inode *inode, |
142 | void *buffer, size_t size) | 142 | const char *name, void *buffer, size_t size) |
143 | { | 143 | { |
144 | const char *full_name = xattr_full_name(handler, name); | 144 | const char *full_name = xattr_full_name(handler, name); |
145 | 145 | ||
diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c index 145d2b89e62d..03224b00ea70 100644 --- a/fs/btrfs/xattr.c +++ b/fs/btrfs/xattr.c | |||
@@ -369,11 +369,9 @@ err: | |||
369 | } | 369 | } |
370 | 370 | ||
371 | static int btrfs_xattr_handler_get(const struct xattr_handler *handler, | 371 | static int btrfs_xattr_handler_get(const struct xattr_handler *handler, |
372 | struct dentry *dentry, const char *name, | 372 | struct dentry *unused, struct inode *inode, |
373 | void *buffer, size_t size) | 373 | const char *name, void *buffer, size_t size) |
374 | { | 374 | { |
375 | struct inode *inode = d_inode(dentry); | ||
376 | |||
377 | name = xattr_full_name(handler, name); | 375 | name = xattr_full_name(handler, name); |
378 | return __btrfs_getxattr(inode, name, buffer, size); | 376 | return __btrfs_getxattr(inode, name, buffer, size); |
379 | } | 377 | } |
diff --git a/fs/ext2/xattr_security.c b/fs/ext2/xattr_security.c index ba97f243b050..7fd3b867ce65 100644 --- a/fs/ext2/xattr_security.c +++ b/fs/ext2/xattr_security.c | |||
@@ -9,10 +9,10 @@ | |||
9 | 9 | ||
10 | static int | 10 | static int |
11 | ext2_xattr_security_get(const struct xattr_handler *handler, | 11 | ext2_xattr_security_get(const struct xattr_handler *handler, |
12 | struct dentry *dentry, const char *name, | 12 | struct dentry *unused, struct inode *inode, |
13 | void *buffer, size_t size) | 13 | const char *name, void *buffer, size_t size) |
14 | { | 14 | { |
15 | return ext2_xattr_get(d_inode(dentry), EXT2_XATTR_INDEX_SECURITY, name, | 15 | return ext2_xattr_get(inode, EXT2_XATTR_INDEX_SECURITY, name, |
16 | buffer, size); | 16 | buffer, size); |
17 | } | 17 | } |
18 | 18 | ||
diff --git a/fs/ext2/xattr_trusted.c b/fs/ext2/xattr_trusted.c index 2c94d1930626..0f85705ff519 100644 --- a/fs/ext2/xattr_trusted.c +++ b/fs/ext2/xattr_trusted.c | |||
@@ -16,10 +16,10 @@ ext2_xattr_trusted_list(struct dentry *dentry) | |||
16 | 16 | ||
17 | static int | 17 | static int |
18 | ext2_xattr_trusted_get(const struct xattr_handler *handler, | 18 | ext2_xattr_trusted_get(const struct xattr_handler *handler, |
19 | struct dentry *dentry, const char *name, | 19 | struct dentry *unused, struct inode *inode, |
20 | void *buffer, size_t size) | 20 | const char *name, void *buffer, size_t size) |
21 | { | 21 | { |
22 | return ext2_xattr_get(d_inode(dentry), EXT2_XATTR_INDEX_TRUSTED, name, | 22 | return ext2_xattr_get(inode, EXT2_XATTR_INDEX_TRUSTED, name, |
23 | buffer, size); | 23 | buffer, size); |
24 | } | 24 | } |
25 | 25 | ||
diff --git a/fs/ext2/xattr_user.c b/fs/ext2/xattr_user.c index 72a2a96d677f..1fafd27037cc 100644 --- a/fs/ext2/xattr_user.c +++ b/fs/ext2/xattr_user.c | |||
@@ -18,12 +18,12 @@ ext2_xattr_user_list(struct dentry *dentry) | |||
18 | 18 | ||
19 | static int | 19 | static int |
20 | ext2_xattr_user_get(const struct xattr_handler *handler, | 20 | ext2_xattr_user_get(const struct xattr_handler *handler, |
21 | struct dentry *dentry, const char *name, | 21 | struct dentry *unused, struct inode *inode, |
22 | void *buffer, size_t size) | 22 | const char *name, void *buffer, size_t size) |
23 | { | 23 | { |
24 | if (!test_opt(dentry->d_sb, XATTR_USER)) | 24 | if (!test_opt(inode->i_sb, XATTR_USER)) |
25 | return -EOPNOTSUPP; | 25 | return -EOPNOTSUPP; |
26 | return ext2_xattr_get(d_inode(dentry), EXT2_XATTR_INDEX_USER, | 26 | return ext2_xattr_get(inode, EXT2_XATTR_INDEX_USER, |
27 | name, buffer, size); | 27 | name, buffer, size); |
28 | } | 28 | } |
29 | 29 | ||
diff --git a/fs/ext4/xattr_security.c b/fs/ext4/xattr_security.c index 3e81bdca071a..123a7d010efe 100644 --- a/fs/ext4/xattr_security.c +++ b/fs/ext4/xattr_security.c | |||
@@ -13,10 +13,10 @@ | |||
13 | 13 | ||
14 | static int | 14 | static int |
15 | ext4_xattr_security_get(const struct xattr_handler *handler, | 15 | ext4_xattr_security_get(const struct xattr_handler *handler, |
16 | struct dentry *dentry, const char *name, | 16 | struct dentry *unused, struct inode *inode, |
17 | void *buffer, size_t size) | 17 | const char *name, void *buffer, size_t size) |
18 | { | 18 | { |
19 | return ext4_xattr_get(d_inode(dentry), EXT4_XATTR_INDEX_SECURITY, | 19 | return ext4_xattr_get(inode, EXT4_XATTR_INDEX_SECURITY, |
20 | name, buffer, size); | 20 | name, buffer, size); |
21 | } | 21 | } |
22 | 22 | ||
diff --git a/fs/ext4/xattr_trusted.c b/fs/ext4/xattr_trusted.c index 2a3c6f9b8cb8..60652fa24cbc 100644 --- a/fs/ext4/xattr_trusted.c +++ b/fs/ext4/xattr_trusted.c | |||
@@ -20,10 +20,10 @@ ext4_xattr_trusted_list(struct dentry *dentry) | |||
20 | 20 | ||
21 | static int | 21 | static int |
22 | ext4_xattr_trusted_get(const struct xattr_handler *handler, | 22 | ext4_xattr_trusted_get(const struct xattr_handler *handler, |
23 | struct dentry *dentry, const char *name, void *buffer, | 23 | struct dentry *unused, struct inode *inode, |
24 | size_t size) | 24 | const char *name, void *buffer, size_t size) |
25 | { | 25 | { |
26 | return ext4_xattr_get(d_inode(dentry), EXT4_XATTR_INDEX_TRUSTED, | 26 | return ext4_xattr_get(inode, EXT4_XATTR_INDEX_TRUSTED, |
27 | name, buffer, size); | 27 | name, buffer, size); |
28 | } | 28 | } |
29 | 29 | ||
diff --git a/fs/ext4/xattr_user.c b/fs/ext4/xattr_user.c index d152f431e432..17a446ffecd3 100644 --- a/fs/ext4/xattr_user.c +++ b/fs/ext4/xattr_user.c | |||
@@ -19,12 +19,12 @@ ext4_xattr_user_list(struct dentry *dentry) | |||
19 | 19 | ||
20 | static int | 20 | static int |
21 | ext4_xattr_user_get(const struct xattr_handler *handler, | 21 | ext4_xattr_user_get(const struct xattr_handler *handler, |
22 | struct dentry *dentry, const char *name, | 22 | struct dentry *unused, struct inode *inode, |
23 | void *buffer, size_t size) | 23 | const char *name, void *buffer, size_t size) |
24 | { | 24 | { |
25 | if (!test_opt(dentry->d_sb, XATTR_USER)) | 25 | if (!test_opt(inode->i_sb, XATTR_USER)) |
26 | return -EOPNOTSUPP; | 26 | return -EOPNOTSUPP; |
27 | return ext4_xattr_get(d_inode(dentry), EXT4_XATTR_INDEX_USER, | 27 | return ext4_xattr_get(inode, EXT4_XATTR_INDEX_USER, |
28 | name, buffer, size); | 28 | name, buffer, size); |
29 | } | 29 | } |
30 | 30 | ||
diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c index 06a72dc0191a..17fd2b1a6848 100644 --- a/fs/f2fs/xattr.c +++ b/fs/f2fs/xattr.c | |||
@@ -26,10 +26,10 @@ | |||
26 | #include "xattr.h" | 26 | #include "xattr.h" |
27 | 27 | ||
28 | static int f2fs_xattr_generic_get(const struct xattr_handler *handler, | 28 | static int f2fs_xattr_generic_get(const struct xattr_handler *handler, |
29 | struct dentry *dentry, const char *name, void *buffer, | 29 | struct dentry *unused, struct inode *inode, |
30 | size_t size) | 30 | const char *name, void *buffer, size_t size) |
31 | { | 31 | { |
32 | struct f2fs_sb_info *sbi = F2FS_SB(dentry->d_sb); | 32 | struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); |
33 | 33 | ||
34 | switch (handler->flags) { | 34 | switch (handler->flags) { |
35 | case F2FS_XATTR_INDEX_USER: | 35 | case F2FS_XATTR_INDEX_USER: |
@@ -45,7 +45,7 @@ static int f2fs_xattr_generic_get(const struct xattr_handler *handler, | |||
45 | default: | 45 | default: |
46 | return -EINVAL; | 46 | return -EINVAL; |
47 | } | 47 | } |
48 | return f2fs_getxattr(d_inode(dentry), handler->flags, name, | 48 | return f2fs_getxattr(inode, handler->flags, name, |
49 | buffer, size, NULL); | 49 | buffer, size, NULL); |
50 | } | 50 | } |
51 | 51 | ||
@@ -86,11 +86,9 @@ static bool f2fs_xattr_trusted_list(struct dentry *dentry) | |||
86 | } | 86 | } |
87 | 87 | ||
88 | static int f2fs_xattr_advise_get(const struct xattr_handler *handler, | 88 | static int f2fs_xattr_advise_get(const struct xattr_handler *handler, |
89 | struct dentry *dentry, const char *name, void *buffer, | 89 | struct dentry *unused, struct inode *inode, |
90 | size_t size) | 90 | const char *name, void *buffer, size_t size) |
91 | { | 91 | { |
92 | struct inode *inode = d_inode(dentry); | ||
93 | |||
94 | if (buffer) | 92 | if (buffer) |
95 | *((char *)buffer) = F2FS_I(inode)->i_advise; | 93 | *((char *)buffer) = F2FS_I(inode)->i_advise; |
96 | return sizeof(char); | 94 | return sizeof(char); |
diff --git a/fs/gfs2/xattr.c b/fs/gfs2/xattr.c index e8dfb4740c04..619886ba6e78 100644 --- a/fs/gfs2/xattr.c +++ b/fs/gfs2/xattr.c | |||
@@ -584,10 +584,10 @@ out: | |||
584 | * Returns: actual size of data on success, -errno on error | 584 | * Returns: actual size of data on success, -errno on error |
585 | */ | 585 | */ |
586 | static int gfs2_xattr_get(const struct xattr_handler *handler, | 586 | static int gfs2_xattr_get(const struct xattr_handler *handler, |
587 | struct dentry *dentry, const char *name, | 587 | struct dentry *unused, struct inode *inode, |
588 | void *buffer, size_t size) | 588 | const char *name, void *buffer, size_t size) |
589 | { | 589 | { |
590 | struct gfs2_inode *ip = GFS2_I(d_inode(dentry)); | 590 | struct gfs2_inode *ip = GFS2_I(inode); |
591 | struct gfs2_ea_location el; | 591 | struct gfs2_ea_location el; |
592 | int type = handler->flags; | 592 | int type = handler->flags; |
593 | int error; | 593 | int error; |
diff --git a/fs/hfsplus/xattr.c b/fs/hfsplus/xattr.c index ab01530b4930..45dc4ae3791a 100644 --- a/fs/hfsplus/xattr.c +++ b/fs/hfsplus/xattr.c | |||
@@ -579,7 +579,7 @@ failed_getxattr_init: | |||
579 | return res; | 579 | return res; |
580 | } | 580 | } |
581 | 581 | ||
582 | ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name, | 582 | ssize_t hfsplus_getxattr(struct inode *inode, const char *name, |
583 | void *value, size_t size, | 583 | void *value, size_t size, |
584 | const char *prefix, size_t prefixlen) | 584 | const char *prefix, size_t prefixlen) |
585 | { | 585 | { |
@@ -594,7 +594,7 @@ ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name, | |||
594 | strcpy(xattr_name, prefix); | 594 | strcpy(xattr_name, prefix); |
595 | strcpy(xattr_name + prefixlen, name); | 595 | strcpy(xattr_name + prefixlen, name); |
596 | 596 | ||
597 | res = __hfsplus_getxattr(d_inode(dentry), xattr_name, value, size); | 597 | res = __hfsplus_getxattr(inode, xattr_name, value, size); |
598 | kfree(xattr_name); | 598 | kfree(xattr_name); |
599 | return res; | 599 | return res; |
600 | 600 | ||
@@ -844,8 +844,8 @@ end_removexattr: | |||
844 | } | 844 | } |
845 | 845 | ||
846 | static int hfsplus_osx_getxattr(const struct xattr_handler *handler, | 846 | static int hfsplus_osx_getxattr(const struct xattr_handler *handler, |
847 | struct dentry *dentry, const char *name, | 847 | struct dentry *unused, struct inode *inode, |
848 | void *buffer, size_t size) | 848 | const char *name, void *buffer, size_t size) |
849 | { | 849 | { |
850 | /* | 850 | /* |
851 | * Don't allow retrieving properly prefixed attributes | 851 | * Don't allow retrieving properly prefixed attributes |
@@ -860,7 +860,7 @@ static int hfsplus_osx_getxattr(const struct xattr_handler *handler, | |||
860 | * creates), so we pass the name through unmodified (after | 860 | * creates), so we pass the name through unmodified (after |
861 | * ensuring it doesn't conflict with another namespace). | 861 | * ensuring it doesn't conflict with another namespace). |
862 | */ | 862 | */ |
863 | return __hfsplus_getxattr(d_inode(dentry), name, buffer, size); | 863 | return __hfsplus_getxattr(inode, name, buffer, size); |
864 | } | 864 | } |
865 | 865 | ||
866 | static int hfsplus_osx_setxattr(const struct xattr_handler *handler, | 866 | static int hfsplus_osx_setxattr(const struct xattr_handler *handler, |
diff --git a/fs/hfsplus/xattr.h b/fs/hfsplus/xattr.h index f9b0955b3d28..d04ba6f58df2 100644 --- a/fs/hfsplus/xattr.h +++ b/fs/hfsplus/xattr.h | |||
@@ -28,7 +28,7 @@ int hfsplus_setxattr(struct dentry *dentry, const char *name, | |||
28 | ssize_t __hfsplus_getxattr(struct inode *inode, const char *name, | 28 | ssize_t __hfsplus_getxattr(struct inode *inode, const char *name, |
29 | void *value, size_t size); | 29 | void *value, size_t size); |
30 | 30 | ||
31 | ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name, | 31 | ssize_t hfsplus_getxattr(struct inode *inode, const char *name, |
32 | void *value, size_t size, | 32 | void *value, size_t size, |
33 | const char *prefix, size_t prefixlen); | 33 | const char *prefix, size_t prefixlen); |
34 | 34 | ||
diff --git a/fs/hfsplus/xattr_security.c b/fs/hfsplus/xattr_security.c index 72a68a3a0c99..ae2ca8c2e335 100644 --- a/fs/hfsplus/xattr_security.c +++ b/fs/hfsplus/xattr_security.c | |||
@@ -14,10 +14,10 @@ | |||
14 | #include "acl.h" | 14 | #include "acl.h" |
15 | 15 | ||
16 | static int hfsplus_security_getxattr(const struct xattr_handler *handler, | 16 | static int hfsplus_security_getxattr(const struct xattr_handler *handler, |
17 | struct dentry *dentry, const char *name, | 17 | struct dentry *unused, struct inode *inode, |
18 | void *buffer, size_t size) | 18 | const char *name, void *buffer, size_t size) |
19 | { | 19 | { |
20 | return hfsplus_getxattr(dentry, name, buffer, size, | 20 | return hfsplus_getxattr(inode, name, buffer, size, |
21 | XATTR_SECURITY_PREFIX, | 21 | XATTR_SECURITY_PREFIX, |
22 | XATTR_SECURITY_PREFIX_LEN); | 22 | XATTR_SECURITY_PREFIX_LEN); |
23 | } | 23 | } |
diff --git a/fs/hfsplus/xattr_trusted.c b/fs/hfsplus/xattr_trusted.c index 95a7704c7abb..eae2947060aa 100644 --- a/fs/hfsplus/xattr_trusted.c +++ b/fs/hfsplus/xattr_trusted.c | |||
@@ -12,10 +12,10 @@ | |||
12 | #include "xattr.h" | 12 | #include "xattr.h" |
13 | 13 | ||
14 | static int hfsplus_trusted_getxattr(const struct xattr_handler *handler, | 14 | static int hfsplus_trusted_getxattr(const struct xattr_handler *handler, |
15 | struct dentry *dentry, const char *name, | 15 | struct dentry *unused, struct inode *inode, |
16 | void *buffer, size_t size) | 16 | const char *name, void *buffer, size_t size) |
17 | { | 17 | { |
18 | return hfsplus_getxattr(dentry, name, buffer, size, | 18 | return hfsplus_getxattr(inode, name, buffer, size, |
19 | XATTR_TRUSTED_PREFIX, | 19 | XATTR_TRUSTED_PREFIX, |
20 | XATTR_TRUSTED_PREFIX_LEN); | 20 | XATTR_TRUSTED_PREFIX_LEN); |
21 | } | 21 | } |
diff --git a/fs/hfsplus/xattr_user.c b/fs/hfsplus/xattr_user.c index 6fc269baf959..3c9eec3e4c7b 100644 --- a/fs/hfsplus/xattr_user.c +++ b/fs/hfsplus/xattr_user.c | |||
@@ -12,11 +12,11 @@ | |||
12 | #include "xattr.h" | 12 | #include "xattr.h" |
13 | 13 | ||
14 | static int hfsplus_user_getxattr(const struct xattr_handler *handler, | 14 | static int hfsplus_user_getxattr(const struct xattr_handler *handler, |
15 | struct dentry *dentry, const char *name, | 15 | struct dentry *unused, struct inode *inode, |
16 | void *buffer, size_t size) | 16 | const char *name, void *buffer, size_t size) |
17 | { | 17 | { |
18 | 18 | ||
19 | return hfsplus_getxattr(dentry, name, buffer, size, | 19 | return hfsplus_getxattr(inode, name, buffer, size, |
20 | XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN); | 20 | XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN); |
21 | } | 21 | } |
22 | 22 | ||
diff --git a/fs/jffs2/security.c b/fs/jffs2/security.c index 7a28facd7175..3ed9a4b49778 100644 --- a/fs/jffs2/security.c +++ b/fs/jffs2/security.c | |||
@@ -49,10 +49,10 @@ int jffs2_init_security(struct inode *inode, struct inode *dir, | |||
49 | 49 | ||
50 | /* ---- XATTR Handler for "security.*" ----------------- */ | 50 | /* ---- XATTR Handler for "security.*" ----------------- */ |
51 | static int jffs2_security_getxattr(const struct xattr_handler *handler, | 51 | static int jffs2_security_getxattr(const struct xattr_handler *handler, |
52 | struct dentry *dentry, const char *name, | 52 | struct dentry *unused, struct inode *inode, |
53 | void *buffer, size_t size) | 53 | const char *name, void *buffer, size_t size) |
54 | { | 54 | { |
55 | return do_jffs2_getxattr(d_inode(dentry), JFFS2_XPREFIX_SECURITY, | 55 | return do_jffs2_getxattr(inode, JFFS2_XPREFIX_SECURITY, |
56 | name, buffer, size); | 56 | name, buffer, size); |
57 | } | 57 | } |
58 | 58 | ||
diff --git a/fs/jffs2/xattr_trusted.c b/fs/jffs2/xattr_trusted.c index b2555ef07a12..4ebecff1d922 100644 --- a/fs/jffs2/xattr_trusted.c +++ b/fs/jffs2/xattr_trusted.c | |||
@@ -17,10 +17,10 @@ | |||
17 | #include "nodelist.h" | 17 | #include "nodelist.h" |
18 | 18 | ||
19 | static int jffs2_trusted_getxattr(const struct xattr_handler *handler, | 19 | static int jffs2_trusted_getxattr(const struct xattr_handler *handler, |
20 | struct dentry *dentry, const char *name, | 20 | struct dentry *unused, struct inode *inode, |
21 | void *buffer, size_t size) | 21 | const char *name, void *buffer, size_t size) |
22 | { | 22 | { |
23 | return do_jffs2_getxattr(d_inode(dentry), JFFS2_XPREFIX_TRUSTED, | 23 | return do_jffs2_getxattr(inode, JFFS2_XPREFIX_TRUSTED, |
24 | name, buffer, size); | 24 | name, buffer, size); |
25 | } | 25 | } |
26 | 26 | ||
diff --git a/fs/jffs2/xattr_user.c b/fs/jffs2/xattr_user.c index 539bd630b5e4..bce249e1b277 100644 --- a/fs/jffs2/xattr_user.c +++ b/fs/jffs2/xattr_user.c | |||
@@ -17,10 +17,10 @@ | |||
17 | #include "nodelist.h" | 17 | #include "nodelist.h" |
18 | 18 | ||
19 | static int jffs2_user_getxattr(const struct xattr_handler *handler, | 19 | static int jffs2_user_getxattr(const struct xattr_handler *handler, |
20 | struct dentry *dentry, const char *name, | 20 | struct dentry *unused, struct inode *inode, |
21 | void *buffer, size_t size) | 21 | const char *name, void *buffer, size_t size) |
22 | { | 22 | { |
23 | return do_jffs2_getxattr(d_inode(dentry), JFFS2_XPREFIX_USER, | 23 | return do_jffs2_getxattr(inode, JFFS2_XPREFIX_USER, |
24 | name, buffer, size); | 24 | name, buffer, size); |
25 | } | 25 | } |
26 | 26 | ||
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 327b8c34d360..7a7ac1dafa02 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -6263,10 +6263,10 @@ static int nfs4_xattr_set_nfs4_acl(const struct xattr_handler *handler, | |||
6263 | } | 6263 | } |
6264 | 6264 | ||
6265 | static int nfs4_xattr_get_nfs4_acl(const struct xattr_handler *handler, | 6265 | static int nfs4_xattr_get_nfs4_acl(const struct xattr_handler *handler, |
6266 | struct dentry *dentry, const char *key, | 6266 | struct dentry *unused, struct inode *inode, |
6267 | void *buf, size_t buflen) | 6267 | const char *key, void *buf, size_t buflen) |
6268 | { | 6268 | { |
6269 | return nfs4_proc_get_acl(d_inode(dentry), buf, buflen); | 6269 | return nfs4_proc_get_acl(inode, buf, buflen); |
6270 | } | 6270 | } |
6271 | 6271 | ||
6272 | static bool nfs4_xattr_list_nfs4_acl(struct dentry *dentry) | 6272 | 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, | |||
6288 | } | 6288 | } |
6289 | 6289 | ||
6290 | static int nfs4_xattr_get_nfs4_label(const struct xattr_handler *handler, | 6290 | static int nfs4_xattr_get_nfs4_label(const struct xattr_handler *handler, |
6291 | struct dentry *dentry, const char *key, | 6291 | struct dentry *unused, struct inode *inode, |
6292 | void *buf, size_t buflen) | 6292 | const char *key, void *buf, size_t buflen) |
6293 | { | 6293 | { |
6294 | if (security_ismaclabel(key)) | 6294 | if (security_ismaclabel(key)) |
6295 | return nfs4_get_security_label(d_inode(dentry), buf, buflen); | 6295 | return nfs4_get_security_label(inode, buf, buflen); |
6296 | return -EOPNOTSUPP; | 6296 | return -EOPNOTSUPP; |
6297 | } | 6297 | } |
6298 | 6298 | ||
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 7d3d979f57d9..72eef4cfe8a9 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -7250,10 +7250,10 @@ leave: | |||
7250 | * 'security' attributes support | 7250 | * 'security' attributes support |
7251 | */ | 7251 | */ |
7252 | static int ocfs2_xattr_security_get(const struct xattr_handler *handler, | 7252 | static int ocfs2_xattr_security_get(const struct xattr_handler *handler, |
7253 | struct dentry *dentry, const char *name, | 7253 | struct dentry *unused, struct inode *inode, |
7254 | void *buffer, size_t size) | 7254 | const char *name, void *buffer, size_t size) |
7255 | { | 7255 | { |
7256 | return ocfs2_xattr_get(d_inode(dentry), OCFS2_XATTR_INDEX_SECURITY, | 7256 | return ocfs2_xattr_get(inode, OCFS2_XATTR_INDEX_SECURITY, |
7257 | name, buffer, size); | 7257 | name, buffer, size); |
7258 | } | 7258 | } |
7259 | 7259 | ||
@@ -7321,10 +7321,10 @@ const struct xattr_handler ocfs2_xattr_security_handler = { | |||
7321 | * 'trusted' attributes support | 7321 | * 'trusted' attributes support |
7322 | */ | 7322 | */ |
7323 | static int ocfs2_xattr_trusted_get(const struct xattr_handler *handler, | 7323 | static int ocfs2_xattr_trusted_get(const struct xattr_handler *handler, |
7324 | struct dentry *dentry, const char *name, | 7324 | struct dentry *unused, struct inode *inode, |
7325 | void *buffer, size_t size) | 7325 | const char *name, void *buffer, size_t size) |
7326 | { | 7326 | { |
7327 | return ocfs2_xattr_get(d_inode(dentry), OCFS2_XATTR_INDEX_TRUSTED, | 7327 | return ocfs2_xattr_get(inode, OCFS2_XATTR_INDEX_TRUSTED, |
7328 | name, buffer, size); | 7328 | name, buffer, size); |
7329 | } | 7329 | } |
7330 | 7330 | ||
@@ -7346,14 +7346,14 @@ const struct xattr_handler ocfs2_xattr_trusted_handler = { | |||
7346 | * 'user' attributes support | 7346 | * 'user' attributes support |
7347 | */ | 7347 | */ |
7348 | static int ocfs2_xattr_user_get(const struct xattr_handler *handler, | 7348 | static int ocfs2_xattr_user_get(const struct xattr_handler *handler, |
7349 | struct dentry *dentry, const char *name, | 7349 | struct dentry *unusde, struct inode *inode, |
7350 | void *buffer, size_t size) | 7350 | const char *name, void *buffer, size_t size) |
7351 | { | 7351 | { |
7352 | struct ocfs2_super *osb = OCFS2_SB(dentry->d_sb); | 7352 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
7353 | 7353 | ||
7354 | if (osb->s_mount_opt & OCFS2_MOUNT_NOUSERXATTR) | 7354 | if (osb->s_mount_opt & OCFS2_MOUNT_NOUSERXATTR) |
7355 | return -EOPNOTSUPP; | 7355 | return -EOPNOTSUPP; |
7356 | return ocfs2_xattr_get(d_inode(dentry), OCFS2_XATTR_INDEX_USER, name, | 7356 | return ocfs2_xattr_get(inode, OCFS2_XATTR_INDEX_USER, name, |
7357 | buffer, size); | 7357 | buffer, size); |
7358 | } | 7358 | } |
7359 | 7359 | ||
diff --git a/fs/orangefs/xattr.c b/fs/orangefs/xattr.c index ef5da7538cd5..6a4c0f7ce5c1 100644 --- a/fs/orangefs/xattr.c +++ b/fs/orangefs/xattr.c | |||
@@ -478,12 +478,13 @@ static int orangefs_xattr_set_default(const struct xattr_handler *handler, | |||
478 | } | 478 | } |
479 | 479 | ||
480 | static int orangefs_xattr_get_default(const struct xattr_handler *handler, | 480 | static int orangefs_xattr_get_default(const struct xattr_handler *handler, |
481 | struct dentry *dentry, | 481 | struct dentry *unused, |
482 | struct inode *inode, | ||
482 | const char *name, | 483 | const char *name, |
483 | void *buffer, | 484 | void *buffer, |
484 | size_t size) | 485 | size_t size) |
485 | { | 486 | { |
486 | return orangefs_inode_getxattr(dentry->d_inode, | 487 | return orangefs_inode_getxattr(inode, |
487 | ORANGEFS_XATTR_NAME_DEFAULT_PREFIX, | 488 | ORANGEFS_XATTR_NAME_DEFAULT_PREFIX, |
488 | name, | 489 | name, |
489 | buffer, | 490 | buffer, |
@@ -507,12 +508,13 @@ static int orangefs_xattr_set_trusted(const struct xattr_handler *handler, | |||
507 | } | 508 | } |
508 | 509 | ||
509 | static int orangefs_xattr_get_trusted(const struct xattr_handler *handler, | 510 | static int orangefs_xattr_get_trusted(const struct xattr_handler *handler, |
510 | struct dentry *dentry, | 511 | struct dentry *unused, |
512 | struct inode *inode, | ||
511 | const char *name, | 513 | const char *name, |
512 | void *buffer, | 514 | void *buffer, |
513 | size_t size) | 515 | size_t size) |
514 | { | 516 | { |
515 | return orangefs_inode_getxattr(dentry->d_inode, | 517 | return orangefs_inode_getxattr(inode, |
516 | ORANGEFS_XATTR_NAME_TRUSTED_PREFIX, | 518 | ORANGEFS_XATTR_NAME_TRUSTED_PREFIX, |
517 | name, | 519 | name, |
518 | buffer, | 520 | buffer, |
diff --git a/fs/posix_acl.c b/fs/posix_acl.c index db1fb0f5d9ff..2c60f17e7d92 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c | |||
@@ -797,18 +797,18 @@ EXPORT_SYMBOL (posix_acl_to_xattr); | |||
797 | 797 | ||
798 | static int | 798 | static int |
799 | posix_acl_xattr_get(const struct xattr_handler *handler, | 799 | posix_acl_xattr_get(const struct xattr_handler *handler, |
800 | struct dentry *dentry, const char *name, | 800 | struct dentry *unused, struct inode *inode, |
801 | void *value, size_t size) | 801 | const char *name, void *value, size_t size) |
802 | { | 802 | { |
803 | struct posix_acl *acl; | 803 | struct posix_acl *acl; |
804 | int error; | 804 | int error; |
805 | 805 | ||
806 | if (!IS_POSIXACL(d_backing_inode(dentry))) | 806 | if (!IS_POSIXACL(inode)) |
807 | return -EOPNOTSUPP; | 807 | return -EOPNOTSUPP; |
808 | if (d_is_symlink(dentry)) | 808 | if (S_ISLNK(inode->i_mode)) |
809 | return -EOPNOTSUPP; | 809 | return -EOPNOTSUPP; |
810 | 810 | ||
811 | acl = get_acl(d_backing_inode(dentry), handler->flags); | 811 | acl = get_acl(inode, handler->flags); |
812 | if (IS_ERR(acl)) | 812 | if (IS_ERR(acl)) |
813 | return PTR_ERR(acl); | 813 | return PTR_ERR(acl); |
814 | if (acl == NULL) | 814 | if (acl == NULL) |
diff --git a/fs/reiserfs/xattr_security.c b/fs/reiserfs/xattr_security.c index ac7e104ada6b..86aeb9dd805a 100644 --- a/fs/reiserfs/xattr_security.c +++ b/fs/reiserfs/xattr_security.c | |||
@@ -9,14 +9,13 @@ | |||
9 | #include <linux/uaccess.h> | 9 | #include <linux/uaccess.h> |
10 | 10 | ||
11 | static int | 11 | static int |
12 | security_get(const struct xattr_handler *handler, struct dentry *dentry, | 12 | security_get(const struct xattr_handler *handler, struct dentry *unused, |
13 | const char *name, void *buffer, size_t size) | 13 | struct inode *inode, const char *name, void *buffer, size_t size) |
14 | { | 14 | { |
15 | if (IS_PRIVATE(d_inode(dentry))) | 15 | if (IS_PRIVATE(inode)) |
16 | return -EPERM; | 16 | return -EPERM; |
17 | 17 | ||
18 | return reiserfs_xattr_get(d_inode(dentry), | 18 | return reiserfs_xattr_get(inode, xattr_full_name(handler, name), |
19 | xattr_full_name(handler, name), | ||
20 | buffer, size); | 19 | buffer, size); |
21 | } | 20 | } |
22 | 21 | ||
diff --git a/fs/reiserfs/xattr_trusted.c b/fs/reiserfs/xattr_trusted.c index cc248a581b60..31837f031f59 100644 --- a/fs/reiserfs/xattr_trusted.c +++ b/fs/reiserfs/xattr_trusted.c | |||
@@ -8,14 +8,13 @@ | |||
8 | #include <linux/uaccess.h> | 8 | #include <linux/uaccess.h> |
9 | 9 | ||
10 | static int | 10 | static int |
11 | trusted_get(const struct xattr_handler *handler, struct dentry *dentry, | 11 | trusted_get(const struct xattr_handler *handler, struct dentry *unused, |
12 | const char *name, void *buffer, size_t size) | 12 | struct inode *inode, const char *name, void *buffer, size_t size) |
13 | { | 13 | { |
14 | if (!capable(CAP_SYS_ADMIN) || IS_PRIVATE(d_inode(dentry))) | 14 | if (!capable(CAP_SYS_ADMIN) || IS_PRIVATE(inode)) |
15 | return -EPERM; | 15 | return -EPERM; |
16 | 16 | ||
17 | return reiserfs_xattr_get(d_inode(dentry), | 17 | return reiserfs_xattr_get(inode, xattr_full_name(handler, name), |
18 | xattr_full_name(handler, name), | ||
19 | buffer, size); | 18 | buffer, size); |
20 | } | 19 | } |
21 | 20 | ||
diff --git a/fs/reiserfs/xattr_user.c b/fs/reiserfs/xattr_user.c index caad583086af..f7c39731684b 100644 --- a/fs/reiserfs/xattr_user.c +++ b/fs/reiserfs/xattr_user.c | |||
@@ -7,13 +7,12 @@ | |||
7 | #include <linux/uaccess.h> | 7 | #include <linux/uaccess.h> |
8 | 8 | ||
9 | static int | 9 | static int |
10 | user_get(const struct xattr_handler *handler, struct dentry *dentry, | 10 | user_get(const struct xattr_handler *handler, struct dentry *unused, |
11 | const char *name, void *buffer, size_t size) | 11 | struct inode *inode, const char *name, void *buffer, size_t size) |
12 | { | 12 | { |
13 | if (!reiserfs_xattrs_user(dentry->d_sb)) | 13 | if (!reiserfs_xattrs_user(inode->i_sb)) |
14 | return -EOPNOTSUPP; | 14 | return -EOPNOTSUPP; |
15 | return reiserfs_xattr_get(d_inode(dentry), | 15 | return reiserfs_xattr_get(inode, xattr_full_name(handler, name), |
16 | xattr_full_name(handler, name), | ||
17 | buffer, size); | 16 | buffer, size); |
18 | } | 17 | } |
19 | 18 | ||
diff --git a/fs/squashfs/xattr.c b/fs/squashfs/xattr.c index 1e9de96288d8..1548b3784548 100644 --- a/fs/squashfs/xattr.c +++ b/fs/squashfs/xattr.c | |||
@@ -214,10 +214,12 @@ failed: | |||
214 | 214 | ||
215 | 215 | ||
216 | static int squashfs_xattr_handler_get(const struct xattr_handler *handler, | 216 | static int squashfs_xattr_handler_get(const struct xattr_handler *handler, |
217 | struct dentry *d, const char *name, | 217 | struct dentry *unused, |
218 | struct inode *inode, | ||
219 | const char *name, | ||
218 | void *buffer, size_t size) | 220 | void *buffer, size_t size) |
219 | { | 221 | { |
220 | return squashfs_xattr_get(d_inode(d), handler->flags, name, | 222 | return squashfs_xattr_get(inode, handler->flags, name, |
221 | buffer, size); | 223 | buffer, size); |
222 | } | 224 | } |
223 | 225 | ||
diff --git a/fs/xattr.c b/fs/xattr.c index 4861322e28e8..461ba45b7da9 100644 --- a/fs/xattr.c +++ b/fs/xattr.c | |||
@@ -698,7 +698,8 @@ generic_getxattr(struct dentry *dentry, const char *name, void *buffer, size_t s | |||
698 | handler = xattr_resolve_name(dentry->d_sb->s_xattr, &name); | 698 | handler = xattr_resolve_name(dentry->d_sb->s_xattr, &name); |
699 | if (IS_ERR(handler)) | 699 | if (IS_ERR(handler)) |
700 | return PTR_ERR(handler); | 700 | return PTR_ERR(handler); |
701 | return handler->get(handler, dentry, name, buffer, size); | 701 | return handler->get(handler, dentry, d_inode(dentry), |
702 | name, buffer, size); | ||
702 | } | 703 | } |
703 | 704 | ||
704 | /* | 705 | /* |
diff --git a/fs/xfs/xfs_xattr.c b/fs/xfs/xfs_xattr.c index 110f1d7d86b0..d111f691f313 100644 --- a/fs/xfs/xfs_xattr.c +++ b/fs/xfs/xfs_xattr.c | |||
@@ -32,11 +32,11 @@ | |||
32 | 32 | ||
33 | 33 | ||
34 | static int | 34 | static int |
35 | xfs_xattr_get(const struct xattr_handler *handler, struct dentry *dentry, | 35 | xfs_xattr_get(const struct xattr_handler *handler, struct dentry *unused, |
36 | const char *name, void *value, size_t size) | 36 | struct inode *inode, const char *name, void *value, size_t size) |
37 | { | 37 | { |
38 | int xflags = handler->flags; | 38 | int xflags = handler->flags; |
39 | struct xfs_inode *ip = XFS_I(d_inode(dentry)); | 39 | struct xfs_inode *ip = XFS_I(inode); |
40 | int error, asize = size; | 40 | int error, asize = size; |
41 | 41 | ||
42 | /* Convert Linux syscall to XFS internal ATTR flags */ | 42 | /* Convert Linux syscall to XFS internal ATTR flags */ |
diff --git a/include/linux/xattr.h b/include/linux/xattr.h index 4457541de3c9..c11c022298b9 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h | |||
@@ -30,7 +30,8 @@ struct xattr_handler { | |||
30 | int flags; /* fs private flags */ | 30 | int flags; /* fs private flags */ |
31 | bool (*list)(struct dentry *dentry); | 31 | bool (*list)(struct dentry *dentry); |
32 | int (*get)(const struct xattr_handler *, struct dentry *dentry, | 32 | int (*get)(const struct xattr_handler *, struct dentry *dentry, |
33 | const char *name, void *buffer, size_t size); | 33 | struct inode *inode, const char *name, void *buffer, |
34 | size_t size); | ||
34 | int (*set)(const struct xattr_handler *, struct dentry *dentry, | 35 | int (*set)(const struct xattr_handler *, struct dentry *dentry, |
35 | const char *name, const void *buffer, size_t size, | 36 | const char *name, const void *buffer, size_t size, |
36 | int flags); | 37 | int flags); |
diff --git a/mm/shmem.c b/mm/shmem.c index 9428c51ab2d6..00d5d025eece 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -2646,10 +2646,10 @@ static int shmem_initxattrs(struct inode *inode, | |||
2646 | } | 2646 | } |
2647 | 2647 | ||
2648 | static int shmem_xattr_handler_get(const struct xattr_handler *handler, | 2648 | static int shmem_xattr_handler_get(const struct xattr_handler *handler, |
2649 | struct dentry *dentry, const char *name, | 2649 | struct dentry *unused, struct inode *inode, |
2650 | void *buffer, size_t size) | 2650 | const char *name, void *buffer, size_t size) |
2651 | { | 2651 | { |
2652 | struct shmem_inode_info *info = SHMEM_I(d_inode(dentry)); | 2652 | struct shmem_inode_info *info = SHMEM_I(inode); |
2653 | 2653 | ||
2654 | name = xattr_full_name(handler, name); | 2654 | name = xattr_full_name(handler, name); |
2655 | return simple_xattr_get(&info->xattrs, name, buffer, size); | 2655 | return simple_xattr_get(&info->xattrs, name, buffer, size); |