VFS: assorted d_backing_inode() annotations
[linux-2.6-block.git] / fs / posix_acl.c
index 0855f772cd41599d6c1d1091e7da616d32cccf53..84bb65b835701365126833a9e74d9e5d7a8a6c00 100644 (file)
@@ -564,13 +564,11 @@ posix_acl_create(struct inode *dir, umode_t *mode,
 
        *acl = posix_acl_clone(p, GFP_NOFS);
        if (!*acl)
-               return -ENOMEM;
+               goto no_mem;
 
        ret = posix_acl_create_masq(*acl, mode);
-       if (ret < 0) {
-               posix_acl_release(*acl);
-               return -ENOMEM;
-       }
+       if (ret < 0)
+               goto no_mem_clone;
 
        if (ret == 0) {
                posix_acl_release(*acl);
@@ -591,6 +589,12 @@ no_acl:
        *default_acl = NULL;
        *acl = NULL;
        return 0;
+
+no_mem_clone:
+       posix_acl_release(*acl);
+no_mem:
+       posix_acl_release(p);
+       return -ENOMEM;
 }
 EXPORT_SYMBOL_GPL(posix_acl_create);
 
@@ -770,12 +774,12 @@ posix_acl_xattr_get(struct dentry *dentry, const char *name,
        struct posix_acl *acl;
        int error;
 
-       if (!IS_POSIXACL(dentry->d_inode))
+       if (!IS_POSIXACL(d_backing_inode(dentry)))
                return -EOPNOTSUPP;
-       if (S_ISLNK(dentry->d_inode->i_mode))
+       if (d_is_symlink(dentry))
                return -EOPNOTSUPP;
 
-       acl = get_acl(dentry->d_inode, type);
+       acl = get_acl(d_backing_inode(dentry), type);
        if (IS_ERR(acl))
                return PTR_ERR(acl);
        if (acl == NULL)
@@ -791,7 +795,7 @@ static int
 posix_acl_xattr_set(struct dentry *dentry, const char *name,
                const void *value, size_t size, int flags, int type)
 {
-       struct inode *inode = dentry->d_inode;
+       struct inode *inode = d_backing_inode(dentry);
        struct posix_acl *acl = NULL;
        int ret;
 
@@ -830,9 +834,9 @@ posix_acl_xattr_list(struct dentry *dentry, char *list, size_t list_size,
        const char *xname;
        size_t size;
 
-       if (!IS_POSIXACL(dentry->d_inode))
+       if (!IS_POSIXACL(d_backing_inode(dentry)))
                return -EOPNOTSUPP;
-       if (S_ISLNK(dentry->d_inode->i_mode))
+       if (d_is_symlink(dentry))
                return -EOPNOTSUPP;
 
        if (type == ACL_TYPE_ACCESS)