15 ext3_acl_from_disk(
const void *
value,
size_t size)
17 const char *
end = (
char *)value + size;
29 count = ext3_acl_count(size);
37 for (n=0; n <
count; n++) {
49 value = (
char *)value +
55 if ((
char *)value >
end)
63 if ((
char *)value >
end)
79 posix_acl_release(acl);
87 ext3_acl_to_disk(
const struct posix_acl *acl,
size_t *size)
93 *size = ext3_acl_size(acl->
a_count);
100 for (n=0; n < acl->
a_count; n++) {
105 switch(acl_e->
e_tag) {
128 return (
char *)ext_acl;
151 acl = get_cached_acl(inode, type);
174 acl = ext3_acl_from_disk(value, retval);
178 acl = ERR_PTR(retval);
182 set_cached_acl(inode, type, acl);
230 value = ext3_acl_to_disk(acl, &size);
232 return (
int)PTR_ERR(value);
241 set_cached_acl(inode, type, acl);
269 error = ext3_set_acl(handle, inode,
284 posix_acl_release(acl);
315 if (IS_ERR(acl) || !acl)
321 handle = ext3_journal_start(inode,
323 if (IS_ERR(handle)) {
324 error = PTR_ERR(handle);
334 posix_acl_release(acl);
349 if (list && size <= list_len)
355 ext3_xattr_list_acl_default(
struct dentry *dentry,
char *list,
size_t list_len,
356 const char *name,
size_t name_len,
int type)
362 if (list && size <= list_len)
368 ext3_xattr_get_acl(
struct dentry *dentry,
const char *name,
void *
buffer,
369 size_t size,
int type)
374 if (
strcmp(name,
"") != 0)
385 posix_acl_release(acl);
391 ext3_xattr_set_acl(
struct dentry *dentry,
const char *name,
const void *value,
392 size_t size,
int flags,
int type)
394 struct inode *inode = dentry->
d_inode;
399 if (
strcmp(name,
"") != 0)
413 goto release_and_out;
421 return PTR_ERR(handle);
422 error = ext3_set_acl(handle, inode, type, acl);
428 posix_acl_release(acl);
435 .list = ext3_xattr_list_acl_access,
436 .get = ext3_xattr_get_acl,
437 .set = ext3_xattr_set_acl,
443 .list = ext3_xattr_list_acl_default,
444 .get = ext3_xattr_get_acl,
445 .set = ext3_xattr_set_acl,