Skip to content

Commit

Permalink
btrfs-progs: subvol list: use libbtrfsutil
Browse files Browse the repository at this point in the history
btrfs subvol list has its own subvolume walking implementation that we
can replace with a libbtrfsutil subvolume iterator. Most of the changed
lines are removing the old implementation and mechanically updating the
comparators, filters, and printers to use libbtrfsutil's subvolume info.
The interesting parts are:

1. We can replace the red-black tree of subvolumes with an array that we
   qsort.
2. Listing deleted subvolumes needs a different codepath, but we don't
   need a filter for it anymore.
3. We need some hacks to maintain the weird path behavior documented in
   the previous commit.

In addition to removing a bunch of redundant code, this also prepares us
for allowing subvol list by unprivileged users in some cases.

Signed-off-by: Omar Sandoval <[email protected]>
  • Loading branch information
osandov authored and maharmstone committed Sep 12, 2024
1 parent d18d741 commit 78a453a
Showing 1 changed file with 260 additions and 709 deletions.
Loading

0 comments on commit 78a453a

Please sign in to comment.