btrfs: use on-stack variable for block reserve in btrfs_replace_file_extents()
authorDavid Sterba <dsterba@suse.com>
Wed, 4 Jun 2025 09:29:27 +0000 (11:29 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jul 2025 21:53:31 +0000 (23:53 +0200)
commitc6aeae86b9af577ae84b97e6affcb228f5b9481a
treef2d1da4eb479886a5be4498c8e7dcb89a58bfc25
parent7ce22f62b2c5b022841ef51b7f8636484dc713a6
btrfs: use on-stack variable for block reserve in btrfs_replace_file_extents()

We can avoid potential memory allocation failure in
btrfs_replace_file_extents() as the block reserve lifetime is limited to
the scope of the function. This requires +48 bytes on stack.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/file.c