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, 14 Mar 2022 12:13:51 +0000 (13:13 +0100)
commitd9496e8aba491e6c4c1c1c3549a93839ffd9b5a4
tree6d4da497a1e24e12e5c6a507da99ba329405bf52
parent8dd9872d2e261196069ab03d5dc5e6ec9bc93f4b
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