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>
Loading
Please register or sign in to comment