1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BCACHEFS_FS_IO_H
3 #define _BCACHEFS_FS_IO_H
10 #include <linux/uio.h>
14 int __must_check bch2_write_inode_size(struct bch_fs *,
15 struct bch_inode_info *,
18 int bch2_readpage(struct file *, struct page *);
20 int bch2_writepages(struct address_space *, struct writeback_control *);
21 void bch2_readahead(struct readahead_control *);
23 int bch2_write_begin(struct file *, struct address_space *, loff_t,
24 unsigned, unsigned, struct page **, void **);
25 int bch2_write_end(struct file *, struct address_space *, loff_t,
26 unsigned, unsigned, struct page *, void *);
28 ssize_t bch2_read_iter(struct kiocb *, struct iov_iter *);
29 ssize_t bch2_write_iter(struct kiocb *, struct iov_iter *);
31 int bch2_fsync(struct file *, loff_t, loff_t, int);
33 int bch2_truncate(struct user_namespace *,
34 struct bch_inode_info *, struct iattr *);
35 long bch2_fallocate_dispatch(struct file *, int, loff_t, loff_t);
37 loff_t bch2_remap_file_range(struct file *, loff_t, struct file *,
38 loff_t, loff_t, unsigned);
40 loff_t bch2_llseek(struct file *, loff_t, int);
42 vm_fault_t bch2_page_fault(struct vm_fault *);
43 vm_fault_t bch2_page_mkwrite(struct vm_fault *);
44 void bch2_invalidate_folio(struct folio *, size_t, size_t);
45 int bch2_releasepage(struct page *, gfp_t);
46 int bch2_migrate_page(struct address_space *, struct page *,
47 struct page *, enum migrate_mode);
49 void bch2_fs_fsio_exit(struct bch_fs *);
50 int bch2_fs_fsio_init(struct bch_fs *);
52 static inline void bch2_fs_fsio_exit(struct bch_fs *c) {}
53 static inline int bch2_fs_fsio_init(struct bch_fs *c) { return 0; }
56 #endif /* _BCACHEFS_FS_IO_H */