Convert ERR_PTR(PTR_ERR(p)) instances to ERR_CAST(p)
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / fs / reiserfs / xattr.c
index fab4b9b2664fff2d460e93ef87f5d606be32a082..eba037b3338fe8c2c480318d38441d3de65aab51 100644 (file)
@@ -155,7 +155,7 @@ static struct dentry *get_xa_file_dentry(const struct inode *inode,
 
        xadir = open_xa_dir(inode, flags);
        if (IS_ERR(xadir)) {
-               return ERR_PTR(PTR_ERR(xadir));
+               return ERR_CAST(xadir);
        } else if (xadir && !xadir->d_inode) {
                dput(xadir);
                return ERR_PTR(-ENODATA);
@@ -164,7 +164,7 @@ static struct dentry *get_xa_file_dentry(const struct inode *inode,
        xafile = lookup_one_len(name, xadir, strlen(name));
        if (IS_ERR(xafile)) {
                dput(xadir);
-               return ERR_PTR(PTR_ERR(xafile));
+               return ERR_CAST(xafile);
        }
 
        if (xafile->d_inode) {  /* file exists */
@@ -484,7 +484,7 @@ reiserfs_xattr_set(struct inode *inode, const char *name, const void *buffer,
        /* Resize it so we're ok to write there */
        newattrs.ia_size = buffer_size;
        newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
-       mutex_lock(&xinode->i_mutex);
+       mutex_lock_nested(&xinode->i_mutex, I_MUTEX_XATTR);
        err = notify_change(fp->f_path.dentry, &newattrs);
        if (err)
                goto out_filp;
@@ -1084,7 +1084,7 @@ ssize_t reiserfs_listxattr(struct dentry * dentry, char *buffer, size_t size)
 }
 
 /* This is the implementation for the xattr plugin infrastructure */
-static struct list_head xattr_handlers = LIST_HEAD_INIT(xattr_handlers);
+static LIST_HEAD(xattr_handlers);
 static DEFINE_RWLOCK(handler_lock);
 
 static struct reiserfs_xattr_handler *find_xattr_handler_prefix(const char
@@ -1223,7 +1223,8 @@ int reiserfs_xattr_init(struct super_block *s, int mount_flags)
                if (!IS_ERR(dentry)) {
                        if (!(mount_flags & MS_RDONLY) && !dentry->d_inode) {
                                struct inode *inode = dentry->d_parent->d_inode;
-                               mutex_lock(&inode->i_mutex);
+                               mutex_lock_nested(&inode->i_mutex,
+                                                 I_MUTEX_XATTR);
                                err = inode->i_op->mkdir(inode, dentry, 0700);
                                mutex_unlock(&inode->i_mutex);
                                if (err) {