mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
loop: set physical block size to PAGE_SIZE
The physical block size is "the lowest possible sector size that the hardware can operate on without reverting to read-modify-write operations" (from the comment on blk_queue_physical_block_size()). Since loop does buffered I/O on the backing file by default, the RMW unit is a page. This isn't the case for direct I/O mode, but let's keep it simple. Reviewed-by: Ming Lei <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Omar Sandoval <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
1 parent
8a0740c410
commit
6c6b6f28b3
1 file changed
+2
@@ -1764,6 +1764,8 @@ static int loop_add(struct loop_device **l, int i)
|
||||
}
|
||||
lo->lo_queue->queuedata = lo;
|
||||
|
||||
blk_queue_physical_block_size(lo->lo_queue, PAGE_SIZE);
|
||||
|
||||
/*
|
||||
* It doesn't make sense to enable merge because the I/O
|
||||
* submitted to backing file is handled page by page.
|
||||
|
||||
Reference in new issue
Block a user