Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storage: Use btrfs subvolume list command instead of walking dir to get subvolumes #12258

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

takonomura
Copy link
Contributor

This pull request changes getSubvolumes to use command btrfs subvolume list instead of walking the entire tree.

It took over three seconds to walk the entire tree in my test environment with a large tree. This can be reduced to a few milliseconds using the command.

lxd/storage/drivers/driver_btrfs_utils.go Outdated Show resolved Hide resolved
Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, as we should be able to backport this in one lump there's no specific need in this case to split the commits.

@tomponline tomponline dismissed monstermunchkin’s stale review September 15, 2023 15:21

Change has been fixed

@tomponline tomponline changed the title lxd/storage/drivers/btrfs: Use command instead of walking dir to get subvolumes storage: Use btrfs subvolume list command instead of walking dir to get subvolumes Sep 15, 2023
@tomponline tomponline merged commit f4faf3d into canonical:main Sep 15, 2023
24 of 25 checks passed
@takonomura takonomura deleted the faster-get-subvolumes branch September 19, 2023 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants