diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 15:04:02 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-16 15:04:02 -0500 |
commit | bac5e54c29f352d962a2447d22735316b347b9f1 (patch) | |
tree | 7642993fa93164835ffaa2dacd341388193f1979 /fs/btrfs/acl.c | |
parent | 529e89430d6c0d64db8ac474cb95e68e2527c79a (diff) | |
parent | c05c4edd876b7ae92787d1295868afcb89b6a348 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (38 commits)
direct I/O fallback sync simplification
ocfs: stop using do_sync_mapping_range
cleanup blockdev_direct_IO locking
make generic_acl slightly more generic
sanitize xattr handler prototypes
libfs: move EXPORT_SYMBOL for d_alloc_name
vfs: force reval of target when following LAST_BIND symlinks (try #7)
ima: limit imbalance msg
Untangling ima mess, part 3: kill dead code in ima
Untangling ima mess, part 2: deal with counters
Untangling ima mess, part 1: alloc_file()
O_TRUNC open shouldn't fail after file truncation
ima: call ima_inode_free ima_inode_free
IMA: clean up the IMA counts updating code
ima: only insert at inode creation time
ima: valid return code from ima_inode_alloc
fs: move get_empty_filp() deffinition to internal.h
Sanitize exec_permission_lite()
Kill cached_lookup() and real_lookup()
Kill path_lookup_open()
...
Trivial conflicts in fs/direct-io.c
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 361604244271..52cbe47022bf 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); |
@@ -151,8 +151,8 @@ out: | |||
151 | return ret; | 151 | return ret; |
152 | } | 152 | } |
153 | 153 | ||
154 | static int btrfs_xattr_set_acl(struct inode *inode, int type, | 154 | static int btrfs_xattr_acl_set(struct dentry *dentry, const char *name, |
155 | const void *value, size_t size) | 155 | const void *value, size_t size, int flags, int type) |
156 | { | 156 | { |
157 | int ret = 0; | 157 | int ret = 0; |
158 | struct posix_acl *acl = NULL; | 158 | struct posix_acl *acl = NULL; |
@@ -167,38 +167,13 @@ static int btrfs_xattr_set_acl(struct inode *inode, int type, | |||
167 | } | 167 | } |
168 | } | 168 | } |
169 | 169 | ||
170 | ret = btrfs_set_acl(inode, acl, type); | 170 | ret = btrfs_set_acl(dentry->d_inode, acl, type); |
171 | 171 | ||
172 | posix_acl_release(acl); | 172 | posix_acl_release(acl); |
173 | 173 | ||
174 | return ret; | 174 | return ret; |
175 | } | 175 | } |
176 | 176 | ||
177 | |||
178 | static int btrfs_xattr_acl_access_get(struct inode *inode, const char *name, | ||
179 | void *value, size_t size) | ||
180 | { | ||
181 | return btrfs_xattr_get_acl(inode, ACL_TYPE_ACCESS, value, size); | ||
182 | } | ||
183 | |||
184 | static int btrfs_xattr_acl_access_set(struct inode *inode, const char *name, | ||
185 | const void *value, size_t size, int flags) | ||
186 | { | ||
187 | return btrfs_xattr_set_acl(inode, ACL_TYPE_ACCESS, value, size); | ||
188 | } | ||
189 | |||
190 | static int btrfs_xattr_acl_default_get(struct inode *inode, const char *name, | ||
191 | void *value, size_t size) | ||
192 | { | ||
193 | return btrfs_xattr_get_acl(inode, ACL_TYPE_DEFAULT, value, size); | ||
194 | } | ||
195 | |||
196 | static int btrfs_xattr_acl_default_set(struct inode *inode, const char *name, | ||
197 | const void *value, size_t size, int flags) | ||
198 | { | ||
199 | return btrfs_xattr_set_acl(inode, ACL_TYPE_DEFAULT, value, size); | ||
200 | } | ||
201 | |||
202 | int btrfs_check_acl(struct inode *inode, int mask) | 177 | int btrfs_check_acl(struct inode *inode, int mask) |
203 | { | 178 | { |
204 | struct posix_acl *acl; | 179 | struct posix_acl *acl; |
@@ -303,14 +278,16 @@ int btrfs_acl_chmod(struct inode *inode) | |||
303 | 278 | ||
304 | struct xattr_handler btrfs_xattr_acl_default_handler = { | 279 | struct xattr_handler btrfs_xattr_acl_default_handler = { |
305 | .prefix = POSIX_ACL_XATTR_DEFAULT, | 280 | .prefix = POSIX_ACL_XATTR_DEFAULT, |
306 | .get = btrfs_xattr_acl_default_get, | 281 | .flags = ACL_TYPE_DEFAULT, |
307 | .set = btrfs_xattr_acl_default_set, | 282 | .get = btrfs_xattr_acl_get, |
283 | .set = btrfs_xattr_acl_set, | ||
308 | }; | 284 | }; |
309 | 285 | ||
310 | struct xattr_handler btrfs_xattr_acl_access_handler = { | 286 | struct xattr_handler btrfs_xattr_acl_access_handler = { |
311 | .prefix = POSIX_ACL_XATTR_ACCESS, | 287 | .prefix = POSIX_ACL_XATTR_ACCESS, |
312 | .get = btrfs_xattr_acl_access_get, | 288 | .flags = ACL_TYPE_ACCESS, |
313 | .set = btrfs_xattr_acl_access_set, | 289 | .get = btrfs_xattr_acl_get, |
290 | .set = btrfs_xattr_acl_set, | ||
314 | }; | 291 | }; |
315 | 292 | ||
316 | #else /* CONFIG_BTRFS_FS_POSIX_ACL */ | 293 | #else /* CONFIG_BTRFS_FS_POSIX_ACL */ |