aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorMariusz Zaborski <[email protected]>2020-08-20 02:19:42 +0200
committerGitHub <[email protected]>2020-08-19 17:19:42 -0700
commitf2c027bd6a003ec5793f8716e6189c389c60f47a (patch)
treefea3b0c3a50e7982cd8cd11abd4263a70d706ef6 /module
parent5266a0728aae503fb2f79961299d4dffac58b22a (diff)
FreeBSD: Add option to rewind checkpoint while importing root pool
This option is used by FreeBSD boot loader. Reviewed-by: Ryan Moeller <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Mariusz Zaborski <[email protected]> Closes #10738
Diffstat (limited to 'module')
-rw-r--r--module/os/freebsd/zfs/spa_os.c5
-rw-r--r--module/os/freebsd/zfs/zfs_vfsops.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/module/os/freebsd/zfs/spa_os.c b/module/os/freebsd/zfs/spa_os.c
index a84b8532e..2bc78cb45 100644
--- a/module/os/freebsd/zfs/spa_os.c
+++ b/module/os/freebsd/zfs/spa_os.c
@@ -185,7 +185,7 @@ spa_generate_rootconf(const char *name)
}
int
-spa_import_rootpool(const char *name)
+spa_import_rootpool(const char *name, bool checkpointrewind)
{
spa_t *spa;
vdev_t *rvd;
@@ -244,6 +244,9 @@ spa_import_rootpool(const char *name)
}
spa->spa_is_root = B_TRUE;
spa->spa_import_flags = ZFS_IMPORT_VERBATIM;
+ if (checkpointrewind) {
+ spa->spa_import_flags |= ZFS_IMPORT_CHECKPOINT;
+ }
/*
* Build up a vdev tree based on the boot device's label config.
diff --git a/module/os/freebsd/zfs/zfs_vfsops.c b/module/os/freebsd/zfs/zfs_vfsops.c
index 78968ed8d..f94ea4433 100644
--- a/module/os/freebsd/zfs/zfs_vfsops.c
+++ b/module/os/freebsd/zfs/zfs_vfsops.c
@@ -1580,7 +1580,7 @@ zfs_mount(vfs_t *vfsp)
error = getpoolname(osname, pname);
if (error == 0)
- error = spa_import_rootpool(pname);
+ error = spa_import_rootpool(pname, false);
if (error)
goto out;
}