loop: Consolidate size calculation logic into lo_calculate_size()
authorRajeev Mishra <rajeevm@hpe.com>
Mon, 18 Aug 2025 18:48:20 +0000 (18:48 +0000)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Aug 2025 19:10:25 +0000 (13:10 -0600)
commit8aa5a3b68ad144da49a3d17f165e6561255e3529
treec1c1e2d0fa21208589ad99c078273581a8204e03
parent724216903700c7bee56464ab4634310fd4ede46b
loop: Consolidate size calculation logic into lo_calculate_size()

Renamed get_size to lo_calculate_size and merged the logic from get_size
and get_loop_size into a single function. Update all callers to use
lo_calculate_size. This is done in preparation for improving the size
detection logic.

Signed-off-by: Rajeev Mishra <rajeevm@hpe.com>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20250818184821.115033-2-rajeevm@hpe.com
[axboe: massage commit message]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/loop.c