Commit graph

12 commits

Author SHA1 Message Date
David Sterba b5aac254c7 btrfs-progs: common: update include lists, part 1
The tool IWYU (include what you use) suggests to remove and add some
includes. This is only partial to avoid accidental build breakage, the
includes are entangled and will have to be cleaned in the future again.

Signed-off-by: David Sterba <dsterba@suse.com>
2022-10-11 09:08:07 +02:00
David Sterba 272bff8978 btrfs-progs: common: reorder includes
The preferred order:
- system headers
- standard headers
- libraries
- kernel library
- kernel shared
- common headers
- other tools
- own headers

Signed-off-by: David Sterba <dsterba@suse.com>
2022-10-11 09:06:12 +02:00
David Sterba 0fc4bb4d91 btrfs-progs: remove unused subvol_uuid_search_add
After removal of the fallback uuid search code the helper is unused in
the internal code.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-08 20:47:04 +02:00
David Sterba ac5954ee36 btrfs-progs: merge subvol_uuid_search helpers
Due to ambiguity of error values in the public API subvol_uuid_search,
there was second version added. There's a separate copy in libbtrfs and
we don't have to distinguish in the internal code. All callers check for
IS_ERR and NULL, so we can safely merge the helpers into one.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-08 20:47:04 +02:00
David Sterba e491d9cf25 btrfs-progs: simplify struct subvol_uuid_search use
After removing uuid search fallback code the structure has become
trivial and copies the fd that all callers have in their context.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-08 20:47:04 +02:00
David Sterba 22f5600649 btrfs-progs: open code subvol_uuid_search_init
The helper is trivial after removing the uuid search fallback code,
open code it.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-08 20:47:04 +02:00
David Sterba f18dbe2bc6 btrfs-progs: remove empty subvol_uuid_search_finit
After the uuid search fallback code has been removed, the finit helper
has become empty and can be removed.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-08 20:47:04 +02:00
David Sterba 522945efc8 btrfs-progs: remove unused prototypes from send-utils.h
The functions are part of path-utils.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-08 20:47:04 +02:00
David Sterba a8dceec381 btrfs-progs: drop slow subvol uuid search
There's a lot of code under BTRFS_COMPAT_SEND_NO_UUID_TREE to support
kernels < 3.12 that don't have uuid tree and the subvolume uuids are
searched in a slow way, building the uuid tree on the userspace side.

As the uuid tree is always created, the fallback code was not exercised
anyway due to 'uuid_tree_existed' check in subvol_uuid_search2.

Delete the code from the internal copy of send-utils. The support still
stays for libbtrfs and will be removed in the future.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-08 20:47:04 +02:00
David Sterba 35882be40a btrfs-progs: remove BTRFS_FLAT_INCLUDES from internal send headers
There's a separate copy of the headers, we can remove the include switch
from the internal copies.

Signed-off-by: David Sterba <dsterba@suse.com>
2021-10-08 20:46:34 +02:00
David Sterba abb670f883 btrfs-progs: move ctree.c to kernel-shared/
Signed-off-by: David Sterba <dsterba@suse.com>
2020-08-31 17:01:05 +02:00
David Sterba cdaf906d68 btrfs-progs: move send-utils.c to common/
Signed-off-by: David Sterba <dsterba@suse.com>
2020-08-31 17:01:04 +02:00
Renamed from send-utils.h (Browse further)