]> www.infradead.org Git - users/jedix/linux-maple.git/commit
brd: avoid extra xarray lookups on first write
authorChristoph Hellwig <hch@lst.de>
Wed, 7 May 2025 06:06:35 +0000 (08:06 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 14 May 2025 11:44:13 +0000 (05:44 -0600)
commitbbcacab2e8ee373eb8f4bc613912e7c203deb820
treed0de28161d1bca9aa0821fb44438f093f0bd46f8
parent1e332795d00655305cf0ae40be4e2eaa9a399d79
brd: avoid extra xarray lookups on first write

The xarray can return the previous entry at a location.  Use this
fact to simplify the brd code when there is no existing page at
a location.  This also slighly improves the handling of racy
discards as we now always have a page under RCU protection by the
time we are ready to copy the data.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20250507060700.3929430-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/brd.c