diff options
Diffstat (limited to 'fs/btrfs/acl.c')
-rw-r--r-- | fs/btrfs/acl.c | 47 |
1 files changed, 12 insertions, 35 deletions
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index da3133c69830..6df6d6ed74fd 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c | |||
@@ -73,13 +73,13 @@ static struct posix_acl *btrfs_get_acl(struct inode *inode, int type) | |||
73 | return acl; | 73 | return acl; |
74 | } | 74 | } |
75 | 75 | ||
76 | static int btrfs_xattr_get_acl(struct inode *inode, int type, | 76 | static int btrfs_xattr_acl_get(struct dentry *dentry, const char *name, |
77 | void *value, size_t size) | 77 | void *value, size_t size, int type) |
78 | { | 78 | { |
79 | struct posix_acl *acl; | 79 | struct posix_acl *acl; |
80 | int ret = 0; | 80 | int ret = 0; |
81 | 81 | ||
82 | acl = btrfs_get_acl(inode, type); | 82 | acl = btrfs_get_acl(dentry->d_inode, type); |
83 | 83 | ||
84 | if (IS_ERR(acl)) | 84 | if (IS_ERR(acl)) |
85 | return PTR_ERR(acl); | 85 | return PTR_ERR(acl); |
@@ -153,8 +153,8 @@ out: | |||
153 | return ret; | 153 | return ret; |
154 | } | 154 | } |
155 | 155 | ||
156 | static int btrfs_xattr_set_acl(struct inode *inode, int type, | 156 | static int btrfs_xattr_acl_set(struct dentry *dentry, const char *name, |
157 | const void *value, size_t size) | 157 | const void *value, size_t size, int flags, int type) |
158 | { | 158 | { |
159 | int ret; | 159 | int ret; |
160 | struct posix_acl *acl = NULL; | 160 | struct posix_acl *acl = NULL; |
@@ -169,38 +169,13 @@ static int btrfs_xattr_set_acl(struct inode *inode, int type, | |||
169 | } | 169 | } |
170 | } | 170 | } |
171 | 171 | ||
172 | ret = btrfs_set_acl(NULL, inode, acl, type); | 172 | ret = btrfs_set_acl(NULL, dentry->d_inode, acl, type); |
173 | 173 | ||
174 | posix_acl_release(acl); | 174 | posix_acl_release(acl); |
175 | 175 | ||
176 | return ret; | 176 | return ret; |
177 | } | 177 | } |
178 | 178 | ||
179 | |||
180 | static int btrfs_xattr_acl_access_get(struct inode *inode, const char *name, | ||
181 | void *value, size_t size) | ||
182 | { | ||
183 | return btrfs_xattr_get_acl(inode, ACL_TYPE_ACCESS, value, size); | ||
184 | } | ||
185 | |||
186 | static int btrfs_xattr_acl_access_set(struct inode *inode, const char *name, | ||
187 | const void *value, size_t size, int flags) | ||
188 | { | ||
189 | return btrfs_xattr_set_acl(inode, ACL_TYPE_ACCESS, value, size); | ||
190 | } | ||
191 | |||
192 | static int btrfs_xattr_acl_default_get(struct inode *inode, const char *name, | ||
193 | void *value, size_t size) | ||
194 | { | ||
195 | return btrfs_xattr_get_acl(inode, ACL_TYPE_DEFAULT, value, size); | ||
196 | } | ||
197 | |||
198 | static int btrfs_xattr_acl_default_set(struct inode *inode, const char *name, | ||
199 | const void *value, size_t size, int flags) | ||
200 | { | ||
201 | return btrfs_xattr_set_acl(inode, ACL_TYPE_DEFAULT, value, size); | ||
202 | } | ||
203 | |||
204 | int btrfs_check_acl(struct inode *inode, int mask) | 179 | int btrfs_check_acl(struct inode *inode, int mask) |
205 | { | 180 | { |
206 | struct posix_acl *acl; | 181 | struct posix_acl *acl; |
@@ -308,14 +283,16 @@ int btrfs_acl_chmod(struct inode *inode) | |||
308 | 283 | ||
309 | struct xattr_handler btrfs_xattr_acl_default_handler = { | 284 | struct xattr_handler btrfs_xattr_acl_default_handler = { |
310 | .prefix = POSIX_ACL_XATTR_DEFAULT, | 285 | .prefix = POSIX_ACL_XATTR_DEFAULT, |
311 | .get = btrfs_xattr_acl_default_get, | 286 | .flags = ACL_TYPE_DEFAULT, |
312 | .set = btrfs_xattr_acl_default_set, | 287 | .get = btrfs_xattr_acl_get, |
288 | .set = btrfs_xattr_acl_set, | ||
313 | }; | 289 | }; |
314 | 290 | ||
315 | struct xattr_handler btrfs_xattr_acl_access_handler = { | 291 | struct xattr_handler btrfs_xattr_acl_access_handler = { |
316 | .prefix = POSIX_ACL_XATTR_ACCESS, | 292 | .prefix = POSIX_ACL_XATTR_ACCESS, |
317 | .get = btrfs_xattr_acl_access_get, | 293 | .flags = ACL_TYPE_ACCESS, |
318 | .set = btrfs_xattr_acl_access_set, | 294 | .get = btrfs_xattr_acl_get, |
295 | .set = btrfs_xattr_acl_set, | ||
319 | }; | 296 | }; |
320 | 297 | ||
321 | #else /* CONFIG_BTRFS_FS_POSIX_ACL */ | 298 | #else /* CONFIG_BTRFS_FS_POSIX_ACL */ |