since Linux 4.10, barrier/nobarrier are still supported, but
are ignored, and barrier=1/0 seems to not work at at all
anymore.
so now we have three possibilities:
* ZFS: no mounting needed at all
* XFS: only noatime
* extX and btrfs: noatime and nobarrier
restructure code accordingly
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
if ($use_zfs) {
# do nothing
- } elsif ($use_btrfs) {
- syscmd("mount -n $rootdev -o noatime,nobarrier $targetdir") == 0 ||
- die "unable to mount $rootdev\n";
} else {
- syscmd ("mount -n $rootdev -o noatime,barrier=0 $targetdir") == 0 ||
+ my $mount_opts = 'noatime';
+ $mount_opts .= ',nobarrier'
+ if $use_btrfs || $filesys =~ /^ext\d$/;
+
+ syscmd("mount -n $rootdev -o $mount_opts $targetdir") == 0 ||
die "unable to mount $rootdev\n";
}