diff options
Diffstat (limited to 'include/linux/dax.h')
-rw-r--r-- | include/linux/dax.h | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/include/linux/dax.h b/include/linux/dax.h index 00ebac854bb7..5ec1f6c47716 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h | |||
@@ -18,6 +18,20 @@ struct dax_operations { | |||
18 | void **, pfn_t *); | 18 | void **, pfn_t *); |
19 | }; | 19 | }; |
20 | 20 | ||
21 | #if IS_ENABLED(CONFIG_DAX) | ||
22 | struct dax_device *dax_get_by_host(const char *host); | ||
23 | void put_dax(struct dax_device *dax_dev); | ||
24 | #else | ||
25 | static inline struct dax_device *dax_get_by_host(const char *host) | ||
26 | { | ||
27 | return NULL; | ||
28 | } | ||
29 | |||
30 | static inline void put_dax(struct dax_device *dax_dev) | ||
31 | { | ||
32 | } | ||
33 | #endif | ||
34 | |||
21 | int bdev_dax_pgoff(struct block_device *, sector_t, size_t, pgoff_t *pgoff); | 35 | int bdev_dax_pgoff(struct block_device *, sector_t, size_t, pgoff_t *pgoff); |
22 | #if IS_ENABLED(CONFIG_FS_DAX) | 36 | #if IS_ENABLED(CONFIG_FS_DAX) |
23 | int __bdev_dax_supported(struct super_block *sb, int blocksize); | 37 | int __bdev_dax_supported(struct super_block *sb, int blocksize); |
@@ -25,23 +39,29 @@ static inline int bdev_dax_supported(struct super_block *sb, int blocksize) | |||
25 | { | 39 | { |
26 | return __bdev_dax_supported(sb, blocksize); | 40 | return __bdev_dax_supported(sb, blocksize); |
27 | } | 41 | } |
42 | |||
43 | static inline struct dax_device *fs_dax_get_by_host(const char *host) | ||
44 | { | ||
45 | return dax_get_by_host(host); | ||
46 | } | ||
47 | |||
48 | static inline void fs_put_dax(struct dax_device *dax_dev) | ||
49 | { | ||
50 | put_dax(dax_dev); | ||
51 | } | ||
52 | |||
28 | #else | 53 | #else |
29 | static inline int bdev_dax_supported(struct super_block *sb, int blocksize) | 54 | static inline int bdev_dax_supported(struct super_block *sb, int blocksize) |
30 | { | 55 | { |
31 | return -EOPNOTSUPP; | 56 | return -EOPNOTSUPP; |
32 | } | 57 | } |
33 | #endif | ||
34 | 58 | ||
35 | #if IS_ENABLED(CONFIG_DAX) | 59 | static inline struct dax_device *fs_dax_get_by_host(const char *host) |
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 | { | 60 | { |
41 | return NULL; | 61 | return NULL; |
42 | } | 62 | } |
43 | 63 | ||
44 | static inline void put_dax(struct dax_device *dax_dev) | 64 | static inline void fs_put_dax(struct dax_device *dax_dev) |
45 | { | 65 | { |
46 | } | 66 | } |
47 | #endif | 67 | #endif |