btrfs: optionally extend i_size in cow_file_range_inline()
authorOmar Sandoval <osandov@fb.com>
Thu, 7 Nov 2019 23:19:16 +0000 (15:19 -0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 28 Feb 2022 15:20:03 +0000 (16:20 +0100)
commit44eedea9e2e3cafe97fb75cfdffba10356b8600f
tree5d35469ee0700399dfc06236a7fa7fef650217f5
parent1a7bbf739673728d3b897419e98d386a4ba7b224
btrfs: optionally extend i_size in cow_file_range_inline()

Currently, an inline extent is always created after i_size is extended
from btrfs_dirty_pages(). However, for encoded writes, we only want to
update i_size after we successfully created the inline extent. Add an
update_i_size parameter to cow_file_range_inline() and
insert_inline_extent() and pass in the size of the extent rather than
determining it from i_size.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ reformat comment ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c