mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-07 21:24:00 +08:00
loop: Remove figure_loop_size()
This function was now only used by loop_set_capacity(). Just open code the remaining code in the caller instead. Signed-off-by: Martijn Coenen <maco@android.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
b0bd158dd6
commit
0a6ed1b5ff
@ -245,14 +245,6 @@ static void loop_set_size(struct loop_device *lo, loff_t size)
|
||||
set_capacity_revalidate_and_notify(lo->lo_disk, size, false);
|
||||
}
|
||||
|
||||
static void
|
||||
figure_loop_size(struct loop_device *lo, loff_t offset, loff_t sizelimit)
|
||||
{
|
||||
loff_t size = get_size(offset, sizelimit, lo->lo_backing_file);
|
||||
|
||||
loop_set_size(lo, size);
|
||||
}
|
||||
|
||||
static inline int
|
||||
lo_do_transfer(struct loop_device *lo, int cmd,
|
||||
struct page *rpage, unsigned roffs,
|
||||
@ -1534,10 +1526,13 @@ loop_get_status64(struct loop_device *lo, struct loop_info64 __user *arg) {
|
||||
|
||||
static int loop_set_capacity(struct loop_device *lo)
|
||||
{
|
||||
loff_t size;
|
||||
|
||||
if (unlikely(lo->lo_state != Lo_bound))
|
||||
return -ENXIO;
|
||||
|
||||
figure_loop_size(lo, lo->lo_offset, lo->lo_sizelimit);
|
||||
size = get_loop_size(lo, lo->lo_backing_file);
|
||||
loop_set_size(lo, size);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user