]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - fs/btrfs/inode.c
btrfs: refactor variable scope in run_delalloc_nocow
authorNikolay Borisov <nborisov@suse.com>
Wed, 21 Aug 2019 07:42:03 +0000 (10:42 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 9 Sep 2019 12:59:13 +0000 (14:59 +0200)
commit3e024846d241b992ded27fdfdb78ea819abaa0cb
tree8a9a474cb209fa43ece19905b4638163cbf6d2ba
parentbcacf5f3f92b886431b3a739038cc74b5e7e9403
btrfs: refactor variable scope in run_delalloc_nocow

Of the 22 (!!!) local variables declared in this function only 9 have
function-wide context. Of the remaining 13, 12 are needed in the main
while loop of the function and 1 is needed in a tiny if branch, only in
case we have prealloc extent. This commit reduces the lifespan of every
variable to its bare minimum. It also renames the 'nolock' boolean to
freespace_inode to clearly indicate its purpose.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c