Skip to content

Commit

Permalink
dm writecache: use bdev_nr_sectors() instead of open-coded equivalent
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Snitzer <[email protected]>
  • Loading branch information
snitm committed Feb 9, 2021
1 parent 4134455 commit d9928ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/md/dm-writecache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d9928ac

Please sign in to comment.