#include <linux/module.h>
#include <linux/compiler.h>
#include <linux/fs.h>
#include <linux/iomap.h>
#include <linux/pagemap.h>
#include <linux/uio.h>
#include <linux/buffer_head.h>
#include <linux/dax.h>
#include <linux/writeback.h>
#include <linux/list_sort.h>
#include <linux/swap.h>
#include <linux/bio.h>
#include <linux/sched/signal.h>
#include <linux/migrate.h>
#include "trace.h"
#include "../internal.h"
#define IOEND_BATCH_SIZE …
iomap_punch_t;
struct iomap_folio_state { … };
static struct bio_set iomap_ioend_bioset;
static inline bool ifs_is_fully_uptodate(struct folio *folio,
struct iomap_folio_state *ifs)
{ … }
static inline bool ifs_block_is_uptodate(struct iomap_folio_state *ifs,
unsigned int block)
{ … }
static bool ifs_set_range_uptodate(struct folio *folio,
struct iomap_folio_state *ifs, size_t off, size_t len)
{ … }
static void iomap_set_range_uptodate(struct folio *folio, size_t off,
size_t len)
{ … }
static inline bool ifs_block_is_dirty(struct folio *folio,
struct iomap_folio_state *ifs, int block)
{ … }
static unsigned ifs_find_dirty_range(struct folio *folio,
struct iomap_folio_state *ifs, u64 *range_start, u64 range_end)
{ … }
static unsigned iomap_find_dirty_range(struct folio *folio, u64 *range_start,
u64 range_end)
{ … }
static void ifs_clear_range_dirty(struct folio *folio,
struct iomap_folio_state *ifs, size_t off, size_t len)
{ … }
static void iomap_clear_range_dirty(struct folio *folio, size_t off, size_t len)
{ … }
static void ifs_set_range_dirty(struct folio *folio,
struct iomap_folio_state *ifs, size_t off, size_t len)
{ … }
static void iomap_set_range_dirty(struct folio *folio, size_t off, size_t len)
{ … }
static struct iomap_folio_state *ifs_alloc(struct inode *inode,
struct folio *folio, unsigned int flags)
{ … }
static void ifs_free(struct folio *folio)
{ … }
static void iomap_adjust_read_range(struct inode *inode, struct folio *folio,
loff_t *pos, loff_t length, size_t *offp, size_t *lenp)
{ … }
static void iomap_finish_folio_read(struct folio *folio, size_t off,
size_t len, int error)
{ … }
static void iomap_read_end_io(struct bio *bio)
{ … }
struct iomap_readpage_ctx { … };
static int iomap_read_inline_data(const struct iomap_iter *iter,
struct folio *folio)
{ … }
static inline bool iomap_block_needs_zeroing(const struct iomap_iter *iter,
loff_t pos)
{ … }
static loff_t iomap_readpage_iter(const struct iomap_iter *iter,
struct iomap_readpage_ctx *ctx, loff_t offset)
{ … }
static loff_t iomap_read_folio_iter(const struct iomap_iter *iter,
struct iomap_readpage_ctx *ctx)
{ … }
int iomap_read_folio(struct folio *folio, const struct iomap_ops *ops)
{ … }
EXPORT_SYMBOL_GPL(…);
static loff_t iomap_readahead_iter(const struct iomap_iter *iter,
struct iomap_readpage_ctx *ctx)
{ … }
void iomap_readahead(struct readahead_control *rac, const struct iomap_ops *ops)
{ … }
EXPORT_SYMBOL_GPL(…);
bool iomap_is_partially_uptodate(struct folio *folio, size_t from, size_t count)
{ … }
EXPORT_SYMBOL_GPL(…);
struct folio *iomap_get_folio(struct iomap_iter *iter, loff_t pos, size_t len)
{ … }
EXPORT_SYMBOL_GPL(…);
bool iomap_release_folio(struct folio *folio, gfp_t gfp_flags)
{ … }
EXPORT_SYMBOL_GPL(…);
void iomap_invalidate_folio(struct folio *folio, size_t offset, size_t len)
{ … }
EXPORT_SYMBOL_GPL(…);
bool iomap_dirty_folio(struct address_space *mapping, struct folio *folio)
{ … }
EXPORT_SYMBOL_GPL(…);
static void
iomap_write_failed(struct inode *inode, loff_t pos, unsigned len)
{ … }
static int iomap_read_folio_sync(loff_t block_start, struct folio *folio,
size_t poff, size_t plen, const struct iomap *iomap)
{ … }
static int __iomap_write_begin(const struct iomap_iter *iter, loff_t pos,
size_t len, struct folio *folio)
{ … }
static struct folio *__iomap_get_folio(struct iomap_iter *iter, loff_t pos,
size_t len)
{ … }
static void __iomap_put_folio(struct iomap_iter *iter, loff_t pos, size_t ret,
struct folio *folio)
{ … }
static int iomap_write_begin_inline(const struct iomap_iter *iter,
struct folio *folio)
{ … }
static int iomap_write_begin(struct iomap_iter *iter, loff_t pos,
size_t len, struct folio **foliop)
{ … }
static bool __iomap_write_end(struct inode *inode, loff_t pos, size_t len,
size_t copied, struct folio *folio)
{ … }
static void iomap_write_end_inline(const struct iomap_iter *iter,
struct folio *folio, loff_t pos, size_t copied)
{ … }
static bool iomap_write_end(struct iomap_iter *iter, loff_t pos, size_t len,
size_t copied, struct folio *folio)
{ … }
static loff_t iomap_write_iter(struct iomap_iter *iter, struct iov_iter *i)
{ … }
ssize_t
iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *i,
const struct iomap_ops *ops)
{ … }
EXPORT_SYMBOL_GPL(…);
static int iomap_write_delalloc_ifs_punch(struct inode *inode,
struct folio *folio, loff_t start_byte, loff_t end_byte,
iomap_punch_t punch)
{ … }
static int iomap_write_delalloc_punch(struct inode *inode, struct folio *folio,
loff_t *punch_start_byte, loff_t start_byte, loff_t end_byte,
iomap_punch_t punch)
{ … }
static int iomap_write_delalloc_scan(struct inode *inode,
loff_t *punch_start_byte, loff_t start_byte, loff_t end_byte,
iomap_punch_t punch)
{ … }
static int iomap_write_delalloc_release(struct inode *inode,
loff_t start_byte, loff_t end_byte, iomap_punch_t punch)
{ … }
int iomap_file_buffered_write_punch_delalloc(struct inode *inode,
struct iomap *iomap, loff_t pos, loff_t length,
ssize_t written, iomap_punch_t punch)
{ … }
EXPORT_SYMBOL_GPL(…);
static loff_t iomap_unshare_iter(struct iomap_iter *iter)
{ … }
int
iomap_file_unshare(struct inode *inode, loff_t pos, loff_t len,
const struct iomap_ops *ops)
{ … }
EXPORT_SYMBOL_GPL(…);
static loff_t iomap_zero_iter(struct iomap_iter *iter, bool *did_zero)
{ … }
int
iomap_zero_range(struct inode *inode, loff_t pos, loff_t len, bool *did_zero,
const struct iomap_ops *ops)
{ … }
EXPORT_SYMBOL_GPL(…);
int
iomap_truncate_page(struct inode *inode, loff_t pos, bool *did_zero,
const struct iomap_ops *ops)
{ … }
EXPORT_SYMBOL_GPL(…);
static loff_t iomap_folio_mkwrite_iter(struct iomap_iter *iter,
struct folio *folio)
{ … }
vm_fault_t iomap_page_mkwrite(struct vm_fault *vmf, const struct iomap_ops *ops)
{ … }
EXPORT_SYMBOL_GPL(…);
static void iomap_finish_folio_write(struct inode *inode, struct folio *folio,
size_t len)
{ … }
static u32
iomap_finish_ioend(struct iomap_ioend *ioend, int error)
{ … }
void
iomap_finish_ioends(struct iomap_ioend *ioend, int error)
{ … }
EXPORT_SYMBOL_GPL(…);
static bool
iomap_ioend_can_merge(struct iomap_ioend *ioend, struct iomap_ioend *next)
{ … }
void
iomap_ioend_try_merge(struct iomap_ioend *ioend, struct list_head *more_ioends)
{ … }
EXPORT_SYMBOL_GPL(…);
static int
iomap_ioend_compare(void *priv, const struct list_head *a,
const struct list_head *b)
{ … }
void
iomap_sort_ioends(struct list_head *ioend_list)
{ … }
EXPORT_SYMBOL_GPL(…);
static void iomap_writepage_end_bio(struct bio *bio)
{ … }
static int iomap_submit_ioend(struct iomap_writepage_ctx *wpc, int error)
{ … }
static struct iomap_ioend *iomap_alloc_ioend(struct iomap_writepage_ctx *wpc,
struct writeback_control *wbc, struct inode *inode, loff_t pos)
{ … }
static bool iomap_can_add_to_ioend(struct iomap_writepage_ctx *wpc, loff_t pos)
{ … }
static int iomap_add_to_ioend(struct iomap_writepage_ctx *wpc,
struct writeback_control *wbc, struct folio *folio,
struct inode *inode, loff_t pos, unsigned len)
{ … }
static int iomap_writepage_map_blocks(struct iomap_writepage_ctx *wpc,
struct writeback_control *wbc, struct folio *folio,
struct inode *inode, u64 pos, unsigned dirty_len,
unsigned *count)
{ … }
static bool iomap_writepage_handle_eof(struct folio *folio, struct inode *inode,
u64 *end_pos)
{ … }
static int iomap_writepage_map(struct iomap_writepage_ctx *wpc,
struct writeback_control *wbc, struct folio *folio)
{ … }
int
iomap_writepages(struct address_space *mapping, struct writeback_control *wbc,
struct iomap_writepage_ctx *wpc,
const struct iomap_writeback_ops *ops)
{ … }
EXPORT_SYMBOL_GPL(…);
static int __init iomap_init(void)
{ … }
fs_initcall(iomap_init);