Thread (14 messages) 14 messages, 2 authors, 2021-06-24

[PATCH 6/9] loop: remove extra variable in lo_fallocate()

flat view
STALE1938d

From: Chaitanya Kulkarni <hidden>
Date: 2021-06-22 23:21:01
Subsystem: block layer, the rest · Maintainers: Jens Axboe, Linus Torvalds

The local variable q is used to pass it to the blk_queue_discard(). We
can get away with using lo->lo_queue instead of storing in a local
variable which is not used anywhere else.

No functional change in this patch.

Signed-off-by: Chaitanya Kulkarni <redacted>
---
 drivers/block/loop.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index abb9f05e5a53..52f0b68466c0 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -437,12 +437,11 @@ static int lo_fallocate(struct loop_device *lo, struct request *rq, loff_t pos,
 	 * information.
 	 */
 	struct file *file = lo->lo_backing_file;
-	struct request_queue *q = lo->lo_queue;
 	int ret;
 
 	mode |= FALLOC_FL_KEEP_SIZE;
 
-	if (!blk_queue_discard(q)) {
+	if (!blk_queue_discard(lo->lo_queue)) {
 		ret = -EOPNOTSUPP;
 		goto out;
 	}
-- 
2.22.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help