struct posix_acl *acl)
{
spin_lock(&inode->i_lock);
- if (*i_acl != ERR_PTR(-ENODATA))
+ if (*i_acl != ACL_NOT_CACHED)
posix_acl_release(*i_acl);
*i_acl = posix_acl_dup(acl);
spin_unlock(&inode->i_lock);
static inline struct posix_acl *iget_acl(struct inode *inode,
struct posix_acl **i_acl)
{
- struct posix_acl *acl = ERR_PTR(-ENODATA);
+ struct posix_acl *acl = ACL_NOT_CACHED;
spin_lock(&inode->i_lock);
- if (*i_acl != ERR_PTR(-ENODATA))
+ if (*i_acl != ACL_NOT_CACHED)
acl = posix_acl_dup(*i_acl);
spin_unlock(&inode->i_lock);
struct posix_acl *acl, **p_acl;
int size;
int retval;
- struct reiserfs_inode_info *reiserfs_i = REISERFS_I(inode);
switch (type) {
case ACL_TYPE_ACCESS:
name = POSIX_ACL_XATTR_ACCESS;
- p_acl = &reiserfs_i->i_acl_access;
+ p_acl = &inode->i_acl;
break;
case ACL_TYPE_DEFAULT:
name = POSIX_ACL_XATTR_DEFAULT;
- p_acl = &reiserfs_i->i_acl_default;
+ p_acl = &inode->i_default_acl;
break;
default:
return ERR_PTR(-EINVAL);
}
acl = iget_acl(inode, p_acl);
- if (acl && !IS_ERR(acl))
+ if (acl != ACL_NOT_CACHED)
return acl;
- else if (PTR_ERR(acl) == -ENODATA)
- return NULL;
size = reiserfs_xattr_get(inode, name, NULL, 0);
if (size < 0) {
if (size == -ENODATA || size == -ENOSYS) {
- *p_acl = ERR_PTR(-ENODATA);
+ *p_acl = NULL;
return NULL;
}
return ERR_PTR(size);
/* This shouldn't actually happen as it should have
been caught above.. but just in case */
acl = NULL;
- *p_acl = ERR_PTR(-ENODATA);
+ *p_acl = acl;
} else if (retval < 0) {
acl = ERR_PTR(retval);
} else {
struct posix_acl **p_acl;
size_t size = 0;
int error;
- struct reiserfs_inode_info *reiserfs_i = REISERFS_I(inode);
if (S_ISLNK(inode->i_mode))
return -EOPNOTSUPP;
switch (type) {
case ACL_TYPE_ACCESS:
name = POSIX_ACL_XATTR_ACCESS;
- p_acl = &reiserfs_i->i_acl_access;
+ p_acl = &inode->i_acl;
if (acl) {
mode_t mode = inode->i_mode;
error = posix_acl_equiv_mode(acl, &mode);
break;
case ACL_TYPE_DEFAULT:
name = POSIX_ACL_XATTR_DEFAULT;
- p_acl = &reiserfs_i->i_acl_default;
+ p_acl = &inode->i_default_acl;
if (!S_ISDIR(inode->i_mode))
return acl ? -EACCES : 0;
break;
}
acl = reiserfs_get_acl(dir, ACL_TYPE_DEFAULT);
- if (IS_ERR(acl)) {
- if (PTR_ERR(acl) == -ENODATA)
- goto apply_umask;
+ if (IS_ERR(acl))
return PTR_ERR(acl);
- }
if (acl) {
struct posix_acl *acl_copy;