]> git.baikalelectronics.ru Git - kernel.git/commitdiff
dm writecache: use bdev_nr_sectors() instead of open-coded equivalent
authorMike Snitzer <snitzer@redhat.com>
Tue, 9 Feb 2021 21:53:05 +0000 (16:53 -0500)
committerMike Snitzer <snitzer@redhat.com>
Tue, 9 Feb 2021 22:09:02 +0000 (17:09 -0500)
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-writecache.c

index baf5a9ce2b25c8fcdca614fe79af288530772c30..844c4be11768d3dc798f22199ddcfc8142eacb7c 100644 (file)
@@ -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);