summaryrefslogtreecommitdiff
path: root/fs/bcachefs/fs-io.h
blob: 7063556d289b7446716d674457b2dd0c32d9387f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _BCACHEFS_FS_IO_H
#define _BCACHEFS_FS_IO_H

#ifndef NO_BCACHEFS_FS

#include "buckets.h"
#include "io_types.h"

#include <linux/uio.h>

struct quota_res;

int __must_check bch2_write_inode_size(struct bch_fs *,
				       struct bch_inode_info *,
				       loff_t, unsigned);

int bch2_writepage(struct page *, struct writeback_control *);
int bch2_readpage(struct file *, struct page *);

int bch2_writepages(struct address_space *, struct writeback_control *);
int bch2_readpages(struct file *, struct address_space *,
		   struct list_head *, unsigned);

int bch2_write_begin(struct file *, struct address_space *, loff_t,
		     unsigned, unsigned, struct page **, void **);
int bch2_write_end(struct file *, struct address_space *, loff_t,
		   unsigned, unsigned, struct page *, void *);

ssize_t bch2_read_iter(struct kiocb *, struct iov_iter *);
ssize_t bch2_write_iter(struct kiocb *, struct iov_iter *);

int bch2_fsync(struct file *, loff_t, loff_t, int);

int bch2_truncate(struct bch_inode_info *, struct iattr *);
long bch2_fallocate_dispatch(struct file *, int, loff_t, loff_t);

loff_t bch2_remap_file_range(struct file *, loff_t, struct file *,
			     loff_t, loff_t, unsigned);

loff_t bch2_llseek(struct file *, loff_t, int);

vm_fault_t bch2_page_fault(struct vm_fault *);
vm_fault_t bch2_page_mkwrite(struct vm_fault *);
void bch2_invalidatepage(struct page *, unsigned int, unsigned int);
int bch2_releasepage(struct page *, gfp_t);
int bch2_migrate_page(struct address_space *, struct page *,
		      struct page *, enum migrate_mode);

void bch2_fs_fsio_exit(struct bch_fs *);
int bch2_fs_fsio_init(struct bch_fs *);
#else
static inline void bch2_fs_fsio_exit(struct bch_fs *c) {}
static inline int bch2_fs_fsio_init(struct bch_fs *c) { return 0; }
#endif

#endif /* _BCACHEFS_FS_IO_H */