Skip to content

Commit

Permalink
refactor dm_devsize
Browse files Browse the repository at this point in the history
Signed-off-by: Akira Hayakawa <[email protected]>
  • Loading branch information
akiradeveloper committed Nov 12, 2024
1 parent 0b936ff commit 6a27c00
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dm-writeboost-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ int wb_io_internal(struct wb_device *wb, struct dm_io_request *io_req,

sector_t dm_devsize(struct dm_dev *dev)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
return i_size_read(dev->bdev->bd_inode) >> 9;
#else
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0)
return bdev_nr_sectors(dev->bdev);
#else
return i_size_read(dev->bdev->bd_inode) >> 9;
#endif
}

Expand Down

0 comments on commit 6a27c00

Please sign in to comment.