Blame view
include/linux/dax.h
3.55 KB
b24413180 License cleanup: ... |
1 |
/* SPDX-License-Identifier: GPL-2.0 */ |
c94c2acf8 dax: move DAX-rel... |
2 3 4 5 6 |
#ifndef _LINUX_DAX_H #define _LINUX_DAX_H #include <linux/fs.h> #include <linux/mm.h> |
4f622938a dax: Allow DAX co... |
7 |
#include <linux/radix-tree.h> |
c94c2acf8 dax: move DAX-rel... |
8 |
#include <asm/pgtable.h> |
a254e5681 dax: provide an i... |
9 |
struct iomap_ops; |
6568b08b7 dax: introduce da... |
10 11 12 13 14 15 16 17 18 |
struct dax_device; struct dax_operations { /* * direct_access: translate a device-relative * logical-page-offset into an absolute physical pfn. Return the * number of pages available for DAX at that pfn. */ long (*direct_access)(struct dax_device *, pgoff_t, long, void **, pfn_t *); |
5d61e43b3 dax: remove defau... |
19 |
/* copy_from_iter: required operation for fs-dax direct-i/o */ |
0aed55af8 x86, uaccess: int... |
20 21 |
size_t (*copy_from_iter)(struct dax_device *, pgoff_t, void *, size_t, struct iov_iter *); |
6568b08b7 dax: introduce da... |
22 |
}; |
a254e5681 dax: provide an i... |
23 |
|
6e0c90d69 libnvdimm, pmem, ... |
24 |
extern struct attribute_group dax_attribute_group; |
f5705aa8c dax, xfs, ext4: c... |
25 26 27 28 29 30 31 32 33 34 35 36 37 |
#if IS_ENABLED(CONFIG_DAX) struct dax_device *dax_get_by_host(const char *host); void put_dax(struct dax_device *dax_dev); #else static inline struct dax_device *dax_get_by_host(const char *host) { return NULL; } static inline void put_dax(struct dax_device *dax_dev) { } #endif |
ef5104247 block, dax: move ... |
38 39 |
int bdev_dax_pgoff(struct block_device *, sector_t, size_t, pgoff_t *pgoff); #if IS_ENABLED(CONFIG_FS_DAX) |
8214347c2 dax: change bdev_... |
40 41 |
bool __bdev_dax_supported(struct block_device *bdev, int blocksize); static inline bool bdev_dax_supported(struct block_device *bdev, int blocksize) |
ef5104247 block, dax: move ... |
42 |
{ |
a19385766 fs: allow per-dev... |
43 |
return __bdev_dax_supported(bdev, blocksize); |
ef5104247 block, dax: move ... |
44 |
} |
f5705aa8c dax, xfs, ext4: c... |
45 46 47 48 49 50 51 52 53 54 |
static inline struct dax_device *fs_dax_get_by_host(const char *host) { return dax_get_by_host(host); } static inline void fs_put_dax(struct dax_device *dax_dev) { put_dax(dax_dev); } |
78f354735 dax: introduce a ... |
55 |
struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev); |
ef5104247 block, dax: move ... |
56 |
#else |
8214347c2 dax: change bdev_... |
57 |
static inline bool bdev_dax_supported(struct block_device *bdev, |
a19385766 fs: allow per-dev... |
58 |
int blocksize) |
ef5104247 block, dax: move ... |
59 |
{ |
8214347c2 dax: change bdev_... |
60 |
return false; |
ef5104247 block, dax: move ... |
61 |
} |
ef5104247 block, dax: move ... |
62 |
|
f5705aa8c dax, xfs, ext4: c... |
63 |
static inline struct dax_device *fs_dax_get_by_host(const char *host) |
ef5104247 block, dax: move ... |
64 65 66 |
{ return NULL; } |
f5705aa8c dax, xfs, ext4: c... |
67 |
static inline void fs_put_dax(struct dax_device *dax_dev) |
ef5104247 block, dax: move ... |
68 69 |
{ } |
78f354735 dax: introduce a ... |
70 71 72 73 74 |
static inline struct dax_device *fs_dax_get_by_bdev(struct block_device *bdev) { return NULL; } |
ef5104247 block, dax: move ... |
75 |
#endif |
7b6be8444 dax: refactor dax... |
76 77 |
int dax_read_lock(void); void dax_read_unlock(int id); |
c1d6e828a pmem: add dax_ope... |
78 79 |
struct dax_device *alloc_dax(void *private, const char *host, const struct dax_operations *ops); |
c1d6e828a pmem: add dax_ope... |
80 81 82 |
bool dax_alive(struct dax_device *dax_dev); void kill_dax(struct dax_device *dax_dev); void *dax_get_private(struct dax_device *dax_dev); |
b0686260f dax: introduce da... |
83 84 |
long dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, long nr_pages, void **kaddr, pfn_t *pfn); |
7e026c8c0 dm: add ->copy_fr... |
85 86 |
size_t dax_copy_from_iter(struct dax_device *dax_dev, pgoff_t pgoff, void *addr, size_t bytes, struct iov_iter *i); |
c3ca015fa dax: remove the p... |
87 |
void dax_flush(struct dax_device *dax_dev, void *addr, size_t size); |
6e0c90d69 libnvdimm, pmem, ... |
88 |
void dax_write_cache(struct dax_device *dax_dev, bool wc); |
273752c9f dm, dax: Make sur... |
89 |
bool dax_write_cache_enabled(struct dax_device *dax_dev); |
7b6be8444 dax: refactor dax... |
90 |
|
11c59c92f dax: correct dax ... |
91 |
ssize_t dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter, |
8ff6daa17 iomap: constify s... |
92 |
const struct iomap_ops *ops); |
c791ace1e mm: replace FAULT... |
93 94 |
int dax_iomap_fault(struct vm_fault *vmf, enum page_entry_size pe_size, const struct iomap_ops *ops); |
ac401cc78 dax: New fault lo... |
95 |
int dax_delete_mapping_entry(struct address_space *mapping, pgoff_t index); |
c6dcf52c2 mm: Invalidate DA... |
96 97 |
int dax_invalidate_mapping_entry_sync(struct address_space *mapping, pgoff_t index); |
d1a5f2b4d block: use DAX fo... |
98 99 |
#ifdef CONFIG_FS_DAX |
cccbce671 filesystem-dax: c... |
100 101 |
int __dax_zero_page_range(struct block_device *bdev, struct dax_device *dax_dev, sector_t sector, |
679c8bd3b dax: export a low... |
102 |
unsigned int offset, unsigned int length); |
d1a5f2b4d block: use DAX fo... |
103 |
#else |
679c8bd3b dax: export a low... |
104 |
static inline int __dax_zero_page_range(struct block_device *bdev, |
cccbce671 filesystem-dax: c... |
105 106 |
struct dax_device *dax_dev, sector_t sector, unsigned int offset, unsigned int length) |
679c8bd3b dax: export a low... |
107 108 109 |
{ return -ENXIO; } |
d1a5f2b4d block: use DAX fo... |
110 |
#endif |
f9fe48bec dax: support dirt... |
111 112 113 114 |
static inline bool dax_mapping(struct address_space *mapping) { return mapping->host && IS_DAX(mapping->host); } |
7f6d5b529 dax: move writeba... |
115 116 117 118 |
struct writeback_control; int dax_writeback_mapping_range(struct address_space *mapping, struct block_device *bdev, struct writeback_control *wbc); |
c94c2acf8 dax: move DAX-rel... |
119 |
#endif |