loop: remove extra variable in lo_fallocate()
authorChaitanya Kulkarni <kch@nvidia.com>
Tue, 15 Feb 2022 21:33:08 +0000 (13:33 -0800)
committerJens Axboe <axboe@kernel.dk>
Sun, 27 Feb 2022 21:49:49 +0000 (14:49 -0700)
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 <kch@nvidia.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Link: https://lore.kernel.org/r/20220215213310.7264-3-kch@nvidia.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/loop.c

index a55e5eda1d174e1bc6a7eacde9a3f1dce8a755ac..77c61eaaa6e4ead144ad3d2fc1bf7d2342450e9f 100644 (file)
@@ -308,12 +308,11 @@ static int lo_fallocate(struct loop_device *lo, struct request *rq, loff_t pos,
         * a.k.a. discard/zerorange.
         */
        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;
        }