diff options
author | Dan Williams <dan.j.williams@intel.com> | 2017-09-01 02:25:59 +0300 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2017-09-01 02:25:59 +0300 |
commit | 8f98ae0c9b90bb46097e4f28e81e9ae6148e5694 (patch) | |
tree | c1d0f0d9b0733bf3271780e45d7a1c299fe2fc48 /drivers/dax | |
parent | 58738c495e15badd2015e19ff41f1f1ed55200bc (diff) | |
parent | 5e405595e5bf4c09fab9ca1e7dbe5b62872757b5 (diff) | |
download | linux-8f98ae0c9b90bb46097e4f28e81e9ae6148e5694.tar.xz |
Merge branch 'for-4.14/fs' into libnvdimm-for-next
Diffstat (limited to 'drivers/dax')
-rw-r--r-- | drivers/dax/super.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/dax/super.c b/drivers/dax/super.c index ce9e563e6e1d..b699aac268a6 100644 --- a/drivers/dax/super.c +++ b/drivers/dax/super.c @@ -46,6 +46,8 @@ void dax_read_unlock(int id) EXPORT_SYMBOL_GPL(dax_read_unlock); #ifdef CONFIG_BLOCK +#include <linux/blkdev.h> + int bdev_dax_pgoff(struct block_device *bdev, sector_t sector, size_t size, pgoff_t *pgoff) { @@ -59,6 +61,14 @@ int bdev_dax_pgoff(struct block_device *bdev, sector_t sector, size_t size, } EXPORT_SYMBOL(bdev_dax_pgoff); +struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev) +{ + if (!blk_queue_dax(bdev->bd_queue)) + return NULL; + return fs_dax_get_by_host(bdev->bd_disk->disk_name); +} +EXPORT_SYMBOL_GPL(fs_dax_get_by_bdev); + /** * __bdev_dax_supported() - Check if the device supports dax for filesystem * @sb: The superblock of the device @@ -278,6 +288,12 @@ void dax_write_cache(struct dax_device *dax_dev, bool wc) } EXPORT_SYMBOL_GPL(dax_write_cache); +bool dax_write_cache_enabled(struct dax_device *dax_dev) +{ + return test_bit(DAXDEV_WRITE_CACHE, &dax_dev->flags); +} +EXPORT_SYMBOL_GPL(dax_write_cache_enabled); + bool dax_alive(struct dax_device *dax_dev) { lockdep_assert_held(&dax_srcu); |