aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dax.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/dax.h')
-rw-r--r--include/linux/dax.h34
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)
22struct dax_device *dax_get_by_host(const char *host);
23void put_dax(struct dax_device *dax_dev);
24#else
25static inline struct dax_device *dax_get_by_host(const char *host)
26{
27 return NULL;
28}
29
30static inline void put_dax(struct dax_device *dax_dev)
31{
32}
33#endif
34
21int bdev_dax_pgoff(struct block_device *, sector_t, size_t, pgoff_t *pgoff); 35int 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)
23int __bdev_dax_supported(struct super_block *sb, int blocksize); 37int __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
43static inline struct dax_device *fs_dax_get_by_host(const char *host)
44{
45 return dax_get_by_host(host);
46}
47
48static inline void fs_put_dax(struct dax_device *dax_dev)
49{
50 put_dax(dax_dev);
51}
52
28#else 53#else
29static inline int bdev_dax_supported(struct super_block *sb, int blocksize) 54static 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) 59static inline struct dax_device *fs_dax_get_by_host(const char *host)
36struct dax_device *dax_get_by_host(const char *host);
37void put_dax(struct dax_device *dax_dev);
38#else
39static inline struct dax_device *dax_get_by_host(const char *host)
40{ 60{
41 return NULL; 61 return NULL;
42} 62}
43 63
44static inline void put_dax(struct dax_device *dax_dev) 64static inline void fs_put_dax(struct dax_device *dax_dev)
45{ 65{
46} 66}
47#endif 67#endif