aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dax.h
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-05-30 16:03:45 -0400
committerDarrick J. Wong <darrick.wong@oracle.com>2018-05-31 11:58:33 -0400
commitba23cba9b3bdc967aabdc6ff1e3e9b11ce05bb4f (patch)
treeab508ad6c442fa52b4b59a27edb5084279dbb6d9 /include/linux/dax.h
parentd25522f10cfa342a20867086a516c45c87b0877c (diff)
fs: allow per-device dax status checking for filesystems
Change bdev_dax_supported so it takes a bdev parameter. This enables multi-device filesystems like xfs to check that a dax device can work for the particular filesystem. Once that's in place, actually fix all the parts of XFS where we need to be able to distinguish between datadev and rtdev. This patch fixes the problem where we screw up the dax support checking in xfs if the datadev and rtdev have different dax capabilities. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> [rez: Re-added __bdev_dax_supported() for !CONFIG_FS_DAX cases] Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com> Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Diffstat (limited to 'include/linux/dax.h')
-rw-r--r--include/linux/dax.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/dax.h b/include/linux/dax.h
index f9eb22ad341e..2a4f7295c12b 100644
--- a/include/linux/dax.h
+++ b/include/linux/dax.h
@@ -64,10 +64,10 @@ static inline bool dax_write_cache_enabled(struct dax_device *dax_dev)
64struct writeback_control; 64struct writeback_control;
65int bdev_dax_pgoff(struct block_device *, sector_t, size_t, pgoff_t *pgoff); 65int bdev_dax_pgoff(struct block_device *, sector_t, size_t, pgoff_t *pgoff);
66#if IS_ENABLED(CONFIG_FS_DAX) 66#if IS_ENABLED(CONFIG_FS_DAX)
67int __bdev_dax_supported(struct super_block *sb, int blocksize); 67int __bdev_dax_supported(struct block_device *bdev, int blocksize);
68static inline int bdev_dax_supported(struct super_block *sb, int blocksize) 68static inline int bdev_dax_supported(struct block_device *bdev, int blocksize)
69{ 69{
70 return __bdev_dax_supported(sb, blocksize); 70 return __bdev_dax_supported(bdev, blocksize);
71} 71}
72 72
73static inline struct dax_device *fs_dax_get_by_host(const char *host) 73static inline struct dax_device *fs_dax_get_by_host(const char *host)
@@ -84,7 +84,8 @@ struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev);
84int dax_writeback_mapping_range(struct address_space *mapping, 84int dax_writeback_mapping_range(struct address_space *mapping,
85 struct block_device *bdev, struct writeback_control *wbc); 85 struct block_device *bdev, struct writeback_control *wbc);
86#else 86#else
87static inline int bdev_dax_supported(struct super_block *sb, int blocksize) 87static inline int bdev_dax_supported(struct block_device *bdev,
88 int blocksize)
88{ 89{
89 return -EOPNOTSUPP; 90 return -EOPNOTSUPP;
90} 91}