btrfs-progs/image
Qu Wenruo 930c6362d1 btrfs-progs: fix all variable shadowing
There are quite some variable shadowing in btrfs-progs, most of them are
just reusing some common names like tmp.
And those are quite safe and the shadowed one are even different type.

But there are some exceptions:

- @end in traverse_tree_blocks()
  There is already an @end with the same type, but a different meaning
  (the end of the current extent buffer passed in).
  Just rename it to @child_end.

- @start in generate_new_data_csums_range()
  Just rename it to @csum_start.

- @size of fixup_chunk_tree_block()
  This one is particularly bad, we declare a local @size and initialize
  it to -1, then before we really utilize the variable @size, we
  immediately reset it to 0, then pass it to logical_to_physical().
  Then there is a location to check if @size is -1, which will always be
  true.

  According to the code in logical_to_physical(), @size would be clamped
  down by its original value, thus our local @size will always be 0.

  This patch would rename the local @size to @found_size, and only set
  it to -1.
  The call site is only to pass something as logical_to_physical()
  requires a non-NULL pointer.
  We don't really need to bother the returned value.

- duplicated @ref declaration in run_delayed_tree_ref()
- duplicated @super_flags in change_meta_csums()
  Just delete the duplicated one.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-10-10 19:16:29 +02:00
..
common.c btrfs-progs: clean up includes, using include-what-you-use 2023-10-03 01:11:57 +02:00
common.h btrfs-progs: clean up includes, using include-what-you-use 2023-10-03 01:11:57 +02:00
image-create.c btrfs-progs: clean up includes, using include-what-you-use 2023-10-03 01:11:57 +02:00
image-restore.c btrfs-progs: fix all variable shadowing 2023-10-10 19:16:29 +02:00
main.c btrfs-progs: clean up includes, using include-what-you-use 2023-10-03 01:11:57 +02:00
Makefile btrfs-progs: build: add stub makefile to image and mkfs 2019-07-04 15:36:01 +02:00
metadump.h btrfs-progs: image: factor out the restore part from main.c 2023-08-28 17:24:25 +02:00
sanitize.c btrfs-progs: clean up includes, using include-what-you-use 2023-10-03 01:11:57 +02:00
sanitize.h btrfs-progs: image: update include lists 2022-10-11 09:06:12 +02:00