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

SF Markus Elfring
2015-07-05T13:32:21Z

From: Markus Elfring <elfring@users.sourceforge.net>
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@users.sourceforge.net>
---
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