aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorTsutomu Itoh <t-itoh@jp.fujitsu.com>2011-04-25 19:43:53 -0400
committerChris Mason <chris.mason@oracle.com>2011-04-25 19:43:53 -0400
commit7cf96da3ec7ca225acf4f284b0e904a1f5f98821 (patch)
tree48c1b0d42f40c47ac8e6a497d41d6d314a9a8a5d /fs/btrfs
parent64728bbbf892ea7a4aba502c436afbe362217fb9 (diff)
Btrfs: cleanup error handling in inode.c
The error processing of several places is changed like setting the error number only at the error. Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/inode.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index ad6b515173ac..870869aab0b8 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4731,9 +4731,10 @@ static int btrfs_mknod(struct inode *dir, struct dentry *dentry,
4731 inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name, 4731 inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name,
4732 dentry->d_name.len, dir->i_ino, objectid, 4732 dentry->d_name.len, dir->i_ino, objectid,
4733 BTRFS_I(dir)->block_group, mode, &index); 4733 BTRFS_I(dir)->block_group, mode, &index);
4734 err = PTR_ERR(inode); 4734 if (IS_ERR(inode)) {
4735 if (IS_ERR(inode)) 4735 err = PTR_ERR(inode);
4736 goto out_unlock; 4736 goto out_unlock;
4737 }
4737 4738
4738 err = btrfs_init_inode_security(trans, inode, dir); 4739 err = btrfs_init_inode_security(trans, inode, dir);
4739 if (err) { 4740 if (err) {
@@ -4792,9 +4793,10 @@ static int btrfs_create(struct inode *dir, struct dentry *dentry,
4792 inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name, 4793 inode = btrfs_new_inode(trans, root, dir, dentry->d_name.name,
4793 dentry->d_name.len, dir->i_ino, objectid, 4794 dentry->d_name.len, dir->i_ino, objectid,
4794 BTRFS_I(dir)->block_group, mode, &index); 4795 BTRFS_I(dir)->block_group, mode, &index);
4795 err = PTR_ERR(inode); 4796 if (IS_ERR(inode)) {
4796 if (IS_ERR(inode)) 4797 err = PTR_ERR(inode);
4797 goto out_unlock; 4798 goto out_unlock;
4799 }
4798 4800
4799 err = btrfs_init_inode_security(trans, inode, dir); 4801 err = btrfs_init_inode_security(trans, inode, dir);
4800 if (err) { 4802 if (err) {
@@ -7278,9 +7280,10 @@ static int btrfs_symlink(struct inode *dir, struct dentry *dentry,
7278 dentry->d_name.len, dir->i_ino, objectid, 7280 dentry->d_name.len, dir->i_ino, objectid,
7279 BTRFS_I(dir)->block_group, S_IFLNK|S_IRWXUGO, 7281 BTRFS_I(dir)->block_group, S_IFLNK|S_IRWXUGO,
7280 &index); 7282 &index);
7281 err = PTR_ERR(inode); 7283 if (IS_ERR(inode)) {
7282 if (IS_ERR(inode)) 7284 err = PTR_ERR(inode);
7283 goto out_unlock; 7285 goto out_unlock;
7286 }
7284 7287
7285 err = btrfs_init_inode_security(trans, inode, dir); 7288 err = btrfs_init_inode_security(trans, inode, dir);
7286 if (err) { 7289 if (err) {