summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2009-06-08 21:01:13 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2009-06-24 08:17:06 -0400
commit7a77b15d9294749809de918e24bebc39e0fbc9ab (patch)
treed5e0d6d46dbcfece1c99854fbfc642e671d12b53 /fs
parente68888bcb60ccba4dc21df9f2d8cd7325b64dce7 (diff)
downloadlinux-3.10-7a77b15d9294749809de918e24bebc39e0fbc9ab.tar.gz
linux-3.10-7a77b15d9294749809de918e24bebc39e0fbc9ab.tar.bz2
linux-3.10-7a77b15d9294749809de918e24bebc39e0fbc9ab.zip
switch reiserfs to usual conventions for caching ACLs
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/reiserfs/super.c12
-rw-r--r--fs/reiserfs/xattr_acl.c21
2 files changed, 14 insertions, 19 deletions
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 2969773cfc2..b194451fc04 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -530,8 +530,8 @@ static void init_once(void *foo)
INIT_LIST_HEAD(&ei->i_prealloc_list);
inode_init_once(&ei->vfs_inode);
#ifdef CONFIG_REISERFS_FS_POSIX_ACL
- ei->i_acl_access = NULL;
- ei->i_acl_default = NULL;
+ ei->i_acl_access = ACL_NOT_CACHED;
+ ei->i_acl_default = ACL_NOT_CACHED;
#endif
}
@@ -586,14 +586,14 @@ static void reiserfs_clear_inode(struct inode *inode)
struct posix_acl *acl;
acl = REISERFS_I(inode)->i_acl_access;
- if (acl && !IS_ERR(acl))
+ if (acl && acl != ACL_NOT_CACHED)
posix_acl_release(acl);
- REISERFS_I(inode)->i_acl_access = NULL;
+ REISERFS_I(inode)->i_acl_access = ACL_NOT_CACHED;
acl = REISERFS_I(inode)->i_acl_default;
- if (acl && !IS_ERR(acl))
+ if (acl && acl != ACL_NOT_CACHED)
posix_acl_release(acl);
- REISERFS_I(inode)->i_acl_default = NULL;
+ REISERFS_I(inode)->i_acl_default = ACL_NOT_CACHED;
}
#else
#define reiserfs_clear_inode NULL
diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c
index a1a7e3530e1..7b3aeb9327d 100644
--- a/fs/reiserfs/xattr_acl.c
+++ b/fs/reiserfs/xattr_acl.c
@@ -192,19 +192,19 @@ static inline void iset_acl(struct inode *inode, struct posix_acl **i_acl,
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 = acl ? posix_acl_dup(acl) : ERR_PTR(-ENODATA);
+ *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);
@@ -239,15 +239,13 @@ struct posix_acl *reiserfs_get_acl(struct inode *inode, int type)
}
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);
@@ -262,7 +260,7 @@ struct posix_acl *reiserfs_get_acl(struct inode *inode, int type)
/* 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 {
@@ -379,11 +377,8 @@ reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th,
}
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;