diff options
author | Mike Snitzer <snitzer@redhat.com> | 2021-02-09 22:53:05 +0100 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2021-02-09 23:09:02 +0100 |
commit | d9928ac5eba5b129299e9d032b79d436336339f6 (patch) | |
tree | 73d4fb78ec69213be3324673d3bfe4a09ed5dac8 /drivers/md/dm-writecache.c | |
parent | dm writecache: fix writing beyond end of underlying device when shrinking (diff) | |
download | linux-d9928ac5eba5b129299e9d032b79d436336339f6.tar.xz linux-d9928ac5eba5b129299e9d032b79d436336339f6.zip |
dm writecache: use bdev_nr_sectors() instead of open-coded equivalent
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to '')
-rw-r--r-- | drivers/md/dm-writecache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index baf5a9ce2b25..844c4be11768 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -978,7 +978,7 @@ static void writecache_resume(struct dm_target *ti) wc_lock(wc); - wc->data_device_sectors = i_size_read(wc->dev->bdev->bd_inode) >> SECTOR_SHIFT; + wc->data_device_sectors = bdev_nr_sectors(wc->dev->bdev); if (WC_MODE_PMEM(wc)) { persistent_memory_invalidate_cache(wc->memory_map, wc->memory_map_size); |