[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <157599697369.12112.10138136904533871162.stgit@localhost.localdomain>
Date: Tue, 10 Dec 2019 19:56:13 +0300
From: Kirill Tkhai <ktkhai@...tuozzo.com>
To: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-ext4@...r.kernel.org
Cc: axboe@...nel.dk, tytso@....edu, adilger.kernel@...ger.ca,
ming.lei@...hat.com, osandov@...com, jthumshirn@...e.de,
minwoo.im.dev@...il.com, damien.lemoal@....com,
ktkhai@...tuozzo.com, andrea.parri@...rulasolutions.com,
hare@...e.com, tj@...nel.org, ajay.joshi@....com, sagi@...mberg.me,
dsterba@...e.com, chaitanya.kulkarni@....com, bvanassche@....org,
dhowells@...hat.com, asml.silence@...il.com
Subject: [PATCH RFC 2/3] loop: Forward REQ_OP_ASSIGN_RANGE into fallocate(0)
Send fallocate(0) request into underlining filesystem
after upper filesystem sent REQ_OP_ASSIGN_RANGE request
to block device.
Signed-off-by: Kirill Tkhai <ktkhai@...tuozzo.com>
---
drivers/block/loop.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 739b372a5112..d99d9193de7a 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -609,6 +609,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_ASSIGN_RANGE:
+ return lo_fallocate(lo, rq, pos, 0);
case REQ_OP_WRITE:
if (lo->transfer)
return lo_write_transfer(lo, rq, pos);
@@ -875,6 +877,7 @@ static void loop_config_discard(struct loop_device *lo)
lo->lo_encrypt_key_size) {
q->limits.discard_granularity = 0;
q->limits.discard_alignment = 0;
+ q->limits.max_assign_range_sectors = 0;
blk_queue_max_discard_sectors(q, 0);
blk_queue_max_write_zeroes_sectors(q, 0);
blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
@@ -883,6 +886,7 @@ static void loop_config_discard(struct loop_device *lo)
q->limits.discard_granularity = inode->i_sb->s_blocksize;
q->limits.discard_alignment = 0;
+ q->limits.max_assign_range_sectors = UINT_MAX >> 9;
blk_queue_max_discard_sectors(q, UINT_MAX >> 9);
blk_queue_max_write_zeroes_sectors(q, UINT_MAX >> 9);
@@ -1917,6 +1921,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_ASSIGN_RANGE:
cmd->use_aio = false;
break;
default:
Powered by blists - more mailing lists