mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-12 14:30:12 +01:00
perf(zfs): optimise pool listing for pools with many datasets (#440)
Restricting the `zfs list` command to depth 1 saves a lot of time for pools with many datasets/zvols. In my case, before: ``` $ time zfs list -s name -o name,guid,available -H -p >/dev/null real 0m3.853s user 0m0.171s sys 0m3.539s ``` After: ``` $ time zfs list -d 1 -s name -o name,guid,available -H -p >/dev/null real 0m0.027s user 0m0.002s sys 0m0.026s ``` Signed-off-by: Joel Low <joel@joelsplace.sg>
This commit is contained in:
parent
4b059dbfaa
commit
ba0e1749ec
2 changed files with 2 additions and 1 deletions
|
|
@ -921,7 +921,7 @@ func CreateRestore(rstr *apis.ZFSRestore) error {
|
|||
// pools in the node.
|
||||
func ListZFSPool() ([]apis.Pool, error) {
|
||||
args := []string{
|
||||
ZFSListArg, "-s", "name",
|
||||
ZFSListArg, "-d", "1", "-s", "name",
|
||||
"-o", "name,guid,available",
|
||||
"-H", "-p",
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue