diff options
author | Nikolay Borisov <nborisov@suse.com> | 2020-06-03 08:55:29 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-07-27 12:55:34 +0200 |
commit | 98456b9c46c140275b0fe81970ddfad250c68ed4 (patch) | |
tree | 63b420a8d0c17a9734f0c27b4ef925d5982a9ae1 /fs/btrfs/inode.c | |
parent | 0c4942258cc1de265619b48a50a29d81f85b86eb (diff) |
btrfs: make btrfs_run_delalloc_range take btrfs_inode
All children now take btrfs_inode so convert it to taking it as a
parameter as well.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index eaa8e71288c8..aa48452e395f 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1813,31 +1813,30 @@ static inline int need_force_cow(struct btrfs_inode *inode, u64 start, u64 end) * Function to process delayed allocation (create CoW) for ranges which are * being touched for the first time. */ -int btrfs_run_delalloc_range(struct inode *inode, struct page *locked_page, +int btrfs_run_delalloc_range(struct btrfs_inode *inode, struct page *locked_page, u64 start, u64 end, int *page_started, unsigned long *nr_written, struct writeback_control *wbc) { int ret; - int force_cow = need_force_cow(BTRFS_I(inode), start, end); + int force_cow = need_force_cow(inode, start, end); - if (BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW && !force_cow) { - ret = run_delalloc_nocow(BTRFS_I(inode), locked_page, start, end, + if (inode->flags & BTRFS_INODE_NODATACOW && !force_cow) { + ret = run_delalloc_nocow(inode, locked_page, start, end, page_started, 1, nr_written); - } else if (BTRFS_I(inode)->flags & BTRFS_INODE_PREALLOC && !force_cow) { - ret = run_delalloc_nocow(BTRFS_I(inode), locked_page, start, end, + } else if (inode->flags & BTRFS_INODE_PREALLOC && !force_cow) { + ret = run_delalloc_nocow(inode, locked_page, start, end, page_started, 0, nr_written); - } else if (!inode_can_compress(BTRFS_I(inode)) || - !inode_need_compress(BTRFS_I(inode), start, end)) { - ret = cow_file_range(BTRFS_I(inode), locked_page, start, end, - page_started, nr_written, 1); + } else if (!inode_can_compress(inode) || + !inode_need_compress(inode, start, end)) { + ret = cow_file_range(inode, locked_page, start, end, + page_started, nr_written, 1); } else { - set_bit(BTRFS_INODE_HAS_ASYNC_EXTENT, - &BTRFS_I(inode)->runtime_flags); - ret = cow_file_range_async(BTRFS_I(inode), wbc, locked_page, start, end, + set_bit(BTRFS_INODE_HAS_ASYNC_EXTENT, &inode->runtime_flags); + ret = cow_file_range_async(inode, wbc, locked_page, start, end, page_started, nr_written); } if (ret) - btrfs_cleanup_ordered_extents(BTRFS_I(inode), locked_page, start, + btrfs_cleanup_ordered_extents(inode, locked_page, start, end - start + 1); return ret; } |