Skip to contentSkip to conversation

block_dev : clean-up the code of thaw_bdev

PATCH New tyeon 1 participant 1 message May 4, 2015 VFS

lore
Share & tools
lore

tyeon

author
#0 lore raw

PATCH 1/1 block_dev : clean-up the code of thaw_bdev

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.

---
 fs/block_dev.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
fs/block_dev.c +4 -5
index 975266b..01676ca 100644
@@ -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);
 
Signature · 1 line
1.7.9.5