[PATCH 04/11] ocfs2: One check less in ocfs2_statfs()

From: SF Markus Elfring
Date: Sun Jul 05 2015 - 09:32:36 EST


From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 4 Jul 2015 16:28:50 +0200

Delete a check for the variable "status" by adjustment of two jump targets
according to the Linux coding style convention.
Separate the exception handling statements from the ordinary execution path.

Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
fs/ocfs2/super.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 37e418f..ed16f08 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -1692,14 +1692,12 @@ static int ocfs2_statfs(struct dentry *dentry, struct kstatfs *buf)
if (!inode) {
mlog(ML_ERROR, "failed to get bitmap inode\n");
status = -EIO;
- goto bail;
+ goto log_error;
}

status = ocfs2_inode_lock(inode, &bh, 0);
- if (status < 0) {
- mlog_errno(status);
- goto bail;
- }
+ if (status < 0)
+ goto put_inode;

bm_lock = (struct ocfs2_dinode *) bh->b_data;

@@ -1724,13 +1722,12 @@ static int ocfs2_statfs(struct dentry *dentry, struct kstatfs *buf)
brelse(bh);

ocfs2_inode_unlock(inode, 0);
- status = 0;
-bail:
iput(inode);
-
- if (status)
- mlog_errno(status);
-
+ return 0;
+put_inode:
+ iput(inode);
+log_error:
+ mlog_errno(status);
return status;
}

--
2.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/