zfs.c (d9fe71828797508d1d28655e40780a5ae9078e66) | zfs.c (4e15366c6a6907bcd0e2c28885ba5878ed4280d2) |
---|---|
1/*- 2 * SPDX-License-Identifier: BSD-2-Clause 3 * 4 * Copyright (c) 2022 The FreeBSD Foundation 5 * 6 * This software was developed by Mark Johnston under sponsorship from 7 * the FreeBSD Foundation. 8 * --- 77 unchanged lines hidden (view full) --- 86 { '\0', "mssize", &zfs->mssize, OPT_INT64, 87 MINMSSIZE, MAXMSSIZE, "Metaslab size" }, 88 { '\0', "poolname", &zfs->poolname, OPT_STRPTR, 89 0, 0, "ZFS pool name" }, 90 { '\0', "rootpath", &zfs->rootpath, OPT_STRPTR, 91 0, 0, "Prefix for all dataset mount points" }, 92 { '\0', "ashift", &zfs->ashift, OPT_INT32, 93 MINBLOCKSHIFT, MAXBLOCKSHIFT, "ZFS pool ashift" }, | 1/*- 2 * SPDX-License-Identifier: BSD-2-Clause 3 * 4 * Copyright (c) 2022 The FreeBSD Foundation 5 * 6 * This software was developed by Mark Johnston under sponsorship from 7 * the FreeBSD Foundation. 8 * --- 77 unchanged lines hidden (view full) --- 86 { '\0', "mssize", &zfs->mssize, OPT_INT64, 87 MINMSSIZE, MAXMSSIZE, "Metaslab size" }, 88 { '\0', "poolname", &zfs->poolname, OPT_STRPTR, 89 0, 0, "ZFS pool name" }, 90 { '\0', "rootpath", &zfs->rootpath, OPT_STRPTR, 91 0, 0, "Prefix for all dataset mount points" }, 92 { '\0', "ashift", &zfs->ashift, OPT_INT32, 93 MINBLOCKSHIFT, MAXBLOCKSHIFT, "ZFS pool ashift" }, |
94 { '\0', "verify-txgs", &zfs->verify_txgs, OPT_BOOL, 95 0, 0, "Make OpenZFS verify data upon import" }, |
|
94 { '\0', "nowarn", &zfs->nowarn, OPT_BOOL, 95 0, 0, "Provided for backwards compatibility, ignored" }, 96 { .name = NULL } 97 }; 98 99 STAILQ_INIT(&zfs->datasetdescs); 100 101 fsopts->fs_specific = zfs; --- 487 unchanged lines hidden (view full) --- 589 * Fill out the uberblock. Just make each one the same. The embedded 590 * checksum is calculated in vdev_label_write(). 591 */ 592 for (size_t uoff = 0; uoff < sizeof(label->vl_uberblock); 593 uoff += (1 << zfs->ashift)) { 594 ub = (uberblock_t *)(&label->vl_uberblock[0] + uoff); 595 ub->ub_magic = UBERBLOCK_MAGIC; 596 ub->ub_version = SPA_VERSION; | 96 { '\0', "nowarn", &zfs->nowarn, OPT_BOOL, 97 0, 0, "Provided for backwards compatibility, ignored" }, 98 { .name = NULL } 99 }; 100 101 STAILQ_INIT(&zfs->datasetdescs); 102 103 fsopts->fs_specific = zfs; --- 487 unchanged lines hidden (view full) --- 591 * Fill out the uberblock. Just make each one the same. The embedded 592 * checksum is calculated in vdev_label_write(). 593 */ 594 for (size_t uoff = 0; uoff < sizeof(label->vl_uberblock); 595 uoff += (1 << zfs->ashift)) { 596 ub = (uberblock_t *)(&label->vl_uberblock[0] + uoff); 597 ub->ub_magic = UBERBLOCK_MAGIC; 598 ub->ub_version = SPA_VERSION; |
599 600 /* 601 * Upon import, OpenZFS will perform metadata verification of 602 * the last TXG by default. If all data is written in the same 603 * TXG, it'll all get verified, which can be painfully slow in 604 * some cases, e.g., initial boot in a cloud environment with 605 * slow storage. So, fabricate additional TXGs to avoid this 606 * overhead, unless the user requests otherwise. 607 */ |
|
597 ub->ub_txg = TXG; | 608 ub->ub_txg = TXG; |
609 if (!zfs->verify_txgs) 610 ub->ub_txg += TXG_SIZE; |
|
598 ub->ub_guid_sum = zfs->poolguid + zfs->vdevguid; 599 ub->ub_timestamp = 0; 600 601 ub->ub_software_version = SPA_VERSION; 602 ub->ub_mmp_magic = MMP_MAGIC; 603 ub->ub_mmp_delay = 0; 604 ub->ub_mmp_config = 0; 605 ub->ub_checkpoint_txg = 0; --- 186 unchanged lines hidden --- | 611 ub->ub_guid_sum = zfs->poolguid + zfs->vdevguid; 612 ub->ub_timestamp = 0; 613 614 ub->ub_software_version = SPA_VERSION; 615 ub->ub_mmp_magic = MMP_MAGIC; 616 ub->ub_mmp_delay = 0; 617 ub->ub_mmp_config = 0; 618 ub->ub_checkpoint_txg = 0; --- 186 unchanged lines hidden --- |