[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200513133845.244903-7-maco@android.com>
Date: Wed, 13 May 2020 15:38:40 +0200
From: Martijn Coenen <maco@...roid.com>
To: axboe@...nel.dk, hch@....de, ming.lei@...hat.com
Cc: narayan@...gle.com, zezeozue@...gle.com, maco@...gle.com,
kernel-team@...roid.com, bvanassche@....org,
Chaitanya.Kulkarni@....com, jaegeuk@...nel.org,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
Martijn Coenen <maco@...roid.com>
Subject: [PATCH v5 06/11] 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.
Reviewed-by: Christoph Hellwig <hch@....de>
Signed-off-by: Martijn Coenen <maco@...roid.com>
---
drivers/block/loop.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index c134b3439483..e281a9f03d96 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -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;
}
--
2.26.2.645.ge9eca65c58-goog
Powered by blists - more mailing lists