btrfs: simplify logic to decrement snapshot counter at btrfs_mksnapshot()
authorFilipe Manana <fdmanana@suse.com>
Tue, 5 Nov 2024 14:38:38 +0000 (14:38 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 11 Nov 2024 13:34:22 +0000 (14:34 +0100)
commite36d114990d2acf0a0fca135d50ac21a832daf11
treeb61ebbfd32f950294568a7abee7457bea528080f
parenta20725e1e7014642fc8ba4c7dd2c4ef6d4ec56a9
btrfs: simplify logic to decrement snapshot counter at btrfs_mksnapshot()

There's no point in having a 'snapshot_force_cow' variable to track if we
need to decrement the root->snapshot_force_cow counter, as we never jump
to the 'out' label after incrementing the counter. Simplify this by
removing the variable and always decrementing the counter before the 'out'
label, right after the call to btrfs_mksubvol().

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c