[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200406222148.28365-4-chaitanya.kulkarni@wdc.com>
Date: Mon, 6 Apr 2020 15:21:47 -0700
From: Chaitanya Kulkarni <chaitanya.kulkarni@....com>
To: hch@....de, martin.petersen@...cle.com
Cc: darrick.wong@...cle.com, axboe@...nel.dk, tytso@....edu,
adilger.kernel@...ger.ca, ming.lei@...hat.com, jthumshirn@...e.de,
minwoo.im.dev@...il.com, chaitanya.kulkarni@....com,
damien.lemoal@....com, andrea.parri@...rulasolutions.com,
hare@...e.com, tj@...nel.org, hannes@...xchg.org,
khlebnikov@...dex-team.ru, ajay.joshi@....com, bvanassche@....org,
arnd@...db.de, houtao1@...wei.com, asml.silence@...il.com,
ktkhai@...tuozzo.com, linux-block@...r.kernel.org,
linux-ext4@...r.kernel.org
Subject: [PATCH V2 3/4] loop: Forward REQ_OP_ALLOCATE into fallocate(0)
From: Kirill Tkhai <ktkhai@...tuozzo.com>
Send fallocate(0) request into underlining filesystem after upper
filesystem sent REQ_OP_ALLOCATE request to block device.
Signed-off-by: Kirill Tkhai <ktkhai@...tuozzo.com>
[Use blk_queue_max_allocate_sectors() from newly updated previous
patch.]
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@....com>
---
drivers/block/loop.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index a42c49e04954..26ff16e34f5a 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -611,6 +611,8 @@ static int do_req_filebacked(struct loop_device *lo, struct request *rq)
FALLOC_FL_PUNCH_HOLE);
case REQ_OP_DISCARD:
return lo_fallocate(lo, rq, pos, FALLOC_FL_PUNCH_HOLE);
+ case REQ_OP_ALLOCATE:
+ return lo_fallocate(lo, rq, pos, 0);
case REQ_OP_WRITE:
if (lo->transfer)
return lo_write_transfer(lo, rq, pos);
@@ -878,6 +880,7 @@ static void loop_config_discard(struct loop_device *lo)
q->limits.discard_granularity = 0;
q->limits.discard_alignment = 0;
blk_queue_max_discard_sectors(q, 0);
+ blk_queue_max_allocate_sectors(q, 0);
blk_queue_max_write_zeroes_sectors(q, 0);
blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
return;
@@ -888,6 +891,7 @@ static void loop_config_discard(struct loop_device *lo)
blk_queue_max_discard_sectors(q, UINT_MAX >> 9);
blk_queue_max_write_zeroes_sectors(q, UINT_MAX >> 9);
+ blk_queue_max_allocate_sectors(q, UINT_MAX >> 9);
blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
}
@@ -1919,6 +1923,7 @@ static blk_status_t loop_queue_rq(struct blk_mq_hw_ctx *hctx,
case REQ_OP_FLUSH:
case REQ_OP_DISCARD:
case REQ_OP_WRITE_ZEROES:
+ case REQ_OP_ALLOCATE:
cmd->use_aio = false;
break;
default:
--
2.22.0
Powered by blists - more mailing lists