]> git.sesse.net Git - bcachefs-tools-debian/blob - libbcachefs/fs-io.h
7f2d7f454be4c6aa4bed2cd5dfd6130b384c2d14
[bcachefs-tools-debian] / libbcachefs / fs-io.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BCACHEFS_FS_IO_H
3 #define _BCACHEFS_FS_IO_H
4
5 #ifndef NO_BCACHEFS_FS
6
7 #include "buckets.h"
8 #include "io_types.h"
9
10 #include <linux/uio.h>
11
12 struct quota_res;
13
14 int __must_check bch2_write_inode_size(struct bch_fs *,
15                                        struct bch_inode_info *,
16                                        loff_t, unsigned);
17
18 int bch2_readpage(struct file *, struct page *);
19
20 int bch2_writepages(struct address_space *, struct writeback_control *);
21 void bch2_readahead(struct readahead_control *);
22
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 *);
27
28 ssize_t bch2_read_iter(struct kiocb *, struct iov_iter *);
29 ssize_t bch2_write_iter(struct kiocb *, struct iov_iter *);
30
31 int bch2_fsync(struct file *, loff_t, loff_t, int);
32
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);
36
37 loff_t bch2_remap_file_range(struct file *, loff_t, struct file *,
38                              loff_t, loff_t, unsigned);
39
40 loff_t bch2_llseek(struct file *, loff_t, int);
41
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);
48
49 void bch2_fs_fsio_exit(struct bch_fs *);
50 int bch2_fs_fsio_init(struct bch_fs *);
51 #else
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; }
54 #endif
55
56 #endif /* _BCACHEFS_FS_IO_H */