diff options
author | Mike Snitzer <snitzer@redhat.com> | 2021-02-09 16:53:05 -0500 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2021-02-09 17:09:02 -0500 |
commit | d9928ac5eba5b129299e9d032b79d436336339f6 (patch) | |
tree | 73d4fb78ec69213be3324673d3bfe4a09ed5dac8 /drivers/md | |
parent | 4134455f2aafdfeab50cabb4cccb35e916034b93 (diff) | |
download | lwn-d9928ac5eba5b129299e9d032b79d436336339f6.tar.gz lwn-d9928ac5eba5b129299e9d032b79d436336339f6.zip |
dm writecache: use bdev_nr_sectors() instead of open-coded equivalent
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md')
-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); |