diff options
author | Christoph Hellwig <hch@lst.de> | 2021-11-29 11:21:48 +0100 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2021-12-04 08:58:52 -0800 |
commit | 60696eb26a37ab0199f7833ddbc1b75138c36d16 (patch) | |
tree | 61e1603ff08e1f39bf0b6baa2425790ab060aa1e /drivers/dax | |
parent | 429f8de70d9872c5ca9b3914b3c4db5659779331 (diff) | |
download | linux-stable-60696eb26a37ab0199f7833ddbc1b75138c36d16.tar.gz linux-stable-60696eb26a37ab0199f7833ddbc1b75138c36d16.tar.bz2 linux-stable-60696eb26a37ab0199f7833ddbc1b75138c36d16.zip |
fsdax: simplify the pgoff calculation
Replace the two steps of dax_iomap_sector and bdev_dax_pgoff with a
single dax_iomap_pgoff helper that avoids lots of cumbersome sector
conversions.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/20211129102203.2243509-15-hch@lst.de
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dax')
-rw-r--r-- | drivers/dax/super.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/drivers/dax/super.c b/drivers/dax/super.c index 90b5733f5a70..45d931aefd06 100644 --- a/drivers/dax/super.c +++ b/drivers/dax/super.c @@ -66,20 +66,6 @@ void dax_remove_host(struct gendisk *disk) } EXPORT_SYMBOL_GPL(dax_remove_host); -int bdev_dax_pgoff(struct block_device *bdev, sector_t sector, size_t size, - pgoff_t *pgoff) -{ - sector_t start_sect = bdev ? get_start_sect(bdev) : 0; - phys_addr_t phys_off = (start_sect + sector) * 512; - - if (pgoff) - *pgoff = PHYS_PFN(phys_off); - if (phys_off % PAGE_SIZE || size % PAGE_SIZE) - return -EINVAL; - return 0; -} -EXPORT_SYMBOL(bdev_dax_pgoff); - /** * fs_dax_get_by_bdev() - temporary lookup mechanism for filesystem-dax * @bdev: block device to find a dax_device for |