diff mbox series

[RFC,10/20] loop: remove extra variable in lo_req_flush

Message ID 20210202053552.4844-11-chaitanya.kulkarni@wdc.com (mailing list archive)
State New, archived
Headers show
Series loop: cleanup and small improvement | expand

Commit Message

Chaitanya Kulkarni Feb. 2, 2021, 5:35 a.m. UTC
The local variable file is used to pass it to the vfs_fsync(). We can
get away with using lo->lo_backing_file instead of storing in a local
variable which is not used anywhere else.

No functional change in this patch.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
 drivers/block/loop.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)


Johannes Thumshirn Feb. 2, 2021, 11:50 a.m. UTC | #1
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
diff mbox series


diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index f9f352c7a56f..b8028c6d5ecc 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -452,8 +452,7 @@  static int lo_fallocate(struct loop_device *lo, struct request *rq, loff_t pos,
 static int lo_req_flush(struct loop_device *lo, struct request *rq)
-	struct file *file = lo->lo_backing_file;
-	int ret = vfs_fsync(file, 0);
+	int ret = vfs_fsync(lo->lo_backing_file, 0);
 	if (unlikely(ret && ret != -EINVAL))
 		ret = -EIO;