]> git.baikalelectronics.ru Git - kernel.git/commitdiff
btrfs: replace unnecessary goto with direct return at cow_file_range()
authorNaohiro Aota <naohiro.aota@wdc.com>
Tue, 21 Jun 2022 06:41:02 +0000 (15:41 +0900)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:45:38 +0000 (17:45 +0200)
The 'goto out' in cow_file_range() in the exit block are not necessary
and jump back. Replace them with return, while still keeping 'goto out'
in the main code.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ keep goto in the main code, update changelog ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c

index 90b1c1df09432ee17bc88f70541cec0880e7ce3b..fae0e8457edd405d4da46016f405b12a875d7298 100644 (file)
@@ -1413,7 +1413,7 @@ out_unlock:
                                             page_ops);
                start += cur_alloc_size;
                if (start >= end)
-                       goto out;
+                       return ret;
        }
 
        /*
@@ -1425,7 +1425,7 @@ out_unlock:
        extent_clear_unlock_delalloc(inode, start, end, locked_page,
                                     clear_bits | EXTENT_CLEAR_DATA_RESV,
                                     page_ops);
-       goto out;
+       return ret;
 }
 
 /*