diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-05-27 10:19:30 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-05-27 15:39:43 -0400 |
commit | 5930122683dff58f0846b0f0405b4bd598a3ba6a (patch) | |
tree | e7823a7eefaafb7b6ddc61a7ccc1a1892998310f | |
parent | 002354112f1e3cc7400ef48b853aefb90e801588 (diff) |
switch xattr_handler->set() to passing dentry and inode separately
preparation for similar switch in ->setxattr() (see the next commit for
rationale).
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
34 files changed, 156 insertions, 135 deletions
diff --git a/fs/9p/acl.c b/fs/9p/acl.c index eb3589edf485..0576eaeb60b9 100644 --- a/fs/9p/acl.c +++ b/fs/9p/acl.c | |||
@@ -239,13 +239,13 @@ static int v9fs_xattr_get_acl(const struct xattr_handler *handler, | |||
239 | } | 239 | } |
240 | 240 | ||
241 | static int v9fs_xattr_set_acl(const struct xattr_handler *handler, | 241 | static int v9fs_xattr_set_acl(const struct xattr_handler *handler, |
242 | struct dentry *dentry, const char *name, | 242 | struct dentry *dentry, struct inode *inode, |
243 | const void *value, size_t size, int flags) | 243 | const char *name, const void *value, |
244 | size_t size, int flags) | ||
244 | { | 245 | { |
245 | int retval; | 246 | int retval; |
246 | struct posix_acl *acl; | 247 | struct posix_acl *acl; |
247 | struct v9fs_session_info *v9ses; | 248 | struct v9fs_session_info *v9ses; |
248 | struct inode *inode = d_inode(dentry); | ||
249 | 249 | ||
250 | v9ses = v9fs_dentry2v9ses(dentry); | 250 | v9ses = v9fs_dentry2v9ses(dentry); |
251 | /* | 251 | /* |
diff --git a/fs/9p/xattr.c b/fs/9p/xattr.c index 18c62bae9591..a6bd349bab23 100644 --- a/fs/9p/xattr.c +++ b/fs/9p/xattr.c | |||
@@ -147,8 +147,9 @@ static int v9fs_xattr_handler_get(const struct xattr_handler *handler, | |||
147 | } | 147 | } |
148 | 148 | ||
149 | static int v9fs_xattr_handler_set(const struct xattr_handler *handler, | 149 | static int v9fs_xattr_handler_set(const struct xattr_handler *handler, |
150 | struct dentry *dentry, const char *name, | 150 | struct dentry *dentry, struct inode *inode, |
151 | const void *value, size_t size, int flags) | 151 | const char *name, const void *value, |
152 | size_t size, int flags) | ||
152 | { | 153 | { |
153 | const char *full_name = xattr_full_name(handler, name); | 154 | const char *full_name = xattr_full_name(handler, name); |
154 | 155 | ||
diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c index 3bfb252206c7..d1a177a3dbe8 100644 --- a/fs/btrfs/xattr.c +++ b/fs/btrfs/xattr.c | |||
@@ -380,23 +380,21 @@ static int btrfs_xattr_handler_get(const struct xattr_handler *handler, | |||
380 | } | 380 | } |
381 | 381 | ||
382 | static int btrfs_xattr_handler_set(const struct xattr_handler *handler, | 382 | static int btrfs_xattr_handler_set(const struct xattr_handler *handler, |
383 | struct dentry *dentry, const char *name, | 383 | struct dentry *unused, struct inode *inode, |
384 | const void *buffer, size_t size, | 384 | const char *name, const void *buffer, |
385 | int flags) | 385 | size_t size, int flags) |
386 | { | 386 | { |
387 | struct inode *inode = d_inode(dentry); | ||
388 | |||
389 | name = xattr_full_name(handler, name); | 387 | name = xattr_full_name(handler, name); |
390 | return __btrfs_setxattr(NULL, inode, name, buffer, size, flags); | 388 | return __btrfs_setxattr(NULL, inode, name, buffer, size, flags); |
391 | } | 389 | } |
392 | 390 | ||
393 | static int btrfs_xattr_handler_set_prop(const struct xattr_handler *handler, | 391 | static int btrfs_xattr_handler_set_prop(const struct xattr_handler *handler, |
394 | struct dentry *dentry, | 392 | struct dentry *unused, struct inode *inode, |
395 | const char *name, const void *value, | 393 | const char *name, const void *value, |
396 | size_t size, int flags) | 394 | size_t size, int flags) |
397 | { | 395 | { |
398 | name = xattr_full_name(handler, name); | 396 | name = xattr_full_name(handler, name); |
399 | return btrfs_set_prop(d_inode(dentry), name, value, size, flags); | 397 | return btrfs_set_prop(inode, name, value, size, flags); |
400 | } | 398 | } |
401 | 399 | ||
402 | static const struct xattr_handler btrfs_security_xattr_handler = { | 400 | static const struct xattr_handler btrfs_security_xattr_handler = { |
diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c index 0d66722c6a52..2baa6939dfe6 100644 --- a/fs/ceph/xattr.c +++ b/fs/ceph/xattr.c | |||
@@ -1051,12 +1051,13 @@ static int ceph_get_xattr_handler(const struct xattr_handler *handler, | |||
1051 | } | 1051 | } |
1052 | 1052 | ||
1053 | static int ceph_set_xattr_handler(const struct xattr_handler *handler, | 1053 | static int ceph_set_xattr_handler(const struct xattr_handler *handler, |
1054 | struct dentry *dentry, const char *name, | 1054 | struct dentry *unused, struct inode *inode, |
1055 | const void *value, size_t size, int flags) | 1055 | const char *name, const void *value, |
1056 | size_t size, int flags) | ||
1056 | { | 1057 | { |
1057 | if (!ceph_is_valid_xattr(name)) | 1058 | if (!ceph_is_valid_xattr(name)) |
1058 | return -EOPNOTSUPP; | 1059 | return -EOPNOTSUPP; |
1059 | return __ceph_setxattr(d_inode(dentry), name, value, size, flags); | 1060 | return __ceph_setxattr(inode, name, value, size, flags); |
1060 | } | 1061 | } |
1061 | 1062 | ||
1062 | const struct xattr_handler ceph_other_xattr_handler = { | 1063 | const struct xattr_handler ceph_other_xattr_handler = { |
diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c index c8b77aa24a1d..5e23f64c0804 100644 --- a/fs/cifs/xattr.c +++ b/fs/cifs/xattr.c | |||
@@ -39,8 +39,9 @@ | |||
39 | enum { XATTR_USER, XATTR_CIFS_ACL, XATTR_ACL_ACCESS, XATTR_ACL_DEFAULT }; | 39 | enum { XATTR_USER, XATTR_CIFS_ACL, XATTR_ACL_ACCESS, XATTR_ACL_DEFAULT }; |
40 | 40 | ||
41 | static int cifs_xattr_set(const struct xattr_handler *handler, | 41 | static int cifs_xattr_set(const struct xattr_handler *handler, |
42 | struct dentry *dentry, const char *name, | 42 | struct dentry *dentry, struct inode *inode, |
43 | const void *value, size_t size, int flags) | 43 | const char *name, const void *value, |
44 | size_t size, int flags) | ||
44 | { | 45 | { |
45 | int rc = -EOPNOTSUPP; | 46 | int rc = -EOPNOTSUPP; |
46 | unsigned int xid; | 47 | unsigned int xid; |
@@ -99,12 +100,12 @@ static int cifs_xattr_set(const struct xattr_handler *handler, | |||
99 | if (value && | 100 | if (value && |
100 | pTcon->ses->server->ops->set_acl) | 101 | pTcon->ses->server->ops->set_acl) |
101 | rc = pTcon->ses->server->ops->set_acl(pacl, | 102 | rc = pTcon->ses->server->ops->set_acl(pacl, |
102 | size, d_inode(dentry), | 103 | size, inode, |
103 | full_path, CIFS_ACL_DACL); | 104 | full_path, CIFS_ACL_DACL); |
104 | else | 105 | else |
105 | rc = -EOPNOTSUPP; | 106 | rc = -EOPNOTSUPP; |
106 | if (rc == 0) /* force revalidate of the inode */ | 107 | if (rc == 0) /* force revalidate of the inode */ |
107 | CIFS_I(d_inode(dentry))->time = 0; | 108 | CIFS_I(inode)->time = 0; |
108 | kfree(pacl); | 109 | kfree(pacl); |
109 | } | 110 | } |
110 | #endif /* CONFIG_CIFS_ACL */ | 111 | #endif /* CONFIG_CIFS_ACL */ |
diff --git a/fs/ext2/xattr_security.c b/fs/ext2/xattr_security.c index 7fd3b867ce65..7b9e9c1842d5 100644 --- a/fs/ext2/xattr_security.c +++ b/fs/ext2/xattr_security.c | |||
@@ -18,10 +18,11 @@ ext2_xattr_security_get(const struct xattr_handler *handler, | |||
18 | 18 | ||
19 | static int | 19 | static int |
20 | ext2_xattr_security_set(const struct xattr_handler *handler, | 20 | ext2_xattr_security_set(const struct xattr_handler *handler, |
21 | struct dentry *dentry, const char *name, | 21 | struct dentry *unused, struct inode *inode, |
22 | const void *value, size_t size, int flags) | 22 | const char *name, const void *value, |
23 | size_t size, int flags) | ||
23 | { | 24 | { |
24 | return ext2_xattr_set(d_inode(dentry), EXT2_XATTR_INDEX_SECURITY, name, | 25 | return ext2_xattr_set(inode, EXT2_XATTR_INDEX_SECURITY, name, |
25 | value, size, flags); | 26 | value, size, flags); |
26 | } | 27 | } |
27 | 28 | ||
diff --git a/fs/ext2/xattr_trusted.c b/fs/ext2/xattr_trusted.c index 0f85705ff519..65049b71af13 100644 --- a/fs/ext2/xattr_trusted.c +++ b/fs/ext2/xattr_trusted.c | |||
@@ -25,10 +25,11 @@ ext2_xattr_trusted_get(const struct xattr_handler *handler, | |||
25 | 25 | ||
26 | static int | 26 | static int |
27 | ext2_xattr_trusted_set(const struct xattr_handler *handler, | 27 | ext2_xattr_trusted_set(const struct xattr_handler *handler, |
28 | struct dentry *dentry, const char *name, | 28 | struct dentry *unused, struct inode *inode, |
29 | const void *value, size_t size, int flags) | 29 | const char *name, const void *value, |
30 | size_t size, int flags) | ||
30 | { | 31 | { |
31 | return ext2_xattr_set(d_inode(dentry), EXT2_XATTR_INDEX_TRUSTED, name, | 32 | return ext2_xattr_set(inode, EXT2_XATTR_INDEX_TRUSTED, name, |
32 | value, size, flags); | 33 | value, size, flags); |
33 | } | 34 | } |
34 | 35 | ||
diff --git a/fs/ext2/xattr_user.c b/fs/ext2/xattr_user.c index 1fafd27037cc..fb2f992ae763 100644 --- a/fs/ext2/xattr_user.c +++ b/fs/ext2/xattr_user.c | |||
@@ -29,13 +29,14 @@ ext2_xattr_user_get(const struct xattr_handler *handler, | |||
29 | 29 | ||
30 | static int | 30 | static int |
31 | ext2_xattr_user_set(const struct xattr_handler *handler, | 31 | ext2_xattr_user_set(const struct xattr_handler *handler, |
32 | struct dentry *dentry, const char *name, | 32 | struct dentry *unused, struct inode *inode, |
33 | const void *value, size_t size, int flags) | 33 | const char *name, const void *value, |
34 | size_t size, int flags) | ||
34 | { | 35 | { |
35 | if (!test_opt(dentry->d_sb, XATTR_USER)) | 36 | if (!test_opt(inode->i_sb, XATTR_USER)) |
36 | return -EOPNOTSUPP; | 37 | return -EOPNOTSUPP; |
37 | 38 | ||
38 | return ext2_xattr_set(d_inode(dentry), EXT2_XATTR_INDEX_USER, | 39 | return ext2_xattr_set(inode, EXT2_XATTR_INDEX_USER, |
39 | name, value, size, flags); | 40 | name, value, size, flags); |
40 | } | 41 | } |
41 | 42 | ||
diff --git a/fs/ext4/xattr_security.c b/fs/ext4/xattr_security.c index 123a7d010efe..a8921112030d 100644 --- a/fs/ext4/xattr_security.c +++ b/fs/ext4/xattr_security.c | |||
@@ -22,10 +22,11 @@ ext4_xattr_security_get(const struct xattr_handler *handler, | |||
22 | 22 | ||
23 | static int | 23 | static int |
24 | ext4_xattr_security_set(const struct xattr_handler *handler, | 24 | ext4_xattr_security_set(const struct xattr_handler *handler, |
25 | struct dentry *dentry, const char *name, | 25 | struct dentry *unused, struct inode *inode, |
26 | const void *value, size_t size, int flags) | 26 | const char *name, const void *value, |
27 | size_t size, int flags) | ||
27 | { | 28 | { |
28 | return ext4_xattr_set(d_inode(dentry), EXT4_XATTR_INDEX_SECURITY, | 29 | return ext4_xattr_set(inode, EXT4_XATTR_INDEX_SECURITY, |
29 | name, value, size, flags); | 30 | name, value, size, flags); |
30 | } | 31 | } |
31 | 32 | ||
diff --git a/fs/ext4/xattr_trusted.c b/fs/ext4/xattr_trusted.c index 60652fa24cbc..c7765c735714 100644 --- a/fs/ext4/xattr_trusted.c +++ b/fs/ext4/xattr_trusted.c | |||
@@ -29,10 +29,11 @@ ext4_xattr_trusted_get(const struct xattr_handler *handler, | |||
29 | 29 | ||
30 | static int | 30 | static int |
31 | ext4_xattr_trusted_set(const struct xattr_handler *handler, | 31 | ext4_xattr_trusted_set(const struct xattr_handler *handler, |
32 | struct dentry *dentry, const char *name, | 32 | struct dentry *unused, struct inode *inode, |
33 | const void *value, size_t size, int flags) | 33 | const char *name, const void *value, |
34 | size_t size, int flags) | ||
34 | { | 35 | { |
35 | return ext4_xattr_set(d_inode(dentry), EXT4_XATTR_INDEX_TRUSTED, | 36 | return ext4_xattr_set(inode, EXT4_XATTR_INDEX_TRUSTED, |
36 | name, value, size, flags); | 37 | name, value, size, flags); |
37 | } | 38 | } |
38 | 39 | ||
diff --git a/fs/ext4/xattr_user.c b/fs/ext4/xattr_user.c index 17a446ffecd3..ca20e423034b 100644 --- a/fs/ext4/xattr_user.c +++ b/fs/ext4/xattr_user.c | |||
@@ -30,12 +30,13 @@ ext4_xattr_user_get(const struct xattr_handler *handler, | |||
30 | 30 | ||
31 | static int | 31 | static int |
32 | ext4_xattr_user_set(const struct xattr_handler *handler, | 32 | ext4_xattr_user_set(const struct xattr_handler *handler, |
33 | struct dentry *dentry, const char *name, | 33 | struct dentry *unused, struct inode *inode, |
34 | const void *value, size_t size, int flags) | 34 | const char *name, const void *value, |
35 | size_t size, int flags) | ||
35 | { | 36 | { |
36 | if (!test_opt(dentry->d_sb, XATTR_USER)) | 37 | if (!test_opt(inode->i_sb, XATTR_USER)) |
37 | return -EOPNOTSUPP; | 38 | return -EOPNOTSUPP; |
38 | return ext4_xattr_set(d_inode(dentry), EXT4_XATTR_INDEX_USER, | 39 | return ext4_xattr_set(inode, EXT4_XATTR_INDEX_USER, |
39 | name, value, size, flags); | 40 | name, value, size, flags); |
40 | } | 41 | } |
41 | 42 | ||
diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c index 00ea56797258..e3decae3acfb 100644 --- a/fs/f2fs/xattr.c +++ b/fs/f2fs/xattr.c | |||
@@ -50,10 +50,11 @@ static int f2fs_xattr_generic_get(const struct xattr_handler *handler, | |||
50 | } | 50 | } |
51 | 51 | ||
52 | static int f2fs_xattr_generic_set(const struct xattr_handler *handler, | 52 | static int f2fs_xattr_generic_set(const struct xattr_handler *handler, |
53 | struct dentry *dentry, const char *name, const void *value, | 53 | struct dentry *unused, struct inode *inode, |
54 | const char *name, const void *value, | ||
54 | size_t size, int flags) | 55 | size_t size, int flags) |
55 | { | 56 | { |
56 | struct f2fs_sb_info *sbi = F2FS_SB(dentry->d_sb); | 57 | struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb); |
57 | 58 | ||
58 | switch (handler->flags) { | 59 | switch (handler->flags) { |
59 | case F2FS_XATTR_INDEX_USER: | 60 | case F2FS_XATTR_INDEX_USER: |
@@ -69,7 +70,7 @@ static int f2fs_xattr_generic_set(const struct xattr_handler *handler, | |||
69 | default: | 70 | default: |
70 | return -EINVAL; | 71 | return -EINVAL; |
71 | } | 72 | } |
72 | return f2fs_setxattr(d_inode(dentry), handler->flags, name, | 73 | return f2fs_setxattr(inode, handler->flags, name, |
73 | value, size, NULL, flags); | 74 | value, size, NULL, flags); |
74 | } | 75 | } |
75 | 76 | ||
@@ -95,11 +96,10 @@ static int f2fs_xattr_advise_get(const struct xattr_handler *handler, | |||
95 | } | 96 | } |
96 | 97 | ||
97 | static int f2fs_xattr_advise_set(const struct xattr_handler *handler, | 98 | static int f2fs_xattr_advise_set(const struct xattr_handler *handler, |
98 | struct dentry *dentry, const char *name, const void *value, | 99 | struct dentry *unused, struct inode *inode, |
100 | const char *name, const void *value, | ||
99 | size_t size, int flags) | 101 | size_t size, int flags) |
100 | { | 102 | { |
101 | struct inode *inode = d_inode(dentry); | ||
102 | |||
103 | if (!inode_owner_or_capable(inode)) | 103 | if (!inode_owner_or_capable(inode)) |
104 | return -EPERM; | 104 | return -EPERM; |
105 | if (value == NULL) | 105 | if (value == NULL) |
diff --git a/fs/gfs2/xattr.c b/fs/gfs2/xattr.c index f42ab53bd30d..3a2853504084 100644 --- a/fs/gfs2/xattr.c +++ b/fs/gfs2/xattr.c | |||
@@ -1251,10 +1251,10 @@ int __gfs2_xattr_set(struct inode *inode, const char *name, | |||
1251 | } | 1251 | } |
1252 | 1252 | ||
1253 | static int gfs2_xattr_set(const struct xattr_handler *handler, | 1253 | static int gfs2_xattr_set(const struct xattr_handler *handler, |
1254 | struct dentry *dentry, const char *name, | 1254 | struct dentry *unused, struct inode *inode, |
1255 | const void *value, size_t size, int flags) | 1255 | const char *name, const void *value, |
1256 | size_t size, int flags) | ||
1256 | { | 1257 | { |
1257 | struct inode *inode = d_inode(dentry); | ||
1258 | struct gfs2_inode *ip = GFS2_I(inode); | 1258 | struct gfs2_inode *ip = GFS2_I(inode); |
1259 | struct gfs2_holder gh; | 1259 | struct gfs2_holder gh; |
1260 | int ret; | 1260 | int ret; |
diff --git a/fs/hfsplus/xattr.c b/fs/hfsplus/xattr.c index 4f118d282a7a..d37bb88dc746 100644 --- a/fs/hfsplus/xattr.c +++ b/fs/hfsplus/xattr.c | |||
@@ -424,7 +424,7 @@ static int copy_name(char *buffer, const char *xattr_name, int name_len) | |||
424 | return len; | 424 | return len; |
425 | } | 425 | } |
426 | 426 | ||
427 | int hfsplus_setxattr(struct dentry *dentry, const char *name, | 427 | int hfsplus_setxattr(struct inode *inode, const char *name, |
428 | const void *value, size_t size, int flags, | 428 | const void *value, size_t size, int flags, |
429 | const char *prefix, size_t prefixlen) | 429 | const char *prefix, size_t prefixlen) |
430 | { | 430 | { |
@@ -437,8 +437,7 @@ int hfsplus_setxattr(struct dentry *dentry, const char *name, | |||
437 | return -ENOMEM; | 437 | return -ENOMEM; |
438 | strcpy(xattr_name, prefix); | 438 | strcpy(xattr_name, prefix); |
439 | strcpy(xattr_name + prefixlen, name); | 439 | strcpy(xattr_name + prefixlen, name); |
440 | res = __hfsplus_setxattr(d_inode(dentry), xattr_name, value, size, | 440 | res = __hfsplus_setxattr(inode, xattr_name, value, size, flags); |
441 | flags); | ||
442 | kfree(xattr_name); | 441 | kfree(xattr_name); |
443 | return res; | 442 | return res; |
444 | } | 443 | } |
@@ -864,8 +863,9 @@ static int hfsplus_osx_getxattr(const struct xattr_handler *handler, | |||
864 | } | 863 | } |
865 | 864 | ||
866 | static int hfsplus_osx_setxattr(const struct xattr_handler *handler, | 865 | static int hfsplus_osx_setxattr(const struct xattr_handler *handler, |
867 | struct dentry *dentry, const char *name, | 866 | struct dentry *unused, struct inode *inode, |
868 | const void *buffer, size_t size, int flags) | 867 | const char *name, const void *buffer, |
868 | size_t size, int flags) | ||
869 | { | 869 | { |
870 | /* | 870 | /* |
871 | * Don't allow setting properly prefixed attributes | 871 | * Don't allow setting properly prefixed attributes |
@@ -880,7 +880,7 @@ static int hfsplus_osx_setxattr(const struct xattr_handler *handler, | |||
880 | * creates), so we pass the name through unmodified (after | 880 | * creates), so we pass the name through unmodified (after |
881 | * ensuring it doesn't conflict with another namespace). | 881 | * ensuring it doesn't conflict with another namespace). |
882 | */ | 882 | */ |
883 | return __hfsplus_setxattr(d_inode(dentry), name, buffer, size, flags); | 883 | return __hfsplus_setxattr(inode, name, buffer, size, flags); |
884 | } | 884 | } |
885 | 885 | ||
886 | const struct xattr_handler hfsplus_xattr_osx_handler = { | 886 | const struct xattr_handler hfsplus_xattr_osx_handler = { |
diff --git a/fs/hfsplus/xattr.h b/fs/hfsplus/xattr.h index d04ba6f58df2..68f6b539371f 100644 --- a/fs/hfsplus/xattr.h +++ b/fs/hfsplus/xattr.h | |||
@@ -21,7 +21,7 @@ extern const struct xattr_handler *hfsplus_xattr_handlers[]; | |||
21 | int __hfsplus_setxattr(struct inode *inode, const char *name, | 21 | int __hfsplus_setxattr(struct inode *inode, const char *name, |
22 | const void *value, size_t size, int flags); | 22 | const void *value, size_t size, int flags); |
23 | 23 | ||
24 | int hfsplus_setxattr(struct dentry *dentry, const char *name, | 24 | int hfsplus_setxattr(struct inode *inode, const char *name, |
25 | const void *value, size_t size, int flags, | 25 | const void *value, size_t size, int flags, |
26 | const char *prefix, size_t prefixlen); | 26 | const char *prefix, size_t prefixlen); |
27 | 27 | ||
diff --git a/fs/hfsplus/xattr_security.c b/fs/hfsplus/xattr_security.c index ae2ca8c2e335..37b3efa733ef 100644 --- a/fs/hfsplus/xattr_security.c +++ b/fs/hfsplus/xattr_security.c | |||
@@ -23,10 +23,11 @@ static int hfsplus_security_getxattr(const struct xattr_handler *handler, | |||
23 | } | 23 | } |
24 | 24 | ||
25 | static int hfsplus_security_setxattr(const struct xattr_handler *handler, | 25 | static int hfsplus_security_setxattr(const struct xattr_handler *handler, |
26 | struct dentry *dentry, const char *name, | 26 | struct dentry *unused, struct inode *inode, |
27 | const void *buffer, size_t size, int flags) | 27 | const char *name, const void *buffer, |
28 | size_t size, int flags) | ||
28 | { | 29 | { |
29 | return hfsplus_setxattr(dentry, name, buffer, size, flags, | 30 | return hfsplus_setxattr(inode, name, buffer, size, flags, |
30 | XATTR_SECURITY_PREFIX, | 31 | XATTR_SECURITY_PREFIX, |
31 | XATTR_SECURITY_PREFIX_LEN); | 32 | XATTR_SECURITY_PREFIX_LEN); |
32 | } | 33 | } |
diff --git a/fs/hfsplus/xattr_trusted.c b/fs/hfsplus/xattr_trusted.c index eae2947060aa..94519d6c627d 100644 --- a/fs/hfsplus/xattr_trusted.c +++ b/fs/hfsplus/xattr_trusted.c | |||
@@ -21,10 +21,11 @@ static int hfsplus_trusted_getxattr(const struct xattr_handler *handler, | |||
21 | } | 21 | } |
22 | 22 | ||
23 | static int hfsplus_trusted_setxattr(const struct xattr_handler *handler, | 23 | static int hfsplus_trusted_setxattr(const struct xattr_handler *handler, |
24 | struct dentry *dentry, const char *name, | 24 | struct dentry *unused, struct inode *inode, |
25 | const void *buffer, size_t size, int flags) | 25 | const char *name, const void *buffer, |
26 | size_t size, int flags) | ||
26 | { | 27 | { |
27 | return hfsplus_setxattr(dentry, name, buffer, size, flags, | 28 | return hfsplus_setxattr(inode, name, buffer, size, flags, |
28 | XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN); | 29 | XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN); |
29 | } | 30 | } |
30 | 31 | ||
diff --git a/fs/hfsplus/xattr_user.c b/fs/hfsplus/xattr_user.c index 3c9eec3e4c7b..fae6c0ea0030 100644 --- a/fs/hfsplus/xattr_user.c +++ b/fs/hfsplus/xattr_user.c | |||
@@ -21,10 +21,11 @@ static int hfsplus_user_getxattr(const struct xattr_handler *handler, | |||
21 | } | 21 | } |
22 | 22 | ||
23 | static int hfsplus_user_setxattr(const struct xattr_handler *handler, | 23 | static int hfsplus_user_setxattr(const struct xattr_handler *handler, |
24 | struct dentry *dentry, const char *name, | 24 | struct dentry *unused, struct inode *inode, |
25 | const void *buffer, size_t size, int flags) | 25 | const char *name, const void *buffer, |
26 | size_t size, int flags) | ||
26 | { | 27 | { |
27 | return hfsplus_setxattr(dentry, name, buffer, size, flags, | 28 | return hfsplus_setxattr(inode, name, buffer, size, flags, |
28 | XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN); | 29 | XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN); |
29 | } | 30 | } |
30 | 31 | ||
diff --git a/fs/jffs2/security.c b/fs/jffs2/security.c index 3ed9a4b49778..c2332e30f218 100644 --- a/fs/jffs2/security.c +++ b/fs/jffs2/security.c | |||
@@ -57,10 +57,11 @@ static int jffs2_security_getxattr(const struct xattr_handler *handler, | |||
57 | } | 57 | } |
58 | 58 | ||
59 | static int jffs2_security_setxattr(const struct xattr_handler *handler, | 59 | static int jffs2_security_setxattr(const struct xattr_handler *handler, |
60 | struct dentry *dentry, const char *name, | 60 | struct dentry *unused, struct inode *inode, |
61 | const void *buffer, size_t size, int flags) | 61 | const char *name, const void *buffer, |
62 | size_t size, int flags) | ||
62 | { | 63 | { |
63 | return do_jffs2_setxattr(d_inode(dentry), JFFS2_XPREFIX_SECURITY, | 64 | return do_jffs2_setxattr(inode, JFFS2_XPREFIX_SECURITY, |
64 | name, buffer, size, flags); | 65 | name, buffer, size, flags); |
65 | } | 66 | } |
66 | 67 | ||
diff --git a/fs/jffs2/xattr_trusted.c b/fs/jffs2/xattr_trusted.c index 4ebecff1d922..5d6030826c52 100644 --- a/fs/jffs2/xattr_trusted.c +++ b/fs/jffs2/xattr_trusted.c | |||
@@ -25,10 +25,11 @@ static int jffs2_trusted_getxattr(const struct xattr_handler *handler, | |||
25 | } | 25 | } |
26 | 26 | ||
27 | static int jffs2_trusted_setxattr(const struct xattr_handler *handler, | 27 | static int jffs2_trusted_setxattr(const struct xattr_handler *handler, |
28 | struct dentry *dentry, const char *name, | 28 | struct dentry *unused, struct inode *inode, |
29 | const void *buffer, size_t size, int flags) | 29 | const char *name, const void *buffer, |
30 | size_t size, int flags) | ||
30 | { | 31 | { |
31 | return do_jffs2_setxattr(d_inode(dentry), JFFS2_XPREFIX_TRUSTED, | 32 | return do_jffs2_setxattr(inode, JFFS2_XPREFIX_TRUSTED, |
32 | name, buffer, size, flags); | 33 | name, buffer, size, flags); |
33 | } | 34 | } |
34 | 35 | ||
diff --git a/fs/jffs2/xattr_user.c b/fs/jffs2/xattr_user.c index bce249e1b277..9d027b4abcf9 100644 --- a/fs/jffs2/xattr_user.c +++ b/fs/jffs2/xattr_user.c | |||
@@ -25,10 +25,11 @@ static int jffs2_user_getxattr(const struct xattr_handler *handler, | |||
25 | } | 25 | } |
26 | 26 | ||
27 | static int jffs2_user_setxattr(const struct xattr_handler *handler, | 27 | static int jffs2_user_setxattr(const struct xattr_handler *handler, |
28 | struct dentry *dentry, const char *name, | 28 | struct dentry *unused, struct inode *inode, |
29 | const void *buffer, size_t size, int flags) | 29 | const char *name, const void *buffer, |
30 | size_t size, int flags) | ||
30 | { | 31 | { |
31 | return do_jffs2_setxattr(d_inode(dentry), JFFS2_XPREFIX_USER, | 32 | return do_jffs2_setxattr(inode, JFFS2_XPREFIX_USER, |
32 | name, buffer, size, flags); | 33 | name, buffer, size, flags); |
33 | } | 34 | } |
34 | 35 | ||
diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c index beb182b503b3..0bf3c33aedff 100644 --- a/fs/jfs/xattr.c +++ b/fs/jfs/xattr.c | |||
@@ -943,11 +943,10 @@ static int jfs_xattr_get(const struct xattr_handler *handler, | |||
943 | } | 943 | } |
944 | 944 | ||
945 | static int jfs_xattr_set(const struct xattr_handler *handler, | 945 | static int jfs_xattr_set(const struct xattr_handler *handler, |
946 | struct dentry *dentry, const char *name, | 946 | struct dentry *unused, struct inode *inode, |
947 | const void *value, size_t size, int flags) | 947 | const char *name, const void *value, |
948 | size_t size, int flags) | ||
948 | { | 949 | { |
949 | struct inode *inode = d_inode(dentry); | ||
950 | |||
951 | name = xattr_full_name(handler, name); | 950 | name = xattr_full_name(handler, name); |
952 | return __jfs_xattr_set(inode, name, value, size, flags); | 951 | return __jfs_xattr_set(inode, name, value, size, flags); |
953 | } | 952 | } |
@@ -962,11 +961,10 @@ static int jfs_xattr_get_os2(const struct xattr_handler *handler, | |||
962 | } | 961 | } |
963 | 962 | ||
964 | static int jfs_xattr_set_os2(const struct xattr_handler *handler, | 963 | static int jfs_xattr_set_os2(const struct xattr_handler *handler, |
965 | struct dentry *dentry, const char *name, | 964 | struct dentry *unused, struct inode *inode, |
966 | const void *value, size_t size, int flags) | 965 | const char *name, const void *value, |
966 | size_t size, int flags) | ||
967 | { | 967 | { |
968 | struct inode *inode = d_inode(dentry); | ||
969 | |||
970 | if (is_known_namespace(name)) | 968 | if (is_known_namespace(name)) |
971 | return -EOPNOTSUPP; | 969 | return -EOPNOTSUPP; |
972 | return __jfs_xattr_set(inode, name, value, size, flags); | 970 | return __jfs_xattr_set(inode, name, value, size, flags); |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 084e8570da18..2e802ec47b8a 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -4993,12 +4993,11 @@ static int nfs4_do_set_security_label(struct inode *inode, | |||
4993 | } | 4993 | } |
4994 | 4994 | ||
4995 | static int | 4995 | static int |
4996 | nfs4_set_security_label(struct dentry *dentry, const void *buf, size_t buflen) | 4996 | nfs4_set_security_label(struct inode *inode, const void *buf, size_t buflen) |
4997 | { | 4997 | { |
4998 | struct nfs4_label ilabel, *olabel = NULL; | 4998 | struct nfs4_label ilabel, *olabel = NULL; |
4999 | struct nfs_fattr fattr; | 4999 | struct nfs_fattr fattr; |
5000 | struct rpc_cred *cred; | 5000 | struct rpc_cred *cred; |
5001 | struct inode *inode = d_inode(dentry); | ||
5002 | int status; | 5001 | int status; |
5003 | 5002 | ||
5004 | if (!nfs_server_capable(inode, NFS_CAP_SECURITY_LABEL)) | 5003 | if (!nfs_server_capable(inode, NFS_CAP_SECURITY_LABEL)) |
@@ -6255,11 +6254,11 @@ nfs4_release_lockowner(struct nfs_server *server, struct nfs4_lock_state *lsp) | |||
6255 | #define XATTR_NAME_NFSV4_ACL "system.nfs4_acl" | 6254 | #define XATTR_NAME_NFSV4_ACL "system.nfs4_acl" |
6256 | 6255 | ||
6257 | static int nfs4_xattr_set_nfs4_acl(const struct xattr_handler *handler, | 6256 | static int nfs4_xattr_set_nfs4_acl(const struct xattr_handler *handler, |
6258 | struct dentry *dentry, const char *key, | 6257 | struct dentry *unused, struct inode *inode, |
6259 | const void *buf, size_t buflen, | 6258 | const char *key, const void *buf, |
6260 | int flags) | 6259 | size_t buflen, int flags) |
6261 | { | 6260 | { |
6262 | return nfs4_proc_set_acl(d_inode(dentry), buf, buflen); | 6261 | return nfs4_proc_set_acl(inode, buf, buflen); |
6263 | } | 6262 | } |
6264 | 6263 | ||
6265 | static int nfs4_xattr_get_nfs4_acl(const struct xattr_handler *handler, | 6264 | static int nfs4_xattr_get_nfs4_acl(const struct xattr_handler *handler, |
@@ -6277,12 +6276,12 @@ static bool nfs4_xattr_list_nfs4_acl(struct dentry *dentry) | |||
6277 | #ifdef CONFIG_NFS_V4_SECURITY_LABEL | 6276 | #ifdef CONFIG_NFS_V4_SECURITY_LABEL |
6278 | 6277 | ||
6279 | static int nfs4_xattr_set_nfs4_label(const struct xattr_handler *handler, | 6278 | static int nfs4_xattr_set_nfs4_label(const struct xattr_handler *handler, |
6280 | struct dentry *dentry, const char *key, | 6279 | struct dentry *unused, struct inode *inode, |
6281 | const void *buf, size_t buflen, | 6280 | const char *key, const void *buf, |
6282 | int flags) | 6281 | size_t buflen, int flags) |
6283 | { | 6282 | { |
6284 | if (security_ismaclabel(key)) | 6283 | if (security_ismaclabel(key)) |
6285 | return nfs4_set_security_label(dentry, buf, buflen); | 6284 | return nfs4_set_security_label(inode, buf, buflen); |
6286 | 6285 | ||
6287 | return -EOPNOTSUPP; | 6286 | return -EOPNOTSUPP; |
6288 | } | 6287 | } |
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index ad16995c9e7a..d2053853951e 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -7254,10 +7254,11 @@ static int ocfs2_xattr_security_get(const struct xattr_handler *handler, | |||
7254 | } | 7254 | } |
7255 | 7255 | ||
7256 | static int ocfs2_xattr_security_set(const struct xattr_handler *handler, | 7256 | static int ocfs2_xattr_security_set(const struct xattr_handler *handler, |
7257 | struct dentry *dentry, const char *name, | 7257 | struct dentry *unused, struct inode *inode, |
7258 | const void *value, size_t size, int flags) | 7258 | const char *name, const void *value, |
7259 | size_t size, int flags) | ||
7259 | { | 7260 | { |
7260 | return ocfs2_xattr_set(d_inode(dentry), OCFS2_XATTR_INDEX_SECURITY, | 7261 | return ocfs2_xattr_set(inode, OCFS2_XATTR_INDEX_SECURITY, |
7261 | name, value, size, flags); | 7262 | name, value, size, flags); |
7262 | } | 7263 | } |
7263 | 7264 | ||
@@ -7325,10 +7326,11 @@ static int ocfs2_xattr_trusted_get(const struct xattr_handler *handler, | |||
7325 | } | 7326 | } |
7326 | 7327 | ||
7327 | static int ocfs2_xattr_trusted_set(const struct xattr_handler *handler, | 7328 | static int ocfs2_xattr_trusted_set(const struct xattr_handler *handler, |
7328 | struct dentry *dentry, const char *name, | 7329 | struct dentry *unused, struct inode *inode, |
7329 | const void *value, size_t size, int flags) | 7330 | const char *name, const void *value, |
7331 | size_t size, int flags) | ||
7330 | { | 7332 | { |
7331 | return ocfs2_xattr_set(d_inode(dentry), OCFS2_XATTR_INDEX_TRUSTED, | 7333 | return ocfs2_xattr_set(inode, OCFS2_XATTR_INDEX_TRUSTED, |
7332 | name, value, size, flags); | 7334 | name, value, size, flags); |
7333 | } | 7335 | } |
7334 | 7336 | ||
@@ -7354,15 +7356,16 @@ static int ocfs2_xattr_user_get(const struct xattr_handler *handler, | |||
7354 | } | 7356 | } |
7355 | 7357 | ||
7356 | static int ocfs2_xattr_user_set(const struct xattr_handler *handler, | 7358 | static int ocfs2_xattr_user_set(const struct xattr_handler *handler, |
7357 | struct dentry *dentry, const char *name, | 7359 | struct dentry *unused, struct inode *inode, |
7358 | const void *value, size_t size, int flags) | 7360 | const char *name, const void *value, |
7361 | size_t size, int flags) | ||
7359 | { | 7362 | { |
7360 | struct ocfs2_super *osb = OCFS2_SB(dentry->d_sb); | 7363 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
7361 | 7364 | ||
7362 | if (osb->s_mount_opt & OCFS2_MOUNT_NOUSERXATTR) | 7365 | if (osb->s_mount_opt & OCFS2_MOUNT_NOUSERXATTR) |
7363 | return -EOPNOTSUPP; | 7366 | return -EOPNOTSUPP; |
7364 | 7367 | ||
7365 | return ocfs2_xattr_set(d_inode(dentry), OCFS2_XATTR_INDEX_USER, | 7368 | return ocfs2_xattr_set(inode, OCFS2_XATTR_INDEX_USER, |
7366 | name, value, size, flags); | 7369 | name, value, size, flags); |
7367 | } | 7370 | } |
7368 | 7371 | ||
diff --git a/fs/orangefs/xattr.c b/fs/orangefs/xattr.c index 99c19545752c..5893ddde0e4b 100644 --- a/fs/orangefs/xattr.c +++ b/fs/orangefs/xattr.c | |||
@@ -448,13 +448,14 @@ out_unlock: | |||
448 | } | 448 | } |
449 | 449 | ||
450 | static int orangefs_xattr_set_default(const struct xattr_handler *handler, | 450 | static int orangefs_xattr_set_default(const struct xattr_handler *handler, |
451 | struct dentry *dentry, | 451 | struct dentry *unused, |
452 | struct inode *inode, | ||
452 | const char *name, | 453 | const char *name, |
453 | const void *buffer, | 454 | const void *buffer, |
454 | size_t size, | 455 | size_t size, |
455 | int flags) | 456 | int flags) |
456 | { | 457 | { |
457 | return orangefs_inode_setxattr(dentry->d_inode, | 458 | return orangefs_inode_setxattr(inode, |
458 | ORANGEFS_XATTR_NAME_DEFAULT_PREFIX, | 459 | ORANGEFS_XATTR_NAME_DEFAULT_PREFIX, |
459 | name, | 460 | name, |
460 | buffer, | 461 | buffer, |
@@ -478,13 +479,14 @@ static int orangefs_xattr_get_default(const struct xattr_handler *handler, | |||
478 | } | 479 | } |
479 | 480 | ||
480 | static int orangefs_xattr_set_trusted(const struct xattr_handler *handler, | 481 | static int orangefs_xattr_set_trusted(const struct xattr_handler *handler, |
481 | struct dentry *dentry, | 482 | struct dentry *unused, |
483 | struct inode *inode, | ||
482 | const char *name, | 484 | const char *name, |
483 | const void *buffer, | 485 | const void *buffer, |
484 | size_t size, | 486 | size_t size, |
485 | int flags) | 487 | int flags) |
486 | { | 488 | { |
487 | return orangefs_inode_setxattr(dentry->d_inode, | 489 | return orangefs_inode_setxattr(inode, |
488 | ORANGEFS_XATTR_NAME_TRUSTED_PREFIX, | 490 | ORANGEFS_XATTR_NAME_TRUSTED_PREFIX, |
489 | name, | 491 | name, |
490 | buffer, | 492 | buffer, |
diff --git a/fs/posix_acl.c b/fs/posix_acl.c index 2c60f17e7d92..8a4a266beff3 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c | |||
@@ -822,10 +822,10 @@ posix_acl_xattr_get(const struct xattr_handler *handler, | |||
822 | 822 | ||
823 | static int | 823 | static int |
824 | posix_acl_xattr_set(const struct xattr_handler *handler, | 824 | posix_acl_xattr_set(const struct xattr_handler *handler, |
825 | struct dentry *dentry, const char *name, | 825 | struct dentry *unused, struct inode *inode, |
826 | const void *value, size_t size, int flags) | 826 | const char *name, const void *value, |
827 | size_t size, int flags) | ||
827 | { | 828 | { |
828 | struct inode *inode = d_backing_inode(dentry); | ||
829 | struct posix_acl *acl = NULL; | 829 | struct posix_acl *acl = NULL; |
830 | int ret; | 830 | int ret; |
831 | 831 | ||
diff --git a/fs/reiserfs/xattr_security.c b/fs/reiserfs/xattr_security.c index 86aeb9dd805a..e4cbb7719906 100644 --- a/fs/reiserfs/xattr_security.c +++ b/fs/reiserfs/xattr_security.c | |||
@@ -20,13 +20,14 @@ security_get(const struct xattr_handler *handler, struct dentry *unused, | |||
20 | } | 20 | } |
21 | 21 | ||
22 | static int | 22 | static int |
23 | security_set(const struct xattr_handler *handler, struct dentry *dentry, | 23 | security_set(const struct xattr_handler *handler, struct dentry *unused, |
24 | const char *name, const void *buffer, size_t size, int flags) | 24 | struct inode *inode, const char *name, const void *buffer, |
25 | size_t size, int flags) | ||
25 | { | 26 | { |
26 | if (IS_PRIVATE(d_inode(dentry))) | 27 | if (IS_PRIVATE(inode)) |
27 | return -EPERM; | 28 | return -EPERM; |
28 | 29 | ||
29 | return reiserfs_xattr_set(d_inode(dentry), | 30 | return reiserfs_xattr_set(inode, |
30 | xattr_full_name(handler, name), | 31 | xattr_full_name(handler, name), |
31 | buffer, size, flags); | 32 | buffer, size, flags); |
32 | } | 33 | } |
diff --git a/fs/reiserfs/xattr_trusted.c b/fs/reiserfs/xattr_trusted.c index 31837f031f59..f15a5f9e84ce 100644 --- a/fs/reiserfs/xattr_trusted.c +++ b/fs/reiserfs/xattr_trusted.c | |||
@@ -19,13 +19,14 @@ trusted_get(const struct xattr_handler *handler, struct dentry *unused, | |||
19 | } | 19 | } |
20 | 20 | ||
21 | static int | 21 | static int |
22 | trusted_set(const struct xattr_handler *handler, struct dentry *dentry, | 22 | trusted_set(const struct xattr_handler *handler, struct dentry *unused, |
23 | const char *name, const void *buffer, size_t size, int flags) | 23 | struct inode *inode, const char *name, const void *buffer, |
24 | size_t size, int flags) | ||
24 | { | 25 | { |
25 | if (!capable(CAP_SYS_ADMIN) || IS_PRIVATE(d_inode(dentry))) | 26 | if (!capable(CAP_SYS_ADMIN) || IS_PRIVATE(inode)) |
26 | return -EPERM; | 27 | return -EPERM; |
27 | 28 | ||
28 | return reiserfs_xattr_set(d_inode(dentry), | 29 | return reiserfs_xattr_set(inode, |
29 | xattr_full_name(handler, name), | 30 | xattr_full_name(handler, name), |
30 | buffer, size, flags); | 31 | buffer, size, flags); |
31 | } | 32 | } |
diff --git a/fs/reiserfs/xattr_user.c b/fs/reiserfs/xattr_user.c index f7c39731684b..dc59df43b2db 100644 --- a/fs/reiserfs/xattr_user.c +++ b/fs/reiserfs/xattr_user.c | |||
@@ -17,12 +17,13 @@ user_get(const struct xattr_handler *handler, struct dentry *unused, | |||
17 | } | 17 | } |
18 | 18 | ||
19 | static int | 19 | static int |
20 | user_set(const struct xattr_handler *handler, struct dentry *dentry, | 20 | user_set(const struct xattr_handler *handler, struct dentry *unused, |
21 | const char *name, const void *buffer, size_t size, int flags) | 21 | struct inode *inode, const char *name, const void *buffer, |
22 | size_t size, int flags) | ||
22 | { | 23 | { |
23 | if (!reiserfs_xattrs_user(dentry->d_sb)) | 24 | if (!reiserfs_xattrs_user(inode->i_sb)) |
24 | return -EOPNOTSUPP; | 25 | return -EOPNOTSUPP; |
25 | return reiserfs_xattr_set(d_inode(dentry), | 26 | return reiserfs_xattr_set(inode, |
26 | xattr_full_name(handler, name), | 27 | xattr_full_name(handler, name), |
27 | buffer, size, flags); | 28 | buffer, size, flags); |
28 | } | 29 | } |
diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c index 6c277eb6aef9..b5fc27969e9d 100644 --- a/fs/ubifs/xattr.c +++ b/fs/ubifs/xattr.c | |||
@@ -579,11 +579,10 @@ static int ubifs_xattr_get(const struct xattr_handler *handler, | |||
579 | } | 579 | } |
580 | 580 | ||
581 | static int ubifs_xattr_set(const struct xattr_handler *handler, | 581 | static int ubifs_xattr_set(const struct xattr_handler *handler, |
582 | struct dentry *dentry, const char *name, | 582 | struct dentry *dentry, struct inode *inode, |
583 | const void *value, size_t size, int flags) | 583 | const char *name, const void *value, |
584 | size_t size, int flags) | ||
584 | { | 585 | { |
585 | struct inode *inode = d_inode(dentry); | ||
586 | |||
587 | dbg_gen("xattr '%s', host ino %lu ('%pd'), size %zd", | 586 | dbg_gen("xattr '%s', host ino %lu ('%pd'), size %zd", |
588 | name, inode->i_ino, dentry, size); | 587 | name, inode->i_ino, dentry, size); |
589 | 588 | ||
diff --git a/fs/xattr.c b/fs/xattr.c index fc81e771488a..b16d07889700 100644 --- a/fs/xattr.c +++ b/fs/xattr.c | |||
@@ -754,7 +754,8 @@ generic_setxattr(struct dentry *dentry, const char *name, const void *value, siz | |||
754 | handler = xattr_resolve_name(dentry->d_sb->s_xattr, &name); | 754 | handler = xattr_resolve_name(dentry->d_sb->s_xattr, &name); |
755 | if (IS_ERR(handler)) | 755 | if (IS_ERR(handler)) |
756 | return PTR_ERR(handler); | 756 | return PTR_ERR(handler); |
757 | return handler->set(handler, dentry, name, value, size, flags); | 757 | return handler->set(handler, dentry, d_inode(dentry), name, value, |
758 | size, flags); | ||
758 | } | 759 | } |
759 | 760 | ||
760 | /* | 761 | /* |
@@ -769,7 +770,8 @@ generic_removexattr(struct dentry *dentry, const char *name) | |||
769 | handler = xattr_resolve_name(dentry->d_sb->s_xattr, &name); | 770 | handler = xattr_resolve_name(dentry->d_sb->s_xattr, &name); |
770 | if (IS_ERR(handler)) | 771 | if (IS_ERR(handler)) |
771 | return PTR_ERR(handler); | 772 | return PTR_ERR(handler); |
772 | return handler->set(handler, dentry, name, NULL, 0, XATTR_REPLACE); | 773 | return handler->set(handler, dentry, d_inode(dentry), name, NULL, |
774 | 0, XATTR_REPLACE); | ||
773 | } | 775 | } |
774 | 776 | ||
775 | EXPORT_SYMBOL(generic_getxattr); | 777 | EXPORT_SYMBOL(generic_getxattr); |
diff --git a/fs/xfs/xfs_xattr.c b/fs/xfs/xfs_xattr.c index d111f691f313..2773b155cb56 100644 --- a/fs/xfs/xfs_xattr.c +++ b/fs/xfs/xfs_xattr.c | |||
@@ -74,11 +74,12 @@ xfs_forget_acl( | |||
74 | } | 74 | } |
75 | 75 | ||
76 | static int | 76 | static int |
77 | xfs_xattr_set(const struct xattr_handler *handler, struct dentry *dentry, | 77 | xfs_xattr_set(const struct xattr_handler *handler, struct dentry *unused, |
78 | const char *name, const void *value, size_t size, int flags) | 78 | struct inode *inode, const char *name, const void *value, |
79 | size_t size, int flags) | ||
79 | { | 80 | { |
80 | int xflags = handler->flags; | 81 | int xflags = handler->flags; |
81 | struct xfs_inode *ip = XFS_I(d_inode(dentry)); | 82 | struct xfs_inode *ip = XFS_I(inode); |
82 | int error; | 83 | int error; |
83 | 84 | ||
84 | /* Convert Linux syscall to XFS internal ATTR flags */ | 85 | /* Convert Linux syscall to XFS internal ATTR flags */ |
@@ -92,7 +93,7 @@ xfs_xattr_set(const struct xattr_handler *handler, struct dentry *dentry, | |||
92 | error = xfs_attr_set(ip, (unsigned char *)name, | 93 | error = xfs_attr_set(ip, (unsigned char *)name, |
93 | (void *)value, size, xflags); | 94 | (void *)value, size, xflags); |
94 | if (!error) | 95 | if (!error) |
95 | xfs_forget_acl(d_inode(dentry), name, xflags); | 96 | xfs_forget_acl(inode, name, xflags); |
96 | 97 | ||
97 | return error; | 98 | return error; |
98 | } | 99 | } |
diff --git a/include/linux/xattr.h b/include/linux/xattr.h index 1cc4c578deb9..76beb206741a 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h | |||
@@ -33,8 +33,8 @@ struct xattr_handler { | |||
33 | struct inode *inode, const char *name, void *buffer, | 33 | struct inode *inode, const char *name, void *buffer, |
34 | size_t size); | 34 | size_t size); |
35 | int (*set)(const struct xattr_handler *, struct dentry *dentry, | 35 | int (*set)(const struct xattr_handler *, struct dentry *dentry, |
36 | const char *name, const void *buffer, size_t size, | 36 | struct inode *inode, const char *name, const void *buffer, |
37 | int flags); | 37 | size_t size, int flags); |
38 | }; | 38 | }; |
39 | 39 | ||
40 | const char *xattr_full_name(const struct xattr_handler *, const char *); | 40 | const char *xattr_full_name(const struct xattr_handler *, const char *); |
diff --git a/mm/shmem.c b/mm/shmem.c index e418a995427d..a36144909b28 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -2645,10 +2645,11 @@ static int shmem_xattr_handler_get(const struct xattr_handler *handler, | |||
2645 | } | 2645 | } |
2646 | 2646 | ||
2647 | static int shmem_xattr_handler_set(const struct xattr_handler *handler, | 2647 | static int shmem_xattr_handler_set(const struct xattr_handler *handler, |
2648 | struct dentry *dentry, const char *name, | 2648 | struct dentry *unused, struct inode *inode, |
2649 | const void *value, size_t size, int flags) | 2649 | const char *name, const void *value, |
2650 | size_t size, int flags) | ||
2650 | { | 2651 | { |
2651 | struct shmem_inode_info *info = SHMEM_I(d_inode(dentry)); | 2652 | struct shmem_inode_info *info = SHMEM_I(inode); |
2652 | 2653 | ||
2653 | name = xattr_full_name(handler, name); | 2654 | name = xattr_full_name(handler, name); |
2654 | return simple_xattr_set(&info->xattrs, name, value, size, flags); | 2655 | return simple_xattr_set(&info->xattrs, name, value, size, flags); |