xref: /openbmc/linux/fs/btrfs/file.h (revision 7ae9fb1b7ecbb5d85d07857943f677fd1a559b18)
1af142b6fSJosef Bacik /* SPDX-License-Identifier: GPL-2.0 */
2af142b6fSJosef Bacik 
3af142b6fSJosef Bacik #ifndef BTRFS_FILE_H
4af142b6fSJosef Bacik #define BTRFS_FILE_H
5af142b6fSJosef Bacik 
6af142b6fSJosef Bacik extern const struct file_operations btrfs_file_operations;
7af142b6fSJosef Bacik 
8af142b6fSJosef Bacik int btrfs_sync_file(struct file *file, loff_t start, loff_t end, int datasync);
9af142b6fSJosef Bacik int btrfs_drop_extents(struct btrfs_trans_handle *trans,
10af142b6fSJosef Bacik 		       struct btrfs_root *root, struct btrfs_inode *inode,
11af142b6fSJosef Bacik 		       struct btrfs_drop_extents_args *args);
12af142b6fSJosef Bacik int btrfs_replace_file_extents(struct btrfs_inode *inode,
13af142b6fSJosef Bacik 			   struct btrfs_path *path, const u64 start,
14af142b6fSJosef Bacik 			   const u64 end,
15af142b6fSJosef Bacik 			   struct btrfs_replace_extent_info *extent_info,
16af142b6fSJosef Bacik 			   struct btrfs_trans_handle **trans_out);
17af142b6fSJosef Bacik int btrfs_mark_extent_written(struct btrfs_trans_handle *trans,
18af142b6fSJosef Bacik 			      struct btrfs_inode *inode, u64 start, u64 end);
19af142b6fSJosef Bacik ssize_t btrfs_do_write_iter(struct kiocb *iocb, struct iov_iter *from,
20af142b6fSJosef Bacik 			    const struct btrfs_ioctl_encoded_io_args *encoded);
21af142b6fSJosef Bacik int btrfs_release_file(struct inode *inode, struct file *file);
22af142b6fSJosef Bacik int btrfs_dirty_pages(struct btrfs_inode *inode, struct page **pages,
23af142b6fSJosef Bacik 		      size_t num_pages, loff_t pos, size_t write_bytes,
24af142b6fSJosef Bacik 		      struct extent_state **cached, bool noreserve);
25af142b6fSJosef Bacik int btrfs_fdatawrite_range(struct inode *inode, loff_t start, loff_t end);
26af142b6fSJosef Bacik int btrfs_check_nocow_lock(struct btrfs_inode *inode, loff_t pos,
27af142b6fSJosef Bacik 			   size_t *write_bytes, bool nowait);
28af142b6fSJosef Bacik void btrfs_check_nocow_unlock(struct btrfs_inode *inode);
29af142b6fSJosef Bacik bool btrfs_find_delalloc_in_range(struct btrfs_inode *inode, u64 start, u64 end,
30*b3e744feSFilipe Manana 				  struct extent_state **cached_state,
31af142b6fSJosef Bacik 				  u64 *delalloc_start_ret, u64 *delalloc_end_ret);
32af142b6fSJosef Bacik 
33af142b6fSJosef Bacik #endif
34