diff options
author | Dan Williams <dan.j.williams@intel.com> | 2017-05-08 13:55:27 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2017-05-08 13:55:27 -0400 |
commit | ef51042472f55b325fd7f2b26a2e29fd89757234 (patch) | |
tree | ad814d3a1537f69b6ca54c0417260324e8f1a6eb /include/linux/dax.h | |
parent | 74d71a01abef37f71d914f2105a4cb8712a2beb8 (diff) |
block, dax: move "select DAX" from BLOCK to FS_DAX
For configurations that do not enable DAX filesystems or drivers, do not
require the DAX core to be built.
Given that the 'direct_access' method has been removed from
'block_device_operations', we can also go ahead and remove the
block-related dax helper functions from fs/block_dev.c to
drivers/dax/super.c. This keeps dax details out of the block layer and
lets the DAX core be built as a module in the FS_DAX=n case.
Filesystems need to include dax.h to call bdev_dax_supported().
Cc: linux-xfs@vger.kernel.org
Cc: Jens Axboe <axboe@kernel.dk>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Matthew Wilcox <mawilcox@microsoft.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Reviewed-by: Jan Kara <jack@suse.com>
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'include/linux/dax.h')
-rw-r--r-- | include/linux/dax.h | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/include/linux/dax.h b/include/linux/dax.h index d3158e74a59e..7fdf1d710042 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h | |||
@@ -18,12 +18,38 @@ struct dax_operations { | |||
18 | void **, pfn_t *); | 18 | void **, pfn_t *); |
19 | }; | 19 | }; |
20 | 20 | ||
21 | int bdev_dax_pgoff(struct block_device *, sector_t, size_t, pgoff_t *pgoff); | ||
22 | #if IS_ENABLED(CONFIG_FS_DAX) | ||
23 | int __bdev_dax_supported(struct super_block *sb, int blocksize); | ||
24 | static inline int bdev_dax_supported(struct super_block *sb, int blocksize) | ||
25 | { | ||
26 | return __bdev_dax_supported(sb, blocksize); | ||
27 | } | ||
28 | #else | ||
29 | static inline int bdev_dax_supported(struct super_block *sb, int blocksize) | ||
30 | { | ||
31 | return -EOPNOTSUPP; | ||
32 | } | ||
33 | #endif | ||
34 | |||
35 | #if IS_ENABLED(CONFIG_DAX) | ||
36 | struct dax_device *dax_get_by_host(const char *host); | ||
37 | void put_dax(struct dax_device *dax_dev); | ||
38 | #else | ||
39 | static inline struct dax_device *dax_get_by_host(const char *host) | ||
40 | { | ||
41 | return NULL; | ||
42 | } | ||
43 | |||
44 | static inline void put_dax(struct dax_device *dax_dev) | ||
45 | { | ||
46 | } | ||
47 | #endif | ||
48 | |||
21 | int dax_read_lock(void); | 49 | int dax_read_lock(void); |
22 | void dax_read_unlock(int id); | 50 | void dax_read_unlock(int id); |
23 | struct dax_device *dax_get_by_host(const char *host); | ||
24 | struct dax_device *alloc_dax(void *private, const char *host, | 51 | struct dax_device *alloc_dax(void *private, const char *host, |
25 | const struct dax_operations *ops); | 52 | const struct dax_operations *ops); |
26 | void put_dax(struct dax_device *dax_dev); | ||
27 | bool dax_alive(struct dax_device *dax_dev); | 53 | bool dax_alive(struct dax_device *dax_dev); |
28 | void kill_dax(struct dax_device *dax_dev); | 54 | void kill_dax(struct dax_device *dax_dev); |
29 | void *dax_get_private(struct dax_device *dax_dev); | 55 | void *dax_get_private(struct dax_device *dax_dev); |