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>
Tue, 15 Feb 2022 15:54:50 +0000 (16:54 +0100)
commitbee2f2a09ccd0964c1484d5875191460ec448c3d
tree6c4bffb785152f4fdfb8a7ae25730157696bd28d
parenta5d549011edebce953fad08366f3f1f7b079019c
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