From mboxrd@z Thu Jan 1 00:00:00 1970 From: tyeon Subject: [PATCH] block_dev : clean-up the code of thaw_bdev Date: Mon, 4 May 2015 18:22:09 +0900 Message-ID: <55473A41.5000506@windriver.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Cc: To: Alexander Viro Return-path: Received: from mail.windriver.com ([147.11.1.11]:40970 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750975AbbEDJXp (ORCPT ); Mon, 4 May 2015 05:23:45 -0400 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: the code in the "if (error) {" statment is duplicated with the last statment at the end of function. simply remove the mutex_unlock statement and return statement in there. Signed-off-by: Tom(JeHyeon) Yeon --- fs/block_dev.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/block_dev.c b/fs/block_dev.c index 975266b..01676ca 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -271,14 +271,13 @@ int thaw_bdev(struct block_device *bdev, struct super_block *sb) error = sb->s_op->thaw_super(sb); else error = thaw_super(sb); - if (error) { + + if (error) bdev->bd_fsfreeze_count++; - mutex_unlock(&bdev->bd_fsfreeze_mutex); - return error; - } + out: mutex_unlock(&bdev->bd_fsfreeze_mutex); - return 0; + return error; } EXPORT_SYMBOL(thaw_bdev); -- 1.7.9.5