Skip to content

Commit

Permalink
display btrfs subvolume as one partition, issue aristocratos#375
Browse files Browse the repository at this point in the history
  • Loading branch information
koitococo committed Jun 2, 2024
1 parent 516979b commit 7b13d4a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/linux/btop_collect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1837,6 +1837,21 @@ namespace Mem {
size_t zfs_dataset_name_start = 0;
if (fstype == "zfs" && (zfs_dataset_name_start = dev.find('/')) != std::string::npos && zfs_hide_datasets) continue;

//? skip BtrFS subvolumes
if (fstype == "btrfs") {
bool other_subvol_found = false;
string devname = fs::canonical(dev, ec).filename();
for (auto& [mp, info] : disks) {
if (info.dev.filename() == devname and mp != mountpoint) {
other_subvol_found = true;
break;
}
}
if (other_subvol_found) {
continue;
}
}

if ((not use_fstab and not only_physical)
or (use_fstab and v_contains(fstab, mountpoint))
or (not use_fstab and only_physical and v_contains(fstypes, fstype))) {
Expand Down

0 comments on commit 7b13d4a

Please sign in to comment.