• Nikolay Borisov's avatar
    btrfs: Move loop termination condition in while() · 6b7d6e93
    Nikolay Borisov authored
    Fallocating a file in btrfs goes through several stages. The one before
    actually inserting the fallocated extents is to create a qgroup
    reservation, covering the desired range. To this end there is a loop in
    btrfs_fallocate which checks to see if there are holes in the fallocated
    range or !PREALLOC extents past EOF and if so create qgroup reservations
    for them. Unfortunately, the main condition of the loop is burried right
    at the end of its body rather than in the actual while statement which
    makes it non-obvious. Fix this by moving the condition in the while
    statement where it belongs. No functional changes.
    Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    6b7d6e93
file.c 84.6 KB