#ifndef LINUX_IOMAP_H
#define LINUX_IOMAP_H …
#include <linux/atomic.h>
#include <linux/bitmap.h>
#include <linux/blk_types.h>
#include <linux/mm.h>
#include <linux/types.h>
#include <linux/mm_types.h>
#include <linux/blkdev.h>
struct address_space;
struct fiemap_extent_info;
struct inode;
struct iomap_iter;
struct iomap_dio;
struct iomap_writepage_ctx;
struct iov_iter;
struct kiocb;
struct page;
struct vm_area_struct;
struct vm_fault;
#define IOMAP_HOLE …
#define IOMAP_DELALLOC …
#define IOMAP_MAPPED …
#define IOMAP_UNWRITTEN …
#define IOMAP_INLINE …
#define IOMAP_F_NEW …
#define IOMAP_F_DIRTY …
#define IOMAP_F_SHARED …
#define IOMAP_F_MERGED …
#ifdef CONFIG_BUFFER_HEAD
#define IOMAP_F_BUFFER_HEAD …
#else
#define IOMAP_F_BUFFER_HEAD …
#endif
#define IOMAP_F_XATTR …
#define IOMAP_F_SIZE_CHANGED …
#define IOMAP_F_STALE …
#define IOMAP_F_PRIVATE …
#define IOMAP_NULL_ADDR …
struct iomap_folio_ops;
struct iomap { … };
static inline sector_t iomap_sector(const struct iomap *iomap, loff_t pos)
{ … }
static inline void *iomap_inline_data(const struct iomap *iomap, loff_t pos)
{ … }
static inline bool iomap_inline_data_valid(const struct iomap *iomap)
{ … }
struct iomap_folio_ops { … };
#define IOMAP_WRITE …
#define IOMAP_ZERO …
#define IOMAP_REPORT …
#define IOMAP_FAULT …
#define IOMAP_DIRECT …
#define IOMAP_NOWAIT …
#define IOMAP_OVERWRITE_ONLY …
#define IOMAP_UNSHARE …
#ifdef CONFIG_FS_DAX
#define IOMAP_DAX …
#else
#define IOMAP_DAX …
#endif
struct iomap_ops { … };
struct iomap_iter { … };
int iomap_iter(struct iomap_iter *iter, const struct iomap_ops *ops);
static inline u64 iomap_length(const struct iomap_iter *iter)
{ … }
static inline const struct iomap *iomap_iter_srcmap(const struct iomap_iter *i)
{ … }
static inline loff_t iomap_last_written_block(struct inode *inode, loff_t pos,
ssize_t written)
{ … }
static inline bool iomap_want_unshare_iter(const struct iomap_iter *iter)
{ … }
ssize_t iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *from,
const struct iomap_ops *ops, void *private);
int iomap_read_folio(struct folio *folio, const struct iomap_ops *ops);
void iomap_readahead(struct readahead_control *, const struct iomap_ops *ops);
bool iomap_is_partially_uptodate(struct folio *, size_t from, size_t count);
struct folio *iomap_get_folio(struct iomap_iter *iter, loff_t pos, size_t len);
bool iomap_release_folio(struct folio *folio, gfp_t gfp_flags);
void iomap_invalidate_folio(struct folio *folio, size_t offset, size_t len);
bool iomap_dirty_folio(struct address_space *mapping, struct folio *folio);
int iomap_file_unshare(struct inode *inode, loff_t pos, loff_t len,
const struct iomap_ops *ops);
int iomap_zero_range(struct inode *inode, loff_t pos, loff_t len,
bool *did_zero, const struct iomap_ops *ops);
int iomap_truncate_page(struct inode *inode, loff_t pos, bool *did_zero,
const struct iomap_ops *ops);
vm_fault_t iomap_page_mkwrite(struct vm_fault *vmf,
const struct iomap_ops *ops);
iomap_punch_t;
void iomap_write_delalloc_release(struct inode *inode, loff_t start_byte,
loff_t end_byte, unsigned flags, struct iomap *iomap,
iomap_punch_t punch);
int iomap_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
u64 start, u64 len, const struct iomap_ops *ops);
loff_t iomap_seek_hole(struct inode *inode, loff_t offset,
const struct iomap_ops *ops);
loff_t iomap_seek_data(struct inode *inode, loff_t offset,
const struct iomap_ops *ops);
sector_t iomap_bmap(struct address_space *mapping, sector_t bno,
const struct iomap_ops *ops);
struct iomap_ioend { … };
static inline struct iomap_ioend *iomap_ioend_from_bio(struct bio *bio)
{ … }
struct iomap_writeback_ops { … };
struct iomap_writepage_ctx { … };
void iomap_finish_ioends(struct iomap_ioend *ioend, int error);
void iomap_ioend_try_merge(struct iomap_ioend *ioend,
struct list_head *more_ioends);
void iomap_sort_ioends(struct list_head *ioend_list);
int iomap_writepages(struct address_space *mapping,
struct writeback_control *wbc, struct iomap_writepage_ctx *wpc,
const struct iomap_writeback_ops *ops);
#define IOMAP_DIO_UNWRITTEN …
#define IOMAP_DIO_COW …
struct iomap_dio_ops { … };
#define IOMAP_DIO_FORCE_WAIT …
#define IOMAP_DIO_OVERWRITE_ONLY …
#define IOMAP_DIO_PARTIAL …
ssize_t iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter,
const struct iomap_ops *ops, const struct iomap_dio_ops *dops,
unsigned int dio_flags, void *private, size_t done_before);
struct iomap_dio *__iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter,
const struct iomap_ops *ops, const struct iomap_dio_ops *dops,
unsigned int dio_flags, void *private, size_t done_before);
ssize_t iomap_dio_complete(struct iomap_dio *dio);
void iomap_dio_bio_end_io(struct bio *bio);
#ifdef CONFIG_SWAP
struct file;
struct swap_info_struct;
int iomap_swapfile_activate(struct swap_info_struct *sis,
struct file *swap_file, sector_t *pagespan,
const struct iomap_ops *ops);
#else
#define iomap_swapfile_activate …
#endif
#endif