diff options
Diffstat (limited to 'include/linux/dax.h')
| -rw-r--r-- | include/linux/dax.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/dax.h b/include/linux/dax.h index 0dd316a74a29..becaea5f4488 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h | |||
| @@ -19,6 +19,12 @@ struct dax_operations { | |||
| 19 | */ | 19 | */ |
| 20 | long (*direct_access)(struct dax_device *, pgoff_t, long, | 20 | long (*direct_access)(struct dax_device *, pgoff_t, long, |
| 21 | void **, pfn_t *); | 21 | void **, pfn_t *); |
| 22 | /* | ||
| 23 | * Validate whether this device is usable as an fsdax backing | ||
| 24 | * device. | ||
| 25 | */ | ||
| 26 | bool (*dax_supported)(struct dax_device *, struct block_device *, int, | ||
| 27 | sector_t, sector_t); | ||
| 22 | /* copy_from_iter: required operation for fs-dax direct-i/o */ | 28 | /* copy_from_iter: required operation for fs-dax direct-i/o */ |
| 23 | size_t (*copy_from_iter)(struct dax_device *, pgoff_t, void *, size_t, | 29 | size_t (*copy_from_iter)(struct dax_device *, pgoff_t, void *, size_t, |
| 24 | struct iov_iter *); | 30 | struct iov_iter *); |
| @@ -75,6 +81,17 @@ static inline bool bdev_dax_supported(struct block_device *bdev, int blocksize) | |||
| 75 | return __bdev_dax_supported(bdev, blocksize); | 81 | return __bdev_dax_supported(bdev, blocksize); |
| 76 | } | 82 | } |
| 77 | 83 | ||
| 84 | bool __generic_fsdax_supported(struct dax_device *dax_dev, | ||
| 85 | struct block_device *bdev, int blocksize, sector_t start, | ||
| 86 | sector_t sectors); | ||
| 87 | static inline bool generic_fsdax_supported(struct dax_device *dax_dev, | ||
| 88 | struct block_device *bdev, int blocksize, sector_t start, | ||
| 89 | sector_t sectors) | ||
| 90 | { | ||
| 91 | return __generic_fsdax_supported(dax_dev, bdev, blocksize, start, | ||
| 92 | sectors); | ||
| 93 | } | ||
| 94 | |||
| 78 | static inline struct dax_device *fs_dax_get_by_host(const char *host) | 95 | static inline struct dax_device *fs_dax_get_by_host(const char *host) |
| 79 | { | 96 | { |
| 80 | return dax_get_by_host(host); | 97 | return dax_get_by_host(host); |
| @@ -99,6 +116,13 @@ static inline bool bdev_dax_supported(struct block_device *bdev, | |||
| 99 | return false; | 116 | return false; |
| 100 | } | 117 | } |
| 101 | 118 | ||
| 119 | static inline bool generic_fsdax_supported(struct dax_device *dax_dev, | ||
| 120 | struct block_device *bdev, int blocksize, sector_t start, | ||
| 121 | sector_t sectors) | ||
| 122 | { | ||
| 123 | return false; | ||
| 124 | } | ||
| 125 | |||
| 102 | static inline struct dax_device *fs_dax_get_by_host(const char *host) | 126 | static inline struct dax_device *fs_dax_get_by_host(const char *host) |
| 103 | { | 127 | { |
| 104 | return NULL; | 128 | return NULL; |
| @@ -142,6 +166,8 @@ bool dax_alive(struct dax_device *dax_dev); | |||
| 142 | void *dax_get_private(struct dax_device *dax_dev); | 166 | void *dax_get_private(struct dax_device *dax_dev); |
| 143 | long dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, long nr_pages, | 167 | long dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, long nr_pages, |
| 144 | void **kaddr, pfn_t *pfn); | 168 | void **kaddr, pfn_t *pfn); |
| 169 | bool dax_supported(struct dax_device *dax_dev, struct block_device *bdev, | ||
| 170 | int blocksize, sector_t start, sector_t len); | ||
| 145 | size_t dax_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr, | 171 | size_t dax_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr, |
| 146 | size_t bytes, struct iov_iter *i); | 172 | size_t bytes, struct iov_iter *i); |
| 147 | size_t dax_copy_to_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr, | 173 | size_t dax_copy_to_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr, |
