-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Import FreeBSD specific parts Signed-off-by: Matt Macy <mmacy@FreeBSD.org> Co-authored-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Requires-builders: arch,style,coverage,amazon2,centos7,debian10,ubuntu16,ubuntu18,builtin,freebsd12,freebsd13
- Loading branch information
Showing
214 changed files
with
47,137 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
preprocessorErrorDirective:./module/zfs/vdev_raidz_math_avx512f.c:243 | ||
preprocessorErrorDirective:./module/zfs/vdev_raidz_math_sse2.c:266 | ||
|
||
uninitvar:module/os/freebsd/zfs/vdev_geom.c | ||
uninitvar:module/os/freebsd/zfs/zfs_vfsops.c | ||
uninitvar:module/os/freebsd/spl/spl_zone.c | ||
uninitvar:lib/libzutil/os/freebsd/zutil_import_os.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,4 +62,9 @@ cscope.* | |
*.patch | ||
*.orig | ||
*.log | ||
*.tmp | ||
venv | ||
|
||
*.so | ||
*.so.debug | ||
*.so.full |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
SUBDIRS = zfs zpool zdb zhack zinject zstreamdump ztest | ||
SUBDIRS += fsck_zfs vdev_id raidz_test zgenhostid | ||
SUBDIRS += fsck_zfs vdev_id raidz_test | ||
|
||
if USING_PYTHON | ||
SUBDIRS += arcstat arc_summary dbufstat | ||
endif | ||
|
||
if BUILD_LINUX | ||
SUBDIRS += mount_zfs zed zvol_id zvol_wait | ||
SUBDIRS += mount_zfs zed zgenhostid zvol_id zvol_wait | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
/* | ||
* CDDL HEADER START | ||
* | ||
* The contents of this file are subject to the terms of the | ||
* Common Development and Distribution License (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* | ||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE | ||
* or http://www.opensolaris.org/os/licensing. | ||
* See the License for the specific language governing permissions | ||
* and limitations under the License. | ||
* | ||
* When distributing Covered Code, include this CDDL HEADER in each | ||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE. | ||
* If applicable, add the following below this CDDL HEADER, with the | ||
* fields enclosed by brackets "[]" replaced with your own identifying | ||
* information: Portions Copyright [yyyy] [name of copyright owner] | ||
* | ||
* CDDL HEADER END | ||
*/ | ||
|
||
/* | ||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. | ||
* Copyright (c) 2013, 2018 by Delphix. All rights reserved. | ||
* Copyright (c) 2016, 2017 Intel Corporation. | ||
* Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>. | ||
*/ | ||
|
||
/* | ||
* Functions to convert between a list of vdevs and an nvlist representing the | ||
* configuration. Each entry in the list can be one of: | ||
* | ||
* Device vdevs | ||
* disk=(path=..., devid=...) | ||
* file=(path=...) | ||
* | ||
* Group vdevs | ||
* raidz[1|2]=(...) | ||
* mirror=(...) | ||
* | ||
* Hot spares | ||
* | ||
* While the underlying implementation supports it, group vdevs cannot contain | ||
* other group vdevs. All userland verification of devices is contained within | ||
* this file. If successful, the nvlist returned can be passed directly to the | ||
* kernel; we've done as much verification as possible in userland. | ||
* | ||
* Hot spares are a special case, and passed down as an array of disk vdevs, at | ||
* the same level as the root of the vdev tree. | ||
* | ||
* The only function exported by this file is 'make_root_vdev'. The | ||
* function performs several passes: | ||
* | ||
* 1. Construct the vdev specification. Performs syntax validation and | ||
* makes sure each device is valid. | ||
* 2. Check for devices in use. Using libdiskmgt, makes sure that no | ||
* devices are also in use. Some can be overridden using the 'force' | ||
* flag, others cannot. | ||
* 3. Check for replication errors if the 'force' flag is not specified. | ||
* validates that the replication level is consistent across the | ||
* entire pool. | ||
* 4. Call libzfs to label any whole disks with an EFI label. | ||
*/ | ||
|
||
#include <assert.h> | ||
#include <errno.h> | ||
#include <fcntl.h> | ||
#include <libintl.h> | ||
#include <libnvpair.h> | ||
#include <libzutil.h> | ||
#include <limits.h> | ||
#include <sys/spa.h> | ||
#include <stdio.h> | ||
#include <string.h> | ||
#include <unistd.h> | ||
#include <paths.h> | ||
#include <sys/stat.h> | ||
#include <sys/disk.h> | ||
#include <sys/mntent.h> | ||
#include <libgeom.h> | ||
|
||
#include "zpool_util.h" | ||
#include <sys/zfs_context.h> | ||
|
||
int | ||
check_device(const char *name, boolean_t force, boolean_t isspare, | ||
boolean_t iswholedisk) | ||
{ | ||
char path[MAXPATHLEN]; | ||
|
||
if (strncmp(name, _PATH_DEV, sizeof (_PATH_DEV) - 1) != 0) | ||
snprintf(path, sizeof (path), "%s%s", _PATH_DEV, name); | ||
else | ||
strlcpy(path, name, sizeof (path)); | ||
|
||
return (check_file(path, force, isspare)); | ||
} | ||
|
||
boolean_t | ||
check_sector_size_database(char *path, int *sector_size) | ||
{ | ||
return (0); | ||
} | ||
|
||
void | ||
zpool_vdev_enable_file(struct stat64 *statbuf, boolean_t *wholedisk) | ||
{ | ||
if (S_ISCHR(statbuf->st_mode)) { | ||
statbuf->st_mode &= ~S_IFCHR; | ||
statbuf->st_mode |= S_IFBLK; | ||
*wholedisk = B_FALSE; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.