Lines Matching +full:libblkid +full:- +full:dev

1 // SPDX-License-Identifier: CDDL-1.0
10 * or https://opensource.org/licenses/CDDL-1.0.
57 * 2. Check for devices in use. Using libblkid to make sure that no
98 (void) fprintf(stderr, gettext("use '-f' to override " in vdev_error()
169 ret = -1; in check_file_generic()
267 * /dev/xxx Complete disk path
417 ashift = highbit64(sector_size) - 1; in make_leaf_vdev()
458 if ((strcmp(a->zprl_type, "raidz") == 0 || in is_raidz_mirror()
459 strcmp(a->zprl_type, "draid") == 0) && in is_raidz_mirror()
460 strcmp(b->zprl_type, "mirror") == 0) { in is_raidz_mirror()
474 if ((strcmp(a->zprl_type, "raidz") == 0 || in is_raidz_draid()
475 strcmp(a->zprl_type, "draid") == 0) && in is_raidz_draid()
476 (strcmp(b->zprl_type, "raidz") == 0 || in is_raidz_draid()
477 strcmp(b->zprl_type, "draid") == 0)) { in is_raidz_draid()
487 * an error message will be displayed for each self-inconsistent vdev.
544 * This is a mirror or RAID-Z vdev. Go through and make in get_replication()
572 vdev_size = -1LL; in get_replication()
577 int64_t size = -1LL; in get_replication()
668 (vdev_size != -1LL && in get_replication()
669 (llabs(size - vdev_size) > in get_replication()
701 if (raidz->zprl_parity != in get_replication()
702 mirror->zprl_children - 1) { in get_replication()
712 "%llu vs. %llu (%llu-way) " in get_replication()
714 raidz->zprl_type, in get_replication()
715 mirror->zprl_type, in get_replication()
717 raidz->zprl_parity, in get_replication()
719 mirror->zprl_children - 1, in get_replication()
721 mirror->zprl_children); in get_replication()
785 "both %llu-way and %llu-way %s " in get_replication()
807 * get_replication() to make sure the new spec is self-consistent. If the pool
822 * self-consistent. If not, simply return success. in check_replication()
856 return (-1); in check_replication()
867 if (raidz->zprl_parity != mirror->zprl_children - 1) { in check_replication()
871 "and %s vdevs, %llu vs. %llu (%llu-way)\n"), in check_replication()
872 raidz->zprl_type, in check_replication()
873 mirror->zprl_type, in check_replication()
874 (u_longlong_t)raidz->zprl_parity, in check_replication()
875 (u_longlong_t)mirror->zprl_children - 1, in check_replication()
876 (u_longlong_t)mirror->zprl_children); in check_replication()
877 ret = -1; in check_replication()
879 } else if (strcmp(current->zprl_type, new->zprl_type) != 0) { in check_replication()
883 current->zprl_type, new->zprl_type); in check_replication()
884 ret = -1; in check_replication()
885 } else if (current->zprl_parity != new->zprl_parity) { in check_replication()
889 (u_longlong_t)current->zprl_parity, in check_replication()
890 (u_longlong_t)new->zprl_parity); in check_replication()
891 ret = -1; in check_replication()
892 } else if (current->zprl_children != new->zprl_children) { in check_replication()
894 "mismatched replication level: pool uses %llu-way " in check_replication()
895 "%s and new vdev uses %llu-way %s\n"), in check_replication()
896 (u_longlong_t)current->zprl_children, in check_replication()
897 current->zprl_type, in check_replication()
898 (u_longlong_t)new->zprl_children, in check_replication()
899 new->zprl_type); in check_replication()
900 ret = -1; in check_replication()
921 return (-1); in zero_label()
929 if (err == -1) { in zero_label()
932 return (-1); in zero_label()
938 return (-1); in zero_label()
989 * libblkid will not misidentify the partition due to a in make_disks()
1026 if (fd == -1) { in make_disks()
1043 * If the provided path is for a /dev/disk/ device its in make_disks()
1061 * is provided as it appears under /dev/. in make_disks()
1080 return (-1); in make_disks()
1166 * regardless of what libblkid or zpool_in_use() says. in is_device_in_use()
1172 if (ret == -1) in is_device_in_use()
1173 return (-1); in is_device_in_use()
1231 /* 0-3, no suffixes allowed */ in get_parity()
1251 /* 0-3, allowed suffixes: '\0' or ':' */ in get_parity()
1344 * - data: number of data devices per group (1-255)
1345 * - parity: number of parity blocks per group (1-3)
1346 * - spares: number of distributed spare (0-100)
1347 * - children: total number of devices (1-255)
1350 * - zpool create tank draid <devices...>
1351 * - zpool create tank draid2:8d:51c:2s <devices...>
1388 /* Expected non-zero value with c/d/s suffix */ in draid_config_by_type()
1424 ndata = MIN(children - nspares - nparity, 8); in draid_config_by_type()
1435 if (ndata == 0 || (ndata + nparity > children - nspares)) { in draid_config_by_type()
1439 (u_longlong_t)(children - nspares - nparity)); in draid_config_by_type()
1447 if (nspares > 100 || nspares > (children - (ndata + nparity))) { in draid_config_by_type()
1471 * number of data drives (children - nspares). in draid_config_by_type()
1473 while (ngroups * (ndata + nparity) % (children - nspares) != 0) in draid_config_by_type()
1517 * are its leaves -- until we encounter the next mirror, in construct_spec()
1547 argc--; in construct_spec()
1559 argc--; in construct_spec()
1567 argc--; in construct_spec()
1608 for (c = 0; c < children - 1; c++) in construct_spec()
1614 child[children - 1] = nv; in construct_spec()
1637 argc -= c; in construct_spec()
1649 /* create a top-level vdev with children */ in construct_spec()
1674 mindev - 1) == 0); in construct_spec()
1721 argc--; in construct_spec()
1729 top[toplevels - 1] = nv; in construct_spec()
1746 * Finally, create nvroot and add all top-level vdevs to it. in construct_spec()
1847 * that the nvlist returned is well-formed, that all the devices exist, and that
1879 * uses (such as a dedicated dump device) that even '-f' cannot in make_root_vdev()
1901 vdev_error(gettext("at least one general top-level vdev must " in make_root_vdev()