mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 19:04:45 +03:00
Compare commits
96 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9f5f866266 | |||
| 8829ba19b7 | |||
| 642d86af0d | |||
| 07ca7592ad | |||
| fb0d807477 | |||
| 858ea8861c | |||
| 549841ef9a | |||
| 96f322e7e2 | |||
| d022406a14 | |||
| a1a1386965 | |||
| 43eaef6de8 | |||
| 5bc4c39d70 | |||
| 756e28be51 | |||
| 039a810491 | |||
| bfb7b9613a | |||
| 3e33897bec | |||
| 0f3b928e85 | |||
| 12fec4a147 | |||
| 7930a5ee65 | |||
| be94a3de0f | |||
| db83b3abe9 | |||
| 55fd8ceab6 | |||
| e269e1c07a | |||
| 81f981cd82 | |||
| 3790aa8176 | |||
| 4e1d1b4b92 | |||
| c32c475363 | |||
| dd487640b2 | |||
| acb39fc9a4 | |||
| 6539bf71fe | |||
| 32a78e579d | |||
| fb7aa3c9b2 | |||
| 4016ad705b | |||
| 59570a05d8 | |||
| 88ae76a4e0 | |||
| 88d7da62b5 | |||
| 6410ee4a94 | |||
| a296875da0 | |||
| 921ec61b77 | |||
| fcd9966ed9 | |||
| a2621753b2 | |||
| e888f28988 | |||
| 305510fd33 | |||
| 67cff6e4c1 | |||
| 944180ab50 | |||
| 3075b29ca8 | |||
| e1d9228b08 | |||
| afaf9414ff | |||
| cee725c9bd | |||
| 03ad94a3b2 | |||
| 7a7e101437 | |||
| 401ba57ccd | |||
| 188950df9e | |||
| 58bc86c5cb | |||
| 7cf4cd8246 | |||
| 783be694f1 | |||
| af5626ac27 | |||
| cc1f85be8b | |||
| 9585538d0e | |||
| 86e74dc162 | |||
| b3d723fb0e | |||
| 3d40b65540 | |||
| fa7b558bef | |||
| a103ae446e | |||
| 2ab24dfded | |||
| 489633d99a | |||
| ee49d9e02b | |||
| 1fbda9caee | |||
| 42bdfd3b36 | |||
| 900480bd96 | |||
| 058b6fd069 | |||
| 8847b06bf6 | |||
| 21adfb031c | |||
| ae2cfdf8a7 | |||
| 20e4513c56 | |||
| f217a2b902 | |||
| aa5b9e1d7c | |||
| fb3ad5d24e | |||
| de2ac3f700 | |||
| f9688b21d7 | |||
| fad85e52e5 | |||
| 038aaec1cd | |||
| 94ca328fb3 | |||
| 65c4c9a233 | |||
| 07ca433973 | |||
| f21d1f8fad | |||
| ee8794195b | |||
| 0ef4def852 | |||
| aa51adf0a2 | |||
| 1d02bdee6c | |||
| 2080c4f27e | |||
| 49ba502f99 | |||
| 7735c9addf | |||
| ed02d603a1 | |||
| 529469769f | |||
| 3b854534f0 |
@@ -2,7 +2,7 @@ name: checkstyle
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
pull_request_target:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
checkstyle:
|
checkstyle:
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
name: zfs-tests-functional
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tests-functional-ubuntu:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [18.04, 20.04]
|
||||||
|
runs-on: ubuntu-${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install --yes -qq build-essential autoconf libtool gdb lcov \
|
||||||
|
git alien fakeroot wget curl bc fio acl \
|
||||||
|
sysstat mdadm lsscsi parted gdebi attr dbench watchdog ksh \
|
||||||
|
nfs-kernel-server samba rng-tools xz-utils \
|
||||||
|
zlib1g-dev uuid-dev libblkid-dev libselinux-dev \
|
||||||
|
xfslibs-dev libattr1-dev libacl1-dev libudev-dev libdevmapper-dev \
|
||||||
|
libssl-dev libffi-dev libaio-dev libelf-dev libmount-dev \
|
||||||
|
libpam0g-dev pamtester python-dev python-setuptools python-cffi \
|
||||||
|
python3 python3-dev python3-setuptools python3-cffi
|
||||||
|
- name: Autogen.sh
|
||||||
|
run: |
|
||||||
|
sh autogen.sh
|
||||||
|
- name: Configure
|
||||||
|
run: |
|
||||||
|
./configure --enable-debug --enable-debuginfo
|
||||||
|
- name: Make
|
||||||
|
run: |
|
||||||
|
make --no-print-directory -s pkg-utils pkg-kmod
|
||||||
|
- name: Install
|
||||||
|
run: |
|
||||||
|
sudo dpkg -i *.deb
|
||||||
|
# Update order of directories to search for modules, otherwise
|
||||||
|
# Ubuntu will load kernel-shipped ones.
|
||||||
|
sudo sed -i.bak 's/updates/extra updates/' /etc/depmod.d/ubuntu.conf
|
||||||
|
sudo depmod
|
||||||
|
sudo modprobe zfs
|
||||||
|
- name: Tests
|
||||||
|
run: |
|
||||||
|
/usr/share/zfs/zfs-tests.sh -v -s 3G
|
||||||
|
- name: Prepare artifacts
|
||||||
|
if: failure()
|
||||||
|
run: |
|
||||||
|
RESULTS_PATH=$(readlink -f /var/tmp/test_results/current)
|
||||||
|
sudo dmesg > $RESULTS_PATH/dmesg
|
||||||
|
sudo cp /var/log/syslog $RESULTS_PATH/
|
||||||
|
sudo chmod +r $RESULTS_PATH/*
|
||||||
|
# Replace ':' in dir names, actions/upload-artifact doesn't support it
|
||||||
|
for f in $(find $RESULTS_PATH -name '*:*'); do mv "$f" "${f//:/__}"; done
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
if: failure()
|
||||||
|
with:
|
||||||
|
name: Test logs Ubuntu-${{ matrix.os }}
|
||||||
|
path: /var/tmp/test_results/20*/
|
||||||
|
if-no-files-found: ignore
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
name: zfs-tests-sanity
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install --yes -qq build-essential autoconf libtool gdb lcov \
|
||||||
|
git alien fakeroot wget curl bc fio acl \
|
||||||
|
sysstat mdadm lsscsi parted gdebi attr dbench watchdog ksh \
|
||||||
|
nfs-kernel-server samba rng-tools xz-utils \
|
||||||
|
zlib1g-dev uuid-dev libblkid-dev libselinux-dev \
|
||||||
|
xfslibs-dev libattr1-dev libacl1-dev libudev-dev libdevmapper-dev \
|
||||||
|
libssl-dev libffi-dev libaio-dev libelf-dev libmount-dev \
|
||||||
|
libpam0g-dev pamtester python-dev python-setuptools python-cffi \
|
||||||
|
python3 python3-dev python3-setuptools python3-cffi
|
||||||
|
- name: Autogen.sh
|
||||||
|
run: |
|
||||||
|
sh autogen.sh
|
||||||
|
- name: Configure
|
||||||
|
run: |
|
||||||
|
./configure --enable-debug --enable-debuginfo
|
||||||
|
- name: Make
|
||||||
|
run: |
|
||||||
|
make --no-print-directory -s pkg-utils pkg-kmod
|
||||||
|
- name: Install
|
||||||
|
run: |
|
||||||
|
sudo dpkg -i *.deb
|
||||||
|
# Update order of directories to search for modules, otherwise
|
||||||
|
# Ubuntu will load kernel-shipped ones.
|
||||||
|
sudo sed -i.bak 's/updates/extra updates/' /etc/depmod.d/ubuntu.conf
|
||||||
|
sudo depmod
|
||||||
|
sudo modprobe zfs
|
||||||
|
- name: Tests
|
||||||
|
run: |
|
||||||
|
/usr/share/zfs/zfs-tests.sh -v -s 3G -r sanity
|
||||||
|
- name: Prepare artifacts
|
||||||
|
if: failure()
|
||||||
|
run: |
|
||||||
|
RESULTS_PATH=$(readlink -f /var/tmp/test_results/current)
|
||||||
|
sudo dmesg > $RESULTS_PATH/dmesg
|
||||||
|
sudo cp /var/log/syslog $RESULTS_PATH/
|
||||||
|
sudo chmod +r $RESULTS_PATH/*
|
||||||
|
# Replace ':' in dir names, actions/upload-artifact doesn't support it
|
||||||
|
for f in $(find $RESULTS_PATH -name '*:*'); do mv "$f" "${f//:/__}"; done
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
if: failure()
|
||||||
|
with:
|
||||||
|
name: Test logs
|
||||||
|
path: /var/tmp/test_results/20*/
|
||||||
|
if-no-files-found: ignore
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
name: zloop
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
TEST_DIR: /var/tmp/zloop
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install --yes -qq build-essential autoconf libtool gdb \
|
||||||
|
git alien fakeroot \
|
||||||
|
zlib1g-dev uuid-dev libblkid-dev libselinux-dev \
|
||||||
|
xfslibs-dev libattr1-dev libacl1-dev libudev-dev libdevmapper-dev \
|
||||||
|
libssl-dev libffi-dev libaio-dev libelf-dev libmount-dev \
|
||||||
|
libpam0g-dev \
|
||||||
|
python-dev python-setuptools python-cffi \
|
||||||
|
python3 python3-dev python3-setuptools python3-cffi
|
||||||
|
- name: Autogen.sh
|
||||||
|
run: |
|
||||||
|
sh autogen.sh
|
||||||
|
- name: Configure
|
||||||
|
run: |
|
||||||
|
./configure --enable-debug --enable-debuginfo
|
||||||
|
- name: Make
|
||||||
|
run: |
|
||||||
|
make --no-print-directory -s pkg-utils pkg-kmod
|
||||||
|
- name: Install
|
||||||
|
run: |
|
||||||
|
sudo dpkg -i *.deb
|
||||||
|
# Update order of directories to search for modules, otherwise
|
||||||
|
# Ubuntu will load kernel-shipped ones.
|
||||||
|
sudo sed -i.bak 's/updates/extra updates/' /etc/depmod.d/ubuntu.conf
|
||||||
|
sudo depmod
|
||||||
|
sudo modprobe zfs
|
||||||
|
- name: Tests
|
||||||
|
run: |
|
||||||
|
sudo mkdir -p $TEST_DIR
|
||||||
|
# run for 20 minutes to have a total runner time of 30 minutes
|
||||||
|
sudo /usr/share/zfs/zloop.sh -t 1200 -l -m1
|
||||||
|
- name: Prepare artifacts
|
||||||
|
if: failure()
|
||||||
|
run: |
|
||||||
|
sudo chmod +r -R $TEST_DIR/
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
if: failure()
|
||||||
|
with:
|
||||||
|
name: Logs
|
||||||
|
path: |
|
||||||
|
/var/tmp/zloop/*/
|
||||||
|
!/var/tmp/zloop/*/vdev/
|
||||||
|
if-no-files-found: ignore
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
if: failure()
|
||||||
|
with:
|
||||||
|
name: Pool files
|
||||||
|
path: |
|
||||||
|
/var/tmp/zloop/*/vdev/
|
||||||
|
if-no-files-found: ignore
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
Meta: 1
|
Meta: 1
|
||||||
Name: zfs
|
Name: zfs
|
||||||
Branch: 1.0
|
Branch: 1.0
|
||||||
Version: 2.0.0
|
Version: 2.0.3
|
||||||
Release: 1
|
Release: 1
|
||||||
Release-Tags: relext
|
Release-Tags: relext
|
||||||
License: CDDL
|
License: CDDL
|
||||||
Author: OpenZFS
|
Author: OpenZFS
|
||||||
Linux-Maximum: 5.9
|
Linux-Maximum: 5.10
|
||||||
Linux-Minimum: 3.10
|
Linux-Minimum: 3.10
|
||||||
|
|||||||
@@ -59,14 +59,20 @@ if sys.platform.startswith('freebsd'):
|
|||||||
# Requires py27-sysctl on FreeBSD
|
# Requires py27-sysctl on FreeBSD
|
||||||
import sysctl
|
import sysctl
|
||||||
|
|
||||||
|
def is_value(ctl):
|
||||||
|
return ctl.type != sysctl.CTLTYPE_NODE
|
||||||
|
|
||||||
def load_kstats(namespace):
|
def load_kstats(namespace):
|
||||||
"""Collect information on a specific subsystem of the ARC"""
|
"""Collect information on a specific subsystem of the ARC"""
|
||||||
|
|
||||||
base = 'kstat.zfs.misc.%s.' % namespace
|
base = 'kstat.zfs.misc.%s.' % namespace
|
||||||
return [(kstat.name, D(kstat.value)) for kstat in sysctl.filter(base)]
|
fmt = lambda kstat: (kstat.name, D(kstat.value))
|
||||||
|
kstats = sysctl.filter(base)
|
||||||
|
return [fmt(kstat) for kstat in kstats if is_value(kstat)]
|
||||||
|
|
||||||
def load_tunables():
|
def load_tunables():
|
||||||
return dict((ctl.name, ctl.value) for ctl in sysctl.filter('vfs.zfs'))
|
ctls = sysctl.filter('vfs.zfs')
|
||||||
|
return dict((ctl.name, ctl.value) for ctl in ctls if is_value(ctl))
|
||||||
|
|
||||||
elif sys.platform.startswith('linux'):
|
elif sys.platform.startswith('linux'):
|
||||||
|
|
||||||
|
|||||||
@@ -86,16 +86,24 @@ if sys.platform.startswith('freebsd'):
|
|||||||
|
|
||||||
VDEV_CACHE_SIZE = 'vdev.cache_size'
|
VDEV_CACHE_SIZE = 'vdev.cache_size'
|
||||||
|
|
||||||
|
def is_value(ctl):
|
||||||
|
return ctl.type != sysctl.CTLTYPE_NODE
|
||||||
|
|
||||||
|
def namefmt(ctl, base='vfs.zfs.'):
|
||||||
|
# base is removed from the name
|
||||||
|
cut = len(base)
|
||||||
|
return ctl.name[cut:]
|
||||||
|
|
||||||
def load_kstats(section):
|
def load_kstats(section):
|
||||||
base = 'kstat.zfs.misc.{section}.'.format(section=section)
|
base = 'kstat.zfs.misc.{section}.'.format(section=section)
|
||||||
# base is removed from the name
|
fmt = lambda kstat: '{name} : {value}'.format(name=namefmt(kstat, base),
|
||||||
fmt = lambda kstat: '{name} : {value}'.format(name=kstat.name[len(base):],
|
|
||||||
value=kstat.value)
|
value=kstat.value)
|
||||||
return [fmt(kstat) for kstat in sysctl.filter(base)]
|
kstats = sysctl.filter(base)
|
||||||
|
return [fmt(kstat) for kstat in kstats if is_value(kstat)]
|
||||||
|
|
||||||
def get_params(base):
|
def get_params(base):
|
||||||
cut = 8 # = len('vfs.zfs.')
|
ctls = sysctl.filter(base)
|
||||||
return {ctl.name[cut:]: str(ctl.value) for ctl in sysctl.filter(base)}
|
return {namefmt(ctl): str(ctl.value) for ctl in ctls if is_value(ctl)}
|
||||||
|
|
||||||
def get_tunable_params():
|
def get_tunable_params():
|
||||||
return get_params('vfs.zfs')
|
return get_params('vfs.zfs')
|
||||||
@@ -112,25 +120,8 @@ if sys.platform.startswith('freebsd'):
|
|||||||
return '{} version {}'.format(name, version)
|
return '{} version {}'.format(name, version)
|
||||||
|
|
||||||
def get_descriptions(_request):
|
def get_descriptions(_request):
|
||||||
# py-sysctl doesn't give descriptions, so we have to shell out.
|
ctls = sysctl.filter('vfs.zfs')
|
||||||
command = ['sysctl', '-d', 'vfs.zfs']
|
return {namefmt(ctl): ctl.description for ctl in ctls if is_value(ctl)}
|
||||||
|
|
||||||
# The recommended way to do this is with subprocess.run(). However,
|
|
||||||
# some installed versions of Python are < 3.5, so we offer them
|
|
||||||
# the option of doing it the old way (for now)
|
|
||||||
if 'run' in dir(subprocess):
|
|
||||||
info = subprocess.run(command, stdout=subprocess.PIPE,
|
|
||||||
universal_newlines=True)
|
|
||||||
lines = info.stdout.split('\n')
|
|
||||||
else:
|
|
||||||
info = subprocess.check_output(command, universal_newlines=True)
|
|
||||||
lines = info.split('\n')
|
|
||||||
|
|
||||||
def fmt(line):
|
|
||||||
name, desc = line.split(':', 1)
|
|
||||||
return (name.strip(), desc.strip())
|
|
||||||
|
|
||||||
return dict([fmt(line) for line in lines if len(line) > 0])
|
|
||||||
|
|
||||||
|
|
||||||
elif sys.platform.startswith('linux'):
|
elif sys.platform.startswith('linux'):
|
||||||
@@ -397,8 +388,12 @@ def format_raw_line(name, value):
|
|||||||
if ARGS.alt:
|
if ARGS.alt:
|
||||||
result = '{0}{1}={2}'.format(INDENT, name, value)
|
result = '{0}{1}={2}'.format(INDENT, name, value)
|
||||||
else:
|
else:
|
||||||
spc = LINE_LENGTH-(len(INDENT)+len(value))
|
# Right-align the value within the line length if it fits,
|
||||||
result = '{0}{1:<{spc}}{2}'.format(INDENT, name, value, spc=spc)
|
# otherwise just separate it from the name by a single space.
|
||||||
|
fit = LINE_LENGTH - len(INDENT) - len(name)
|
||||||
|
overflow = len(value) + 1
|
||||||
|
w = max(fit, overflow)
|
||||||
|
result = '{0}{1}{2:>{w}}'.format(INDENT, name, value, w=w)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|||||||
@@ -128,13 +128,14 @@ pretty_print = True
|
|||||||
|
|
||||||
|
|
||||||
if sys.platform.startswith('freebsd'):
|
if sys.platform.startswith('freebsd'):
|
||||||
# Requires py27-sysctl on FreeBSD
|
# Requires py-sysctl on FreeBSD
|
||||||
import sysctl
|
import sysctl
|
||||||
|
|
||||||
def kstat_update():
|
def kstat_update():
|
||||||
global kstat
|
global kstat
|
||||||
|
|
||||||
k = sysctl.filter('kstat.zfs.misc.arcstats')
|
k = [ctl for ctl in sysctl.filter('kstat.zfs.misc.arcstats')
|
||||||
|
if ctl.type != sysctl.CTLTYPE_NODE]
|
||||||
|
|
||||||
if not k:
|
if not k:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ elif sys.platform.startswith("linux"):
|
|||||||
def print_incompat_helper(incompat):
|
def print_incompat_helper(incompat):
|
||||||
cnt = 0
|
cnt = 0
|
||||||
for key in sorted(incompat):
|
for key in sorted(incompat):
|
||||||
if cnt is 0:
|
if cnt == 0:
|
||||||
sys.stderr.write("\t")
|
sys.stderr.write("\t")
|
||||||
elif cnt > 8:
|
elif cnt > 8:
|
||||||
sys.stderr.write(",\n\t")
|
sys.stderr.write(",\n\t")
|
||||||
@@ -662,7 +662,7 @@ def main():
|
|||||||
if not ifile:
|
if not ifile:
|
||||||
ifile = default_ifile()
|
ifile = default_ifile()
|
||||||
|
|
||||||
if ifile is not "-":
|
if ifile != "-":
|
||||||
try:
|
try:
|
||||||
tmp = open(ifile, "r")
|
tmp = open(ifile, "r")
|
||||||
sys.stdin = tmp
|
sys.stdin = tmp
|
||||||
|
|||||||
+36
-44
@@ -43,53 +43,45 @@
|
|||||||
libzfs_handle_t *g_zfs;
|
libzfs_handle_t *g_zfs;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return the pool/dataset to mount given the name passed to mount. This
|
* Opportunistically convert a target string into a pool name. If the
|
||||||
* is expected to be of the form pool/dataset, however may also refer to
|
* string does not represent a block device with a valid zfs label
|
||||||
* a block device if that device contains a valid zfs label.
|
* then it is passed through without modification.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
parse_dataset(const char *target, char **dataset)
|
parse_dataset(const char *target, char **dataset)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* We expect a pool/dataset to be provided, however if we're
|
* Prior to util-linux 2.36.2, if a file or directory in the
|
||||||
* given a device which is a member of a zpool we attempt to
|
* current working directory was named 'dataset' then mount(8)
|
||||||
* extract the pool name stored in the label. Given the pool
|
* would prepend the current working directory to the dataset.
|
||||||
* name we can mount the root dataset.
|
* Check for it and strip the prepended path when it is added.
|
||||||
*/
|
|
||||||
int fd = open(target, O_RDONLY);
|
|
||||||
if (fd >= 0) {
|
|
||||||
nvlist_t *config = NULL;
|
|
||||||
if (zpool_read_label(fd, &config, NULL) != 0)
|
|
||||||
config = NULL;
|
|
||||||
if (close(fd))
|
|
||||||
perror("close");
|
|
||||||
|
|
||||||
if (config) {
|
|
||||||
char *name = NULL;
|
|
||||||
if (!nvlist_lookup_string(config,
|
|
||||||
ZPOOL_CONFIG_POOL_NAME, &name))
|
|
||||||
(void) strlcpy(*dataset, name, PATH_MAX);
|
|
||||||
nvlist_free(config);
|
|
||||||
if (name)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If a file or directory in your current working directory is
|
|
||||||
* named 'dataset' then mount(8) will prepend your current working
|
|
||||||
* directory to the dataset. There is no way to prevent this
|
|
||||||
* behavior so we simply check for it and strip the prepended
|
|
||||||
* patch when it is added.
|
|
||||||
*/
|
*/
|
||||||
char cwd[PATH_MAX];
|
char cwd[PATH_MAX];
|
||||||
if (getcwd(cwd, PATH_MAX) != NULL) {
|
if (getcwd(cwd, PATH_MAX) == NULL) {
|
||||||
int len = strlen(cwd);
|
perror("getcwd");
|
||||||
/* Do not add one when cwd already ends in a trailing '/' */
|
return;
|
||||||
if (strncmp(cwd, target, len) == 0)
|
|
||||||
target += len + (cwd[len-1] != '/');
|
|
||||||
}
|
}
|
||||||
|
int len = strlen(cwd);
|
||||||
|
if (strncmp(cwd, target, len) == 0)
|
||||||
|
target += len;
|
||||||
|
|
||||||
|
/* Assume pool/dataset is more likely */
|
||||||
strlcpy(*dataset, target, PATH_MAX);
|
strlcpy(*dataset, target, PATH_MAX);
|
||||||
|
|
||||||
|
int fd = open(target, O_RDONLY | O_CLOEXEC);
|
||||||
|
if (fd < 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
nvlist_t *cfg = NULL;
|
||||||
|
if (zpool_read_label(fd, &cfg, NULL) == 0) {
|
||||||
|
char *nm = NULL;
|
||||||
|
if (!nvlist_lookup_string(cfg, ZPOOL_CONFIG_POOL_NAME, &nm))
|
||||||
|
strlcpy(*dataset, nm, PATH_MAX);
|
||||||
|
nvlist_free(cfg);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (close(fd))
|
||||||
|
perror("close");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -133,8 +125,8 @@ mtab_update(char *dataset, char *mntpoint, char *type, char *mntopts)
|
|||||||
if (!fp) {
|
if (!fp) {
|
||||||
(void) fprintf(stderr, gettext(
|
(void) fprintf(stderr, gettext(
|
||||||
"filesystem '%s' was mounted, but /etc/mtab "
|
"filesystem '%s' was mounted, but /etc/mtab "
|
||||||
"could not be opened due to error %d\n"),
|
"could not be opened due to error: %s\n"),
|
||||||
dataset, errno);
|
dataset, strerror(errno));
|
||||||
return (MOUNT_FILEIO);
|
return (MOUNT_FILEIO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,8 +134,8 @@ mtab_update(char *dataset, char *mntpoint, char *type, char *mntopts)
|
|||||||
if (error) {
|
if (error) {
|
||||||
(void) fprintf(stderr, gettext(
|
(void) fprintf(stderr, gettext(
|
||||||
"filesystem '%s' was mounted, but /etc/mtab "
|
"filesystem '%s' was mounted, but /etc/mtab "
|
||||||
"could not be updated due to error %d\n"),
|
"could not be updated due to error: %s\n"),
|
||||||
dataset, errno);
|
dataset, strerror(errno));
|
||||||
return (MOUNT_FILEIO);
|
return (MOUNT_FILEIO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -223,8 +215,8 @@ main(int argc, char **argv)
|
|||||||
/* canonicalize the mount point */
|
/* canonicalize the mount point */
|
||||||
if (realpath(argv[1], mntpoint) == NULL) {
|
if (realpath(argv[1], mntpoint) == NULL) {
|
||||||
(void) fprintf(stderr, gettext("filesystem '%s' cannot be "
|
(void) fprintf(stderr, gettext("filesystem '%s' cannot be "
|
||||||
"mounted at '%s' due to canonicalization error %d.\n"),
|
"mounted at '%s' due to canonicalization error: %s\n"),
|
||||||
dataset, argv[1], errno);
|
dataset, argv[1], strerror(errno));
|
||||||
return (MOUNT_SYSERR);
|
return (MOUNT_SYSERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -545,6 +545,7 @@ while getopts 'c:d:eg:mp:h' OPTION; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [ ! -r $CONFIG ] ; then
|
if [ ! -r $CONFIG ] ; then
|
||||||
|
echo "Error: Config file \"$CONFIG\" not found"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
+15
-2
@@ -6756,6 +6756,7 @@ import_checkpointed_state(char *target, nvlist_t *cfg, char **new_path)
|
|||||||
{
|
{
|
||||||
int error = 0;
|
int error = 0;
|
||||||
char *poolname, *bogus_name = NULL;
|
char *poolname, *bogus_name = NULL;
|
||||||
|
boolean_t freecfg = B_FALSE;
|
||||||
|
|
||||||
/* If the target is not a pool, the extract the pool name */
|
/* If the target is not a pool, the extract the pool name */
|
||||||
char *path_start = strchr(target, '/');
|
char *path_start = strchr(target, '/');
|
||||||
@@ -6774,6 +6775,7 @@ import_checkpointed_state(char *target, nvlist_t *cfg, char **new_path)
|
|||||||
"spa_get_stats() failed with error %d\n",
|
"spa_get_stats() failed with error %d\n",
|
||||||
poolname, error);
|
poolname, error);
|
||||||
}
|
}
|
||||||
|
freecfg = B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (asprintf(&bogus_name, "%s%s", poolname, BOGUS_SUFFIX) == -1)
|
if (asprintf(&bogus_name, "%s%s", poolname, BOGUS_SUFFIX) == -1)
|
||||||
@@ -6783,6 +6785,8 @@ import_checkpointed_state(char *target, nvlist_t *cfg, char **new_path)
|
|||||||
error = spa_import(bogus_name, cfg, NULL,
|
error = spa_import(bogus_name, cfg, NULL,
|
||||||
ZFS_IMPORT_MISSING_LOG | ZFS_IMPORT_CHECKPOINT |
|
ZFS_IMPORT_MISSING_LOG | ZFS_IMPORT_CHECKPOINT |
|
||||||
ZFS_IMPORT_SKIP_MMP);
|
ZFS_IMPORT_SKIP_MMP);
|
||||||
|
if (freecfg)
|
||||||
|
nvlist_free(cfg);
|
||||||
if (error != 0) {
|
if (error != 0) {
|
||||||
fatal("Tried to import pool \"%s\" but spa_import() failed "
|
fatal("Tried to import pool \"%s\" but spa_import() failed "
|
||||||
"with error %d\n", bogus_name, error);
|
"with error %d\n", bogus_name, error);
|
||||||
@@ -7011,7 +7015,6 @@ verify_checkpoint_blocks(spa_t *spa)
|
|||||||
|
|
||||||
spa_t *checkpoint_spa;
|
spa_t *checkpoint_spa;
|
||||||
char *checkpoint_pool;
|
char *checkpoint_pool;
|
||||||
nvlist_t *config = NULL;
|
|
||||||
int error = 0;
|
int error = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -7019,7 +7022,7 @@ verify_checkpoint_blocks(spa_t *spa)
|
|||||||
* name) so we can do verification on it against the current state
|
* name) so we can do verification on it against the current state
|
||||||
* of the pool.
|
* of the pool.
|
||||||
*/
|
*/
|
||||||
checkpoint_pool = import_checkpointed_state(spa->spa_name, config,
|
checkpoint_pool = import_checkpointed_state(spa->spa_name, NULL,
|
||||||
NULL);
|
NULL);
|
||||||
ASSERT(strcmp(spa->spa_name, checkpoint_pool) != 0);
|
ASSERT(strcmp(spa->spa_name, checkpoint_pool) != 0);
|
||||||
|
|
||||||
@@ -8429,6 +8432,11 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (searchdirs != NULL) {
|
||||||
|
umem_free(searchdirs, nsearch * sizeof (char *));
|
||||||
|
searchdirs = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* import_checkpointed_state makes the assumption that the
|
* import_checkpointed_state makes the assumption that the
|
||||||
* target pool that we pass it is already part of the spa
|
* target pool that we pass it is already part of the spa
|
||||||
@@ -8447,6 +8455,11 @@ main(int argc, char **argv)
|
|||||||
target = checkpoint_target;
|
target = checkpoint_target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cfg != NULL) {
|
||||||
|
nvlist_free(cfg);
|
||||||
|
cfg = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (target_pool != target)
|
if (target_pool != target)
|
||||||
free(target_pool);
|
free(target_pool);
|
||||||
|
|
||||||
|
|||||||
@@ -181,6 +181,8 @@ zfs_agent_post_event(const char *class, const char *subclass, nvlist_t *nvl)
|
|||||||
* from the vdev_disk layer after a hot unplug. Fortunately we do
|
* from the vdev_disk layer after a hot unplug. Fortunately we do
|
||||||
* get an EC_DEV_REMOVE from our disk monitor and it is a suitable
|
* get an EC_DEV_REMOVE from our disk monitor and it is a suitable
|
||||||
* proxy so we remap it here for the benefit of the diagnosis engine.
|
* proxy so we remap it here for the benefit of the diagnosis engine.
|
||||||
|
* Starting in OpenZFS 2.0, we do get FM_RESOURCE_REMOVED from the spa
|
||||||
|
* layer. Processing multiple FM_RESOURCE_REMOVED events is not harmful.
|
||||||
*/
|
*/
|
||||||
if ((strcmp(class, EC_DEV_REMOVE) == 0) &&
|
if ((strcmp(class, EC_DEV_REMOVE) == 0) &&
|
||||||
(strcmp(subclass, ESC_DISK) == 0) &&
|
(strcmp(subclass, ESC_DISK) == 0) &&
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ FSLIST="${FSLIST_DIR}/${ZEVENT_POOL}"
|
|||||||
[ -f "${ZED_ZEDLET_DIR}/zed.rc" ] && . "${ZED_ZEDLET_DIR}/zed.rc"
|
[ -f "${ZED_ZEDLET_DIR}/zed.rc" ] && . "${ZED_ZEDLET_DIR}/zed.rc"
|
||||||
. "${ZED_ZEDLET_DIR}/zed-functions.sh"
|
. "${ZED_ZEDLET_DIR}/zed-functions.sh"
|
||||||
|
|
||||||
zed_exit_if_ignoring_this_event
|
[ "$ZEVENT_SUBCLASS" != "history_event" ] && exit 0
|
||||||
zed_check_cmd "${ZFS}" sort diff grep
|
zed_check_cmd "${ZFS}" sort diff grep
|
||||||
|
|
||||||
# If we are acting on a snapshot, we have nothing to do
|
# If we are acting on a snapshot, we have nothing to do
|
||||||
|
|||||||
+1
-1
@@ -8370,7 +8370,7 @@ zfs_do_wait(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
boolean_t enabled[ZFS_WAIT_NUM_ACTIVITIES];
|
boolean_t enabled[ZFS_WAIT_NUM_ACTIVITIES];
|
||||||
int error, i;
|
int error, i;
|
||||||
char c;
|
int c;
|
||||||
|
|
||||||
/* By default, wait for all types of activity. */
|
/* By default, wait for all types of activity. */
|
||||||
for (i = 0; i < ZFS_WAIT_NUM_ACTIVITIES; i++)
|
for (i = 0; i < ZFS_WAIT_NUM_ACTIVITIES; i++)
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ int
|
|||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
boolean_t verbose = B_FALSE;
|
boolean_t verbose = B_FALSE;
|
||||||
char c;
|
int c;
|
||||||
while ((c = getopt(argc, argv, "v")) != -1) {
|
while ((c = getopt(argc, argv, "v")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'v':
|
case 'v':
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
include $(top_srcdir)/config/Rules.am
|
include $(top_srcdir)/config/Rules.am
|
||||||
|
|
||||||
bin_PROGRAMS = zgenhostid
|
sbin_PROGRAMS = zgenhostid
|
||||||
|
|
||||||
zgenhostid_SOURCES = zgenhostid.c
|
zgenhostid_SOURCES = zgenhostid.c
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ zhack_import(char *target, boolean_t readonly)
|
|||||||
zfeature_checks_disable = B_TRUE;
|
zfeature_checks_disable = B_TRUE;
|
||||||
error = spa_import(target, config, props,
|
error = spa_import(target, config, props,
|
||||||
(readonly ? ZFS_IMPORT_SKIP_MMP : ZFS_IMPORT_NORMAL));
|
(readonly ? ZFS_IMPORT_SKIP_MMP : ZFS_IMPORT_NORMAL));
|
||||||
|
fnvlist_free(config);
|
||||||
zfeature_checks_disable = B_FALSE;
|
zfeature_checks_disable = B_FALSE;
|
||||||
if (error == EEXIST)
|
if (error == EEXIST)
|
||||||
error = 0;
|
error = 0;
|
||||||
|
|||||||
+91
-7
@@ -669,9 +669,16 @@ print_vdev_tree(zpool_handle_t *zhp, const char *name, nvlist_t *nv, int indent,
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (c = 0; c < children; c++) {
|
for (c = 0; c < children; c++) {
|
||||||
uint64_t is_log = B_FALSE;
|
uint64_t is_log = B_FALSE, is_hole = B_FALSE;
|
||||||
char *class = "";
|
char *class = "";
|
||||||
|
|
||||||
|
(void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_HOLE,
|
||||||
|
&is_hole);
|
||||||
|
|
||||||
|
if (is_hole == B_TRUE) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
(void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_LOG,
|
(void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_LOG,
|
||||||
&is_log);
|
&is_log);
|
||||||
if (is_log)
|
if (is_log)
|
||||||
@@ -692,6 +699,54 @@ print_vdev_tree(zpool_handle_t *zhp, const char *name, nvlist_t *nv, int indent,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Print the list of l2cache devices for dry runs.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
print_cache_list(nvlist_t *nv, int indent)
|
||||||
|
{
|
||||||
|
nvlist_t **child;
|
||||||
|
uint_t c, children;
|
||||||
|
|
||||||
|
if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_L2CACHE,
|
||||||
|
&child, &children) == 0 && children > 0) {
|
||||||
|
(void) printf("\t%*s%s\n", indent, "", "cache");
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (c = 0; c < children; c++) {
|
||||||
|
char *vname;
|
||||||
|
|
||||||
|
vname = zpool_vdev_name(g_zfs, NULL, child[c], 0);
|
||||||
|
(void) printf("\t%*s%s\n", indent + 2, "", vname);
|
||||||
|
free(vname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Print the list of spares for dry runs.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
print_spare_list(nvlist_t *nv, int indent)
|
||||||
|
{
|
||||||
|
nvlist_t **child;
|
||||||
|
uint_t c, children;
|
||||||
|
|
||||||
|
if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_SPARES,
|
||||||
|
&child, &children) == 0 && children > 0) {
|
||||||
|
(void) printf("\t%*s%s\n", indent, "", "spares");
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (c = 0; c < children; c++) {
|
||||||
|
char *vname;
|
||||||
|
|
||||||
|
vname = zpool_vdev_name(g_zfs, NULL, child[c], 0);
|
||||||
|
(void) printf("\t%*s%s\n", indent + 2, "", vname);
|
||||||
|
free(vname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static boolean_t
|
static boolean_t
|
||||||
prop_list_contains_feature(nvlist_t *proplist)
|
prop_list_contains_feature(nvlist_t *proplist)
|
||||||
{
|
{
|
||||||
@@ -921,16 +976,16 @@ zpool_do_add(int argc, char **argv)
|
|||||||
|
|
||||||
if (dryrun) {
|
if (dryrun) {
|
||||||
nvlist_t *poolnvroot;
|
nvlist_t *poolnvroot;
|
||||||
nvlist_t **l2child;
|
nvlist_t **l2child, **sparechild;
|
||||||
uint_t l2children, c;
|
uint_t l2children, sparechildren, c;
|
||||||
char *vname;
|
char *vname;
|
||||||
boolean_t hadcache = B_FALSE;
|
boolean_t hadcache = B_FALSE, hadspare = B_FALSE;
|
||||||
|
|
||||||
verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
|
verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
|
||||||
&poolnvroot) == 0);
|
&poolnvroot) == 0);
|
||||||
|
|
||||||
(void) printf(gettext("would update '%s' to the following "
|
(void) printf(gettext("would update '%s' to the following "
|
||||||
"configuration:\n"), zpool_get_name(zhp));
|
"configuration:\n\n"), zpool_get_name(zhp));
|
||||||
|
|
||||||
/* print original main pool and new tree */
|
/* print original main pool and new tree */
|
||||||
print_vdev_tree(zhp, poolname, poolnvroot, 0, "",
|
print_vdev_tree(zhp, poolname, poolnvroot, 0, "",
|
||||||
@@ -991,6 +1046,29 @@ zpool_do_add(int argc, char **argv)
|
|||||||
free(vname);
|
free(vname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* And finaly the spares */
|
||||||
|
if (nvlist_lookup_nvlist_array(poolnvroot, ZPOOL_CONFIG_SPARES,
|
||||||
|
&sparechild, &sparechildren) == 0 && sparechildren > 0) {
|
||||||
|
hadspare = B_TRUE;
|
||||||
|
(void) printf(gettext("\tspares\n"));
|
||||||
|
for (c = 0; c < sparechildren; c++) {
|
||||||
|
vname = zpool_vdev_name(g_zfs, NULL,
|
||||||
|
sparechild[c], name_flags);
|
||||||
|
(void) printf("\t %s\n", vname);
|
||||||
|
free(vname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_SPARES,
|
||||||
|
&sparechild, &sparechildren) == 0 && sparechildren > 0) {
|
||||||
|
if (!hadspare)
|
||||||
|
(void) printf(gettext("\tspares\n"));
|
||||||
|
for (c = 0; c < sparechildren; c++) {
|
||||||
|
vname = zpool_vdev_name(g_zfs, NULL,
|
||||||
|
sparechild[c], name_flags);
|
||||||
|
(void) printf("\t %s\n", vname);
|
||||||
|
free(vname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
} else {
|
} else {
|
||||||
@@ -1548,6 +1626,8 @@ zpool_do_create(int argc, char **argv)
|
|||||||
VDEV_ALLOC_BIAS_SPECIAL, 0);
|
VDEV_ALLOC_BIAS_SPECIAL, 0);
|
||||||
print_vdev_tree(NULL, "logs", nvroot, 0,
|
print_vdev_tree(NULL, "logs", nvroot, 0,
|
||||||
VDEV_ALLOC_BIAS_LOG, 0);
|
VDEV_ALLOC_BIAS_LOG, 0);
|
||||||
|
print_cache_list(nvroot, 0);
|
||||||
|
print_spare_list(nvroot, 0);
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
} else {
|
} else {
|
||||||
@@ -6515,6 +6595,10 @@ zpool_do_split(int argc, char **argv)
|
|||||||
"following layout:\n\n"), newpool);
|
"following layout:\n\n"), newpool);
|
||||||
print_vdev_tree(NULL, newpool, config, 0, "",
|
print_vdev_tree(NULL, newpool, config, 0, "",
|
||||||
flags.name_flags);
|
flags.name_flags);
|
||||||
|
print_vdev_tree(NULL, "dedup", config, 0,
|
||||||
|
VDEV_ALLOC_BIAS_DEDUP, 0);
|
||||||
|
print_vdev_tree(NULL, "special", config, 0,
|
||||||
|
VDEV_ALLOC_BIAS_SPECIAL, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7595,7 +7679,7 @@ print_removal_status(zpool_handle_t *zhp, pool_removal_stat_t *prs)
|
|||||||
vdev_name = zpool_vdev_name(g_zfs, zhp,
|
vdev_name = zpool_vdev_name(g_zfs, zhp,
|
||||||
child[prs->prs_removing_vdev], B_TRUE);
|
child[prs->prs_removing_vdev], B_TRUE);
|
||||||
|
|
||||||
(void) printf(gettext("remove: "));
|
printf_color(ANSI_BOLD, gettext("remove: "));
|
||||||
|
|
||||||
start = prs->prs_start_time;
|
start = prs->prs_start_time;
|
||||||
end = prs->prs_end_time;
|
end = prs->prs_end_time;
|
||||||
@@ -10062,7 +10146,7 @@ int
|
|||||||
zpool_do_wait(int argc, char **argv)
|
zpool_do_wait(int argc, char **argv)
|
||||||
{
|
{
|
||||||
boolean_t verbose = B_FALSE;
|
boolean_t verbose = B_FALSE;
|
||||||
char c;
|
int c;
|
||||||
char *value;
|
char *value;
|
||||||
int i;
|
int i;
|
||||||
unsigned long count;
|
unsigned long count;
|
||||||
|
|||||||
@@ -421,7 +421,7 @@ int
|
|||||||
zstream_do_redup(int argc, char *argv[])
|
zstream_do_redup(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
boolean_t verbose = B_FALSE;
|
boolean_t verbose = B_FALSE;
|
||||||
char c;
|
int c;
|
||||||
|
|
||||||
while ((c = getopt(argc, argv, "v")) != -1) {
|
while ((c = getopt(argc, argv, "v")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
|
|||||||
+7
-3
@@ -1332,7 +1332,11 @@ ztest_dmu_objset_own(const char *name, dmu_objset_type_t type,
|
|||||||
VERIFY0(dsl_crypto_params_create_nvlist(DCP_CMD_NONE, NULL,
|
VERIFY0(dsl_crypto_params_create_nvlist(DCP_CMD_NONE, NULL,
|
||||||
crypto_args, &dcp));
|
crypto_args, &dcp));
|
||||||
err = spa_keystore_load_wkey(ddname, dcp, B_FALSE);
|
err = spa_keystore_load_wkey(ddname, dcp, B_FALSE);
|
||||||
dsl_crypto_params_free(dcp, B_FALSE);
|
/*
|
||||||
|
* Note: if there was an error loading, the wkey was not
|
||||||
|
* consumed, and needs to be freed.
|
||||||
|
*/
|
||||||
|
dsl_crypto_params_free(dcp, (err != 0));
|
||||||
fnvlist_free(crypto_args);
|
fnvlist_free(crypto_args);
|
||||||
|
|
||||||
if (err == EINVAL) {
|
if (err == EINVAL) {
|
||||||
@@ -3365,8 +3369,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
|
|||||||
*/
|
*/
|
||||||
if (ztest_device_removal_active) {
|
if (ztest_device_removal_active) {
|
||||||
spa_config_exit(spa, SCL_ALL, FTAG);
|
spa_config_exit(spa, SCL_ALL, FTAG);
|
||||||
mutex_exit(&ztest_vdev_lock);
|
goto out;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -7016,6 +7019,7 @@ ztest_import_impl(ztest_shared_t *zs)
|
|||||||
VERIFY0(zpool_find_config(NULL, ztest_opts.zo_pool, &cfg, &args,
|
VERIFY0(zpool_find_config(NULL, ztest_opts.zo_pool, &cfg, &args,
|
||||||
&libzpool_config_ops));
|
&libzpool_config_ops));
|
||||||
VERIFY0(spa_import(ztest_opts.zo_pool, cfg, NULL, flags));
|
VERIFY0(spa_import(ztest_opts.zo_pool, cfg, NULL, flags));
|
||||||
|
fnvlist_free(cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ dnl # set the PYTHON environment variable accordingly.
|
|||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYTHON], [
|
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYTHON], [
|
||||||
AC_ARG_WITH([python],
|
AC_ARG_WITH([python],
|
||||||
AC_HELP_STRING([--with-python[=VERSION]],
|
AS_HELP_STRING([--with-python[=VERSION]],
|
||||||
[default system python version @<:@default=check@:>@]),
|
[default system python version @<:@default=check@:>@]),
|
||||||
[with_python=$withval],
|
[with_python=$withval],
|
||||||
[with_python=check])
|
[with_python=check])
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ dnl # Determines if pyzfs can be built, requires Python 2.7 or later.
|
|||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYZFS], [
|
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_PYZFS], [
|
||||||
AC_ARG_ENABLE([pyzfs],
|
AC_ARG_ENABLE([pyzfs],
|
||||||
AC_HELP_STRING([--enable-pyzfs],
|
AS_HELP_STRING([--enable-pyzfs],
|
||||||
[install libzfs_core python bindings @<:@default=check@:>@]),
|
[install libzfs_core python bindings @<:@default=check@:>@]),
|
||||||
[enable_pyzfs=$enableval],
|
[enable_pyzfs=$enableval],
|
||||||
[enable_pyzfs=check])
|
[enable_pyzfs=check])
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ dnl #
|
|||||||
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_SED], [
|
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_SED], [
|
||||||
AC_REQUIRE([AC_PROG_SED])dnl
|
AC_REQUIRE([AC_PROG_SED])dnl
|
||||||
AC_CACHE_CHECK([for sed --in-place], [ac_cv_inplace], [
|
AC_CACHE_CHECK([for sed --in-place], [ac_cv_inplace], [
|
||||||
tmpfile=$(mktemp conftest.XXX)
|
tmpfile=$(mktemp conftest.XXXXXX)
|
||||||
echo foo >$tmpfile
|
echo foo >$tmpfile
|
||||||
AS_IF([$SED --in-place 's#foo#bar#' $tmpfile 2>/dev/null],
|
AS_IF([$SED --in-place 's#foo#bar#' $tmpfile 2>/dev/null],
|
||||||
[ac_cv_inplace="--in-place"],
|
[ac_cv_inplace="--in-place"],
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ deb-utils: deb-local rpm-utils-initramfs
|
|||||||
## Arguments need to be passed to dh_shlibdeps. Alien provides no mechanism
|
## Arguments need to be passed to dh_shlibdeps. Alien provides no mechanism
|
||||||
## to do this, so we install a shim onto the path which calls the real
|
## to do this, so we install a shim onto the path which calls the real
|
||||||
## dh_shlibdeps with the required arguments.
|
## dh_shlibdeps with the required arguments.
|
||||||
path_prepend=`mktemp -d /tmp/intercept.XXX`; \
|
path_prepend=`mktemp -d /tmp/intercept.XXXXXX`; \
|
||||||
echo "#$(SHELL)" > $${path_prepend}/dh_shlibdeps; \
|
echo "#$(SHELL)" > $${path_prepend}/dh_shlibdeps; \
|
||||||
echo "`which dh_shlibdeps` -- \
|
echo "`which dh_shlibdeps` -- \
|
||||||
-xlibuutil3linux -xlibnvpair3linux -xlibzfs4linux -xlibzpool4linux" \
|
-xlibuutil3linux -xlibnvpair3linux -xlibzfs4linux -xlibzpool4linux" \
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_POSIX_ACL_RELEASE], [
|
|||||||
], [
|
], [
|
||||||
struct posix_acl *tmp = posix_acl_alloc(1, 0);
|
struct posix_acl *tmp = posix_acl_alloc(1, 0);
|
||||||
posix_acl_release(tmp);
|
posix_acl_release(tmp);
|
||||||
], [], [$ZFS_META_LICENSE])
|
], [], [ZFS_META_LICENSE])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_RELEASE], [
|
AC_DEFUN([ZFS_AC_KERNEL_POSIX_ACL_RELEASE], [
|
||||||
@@ -50,7 +50,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_SET_CACHED_ACL_USABLE], [
|
|||||||
struct posix_acl *acl = posix_acl_alloc(1, 0);
|
struct posix_acl *acl = posix_acl_alloc(1, 0);
|
||||||
set_cached_acl(ip, ACL_TYPE_ACCESS, acl);
|
set_cached_acl(ip, ACL_TYPE_ACCESS, acl);
|
||||||
forget_cached_acl(ip, ACL_TYPE_ACCESS);
|
forget_cached_acl(ip, ACL_TYPE_ACCESS);
|
||||||
], [], [$ZFS_META_LICENSE])
|
], [], [ZFS_META_LICENSE])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SET_CACHED_ACL_USABLE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SET_CACHED_ACL_USABLE], [
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BIO_SET_DEV], [
|
|||||||
struct block_device *bdev = NULL;
|
struct block_device *bdev = NULL;
|
||||||
struct bio *bio = NULL;
|
struct bio *bio = NULL;
|
||||||
bio_set_dev(bio, bdev);
|
bio_set_dev(bio, bdev);
|
||||||
], [], [$ZFS_META_LICENSE])
|
], [], [ZFS_META_LICENSE])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV], [
|
AC_DEFUN([ZFS_AC_KERNEL_BIO_SET_DEV], [
|
||||||
@@ -347,7 +347,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKG_TRYGET], [
|
|||||||
struct blkcg_gq blkg __attribute__ ((unused)) = {};
|
struct blkcg_gq blkg __attribute__ ((unused)) = {};
|
||||||
bool rc __attribute__ ((unused));
|
bool rc __attribute__ ((unused));
|
||||||
rc = blkg_tryget(&blkg);
|
rc = blkg_tryget(&blkg);
|
||||||
], [], [$ZFS_META_LICENSE])
|
], [], [ZFS_META_LICENSE])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLKG_TRYGET], [
|
AC_DEFUN([ZFS_AC_KERNEL_BLKG_TRYGET], [
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLUSH], [
|
|||||||
], [
|
], [
|
||||||
struct request_queue *q = NULL;
|
struct request_queue *q = NULL;
|
||||||
(void) blk_queue_flush(q, REQ_FLUSH);
|
(void) blk_queue_flush(q, REQ_FLUSH);
|
||||||
], [$NO_UNUSED_BUT_SET_VARIABLE], [$ZFS_META_LICENSE])
|
], [$NO_UNUSED_BUT_SET_VARIABLE], [ZFS_META_LICENSE])
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([blk_queue_write_cache], [
|
ZFS_LINUX_TEST_SRC([blk_queue_write_cache], [
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
@@ -187,7 +187,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLK_QUEUE_FLUSH], [
|
|||||||
], [
|
], [
|
||||||
struct request_queue *q = NULL;
|
struct request_queue *q = NULL;
|
||||||
blk_queue_write_cache(q, true, true);
|
blk_queue_write_cache(q, true, true);
|
||||||
], [$NO_UNUSED_BUT_SET_VARIABLE], [$ZFS_META_LICENSE])
|
], [$NO_UNUSED_BUT_SET_VARIABLE], [ZFS_META_LICENSE])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLUSH], [
|
AC_DEFUN([ZFS_AC_KERNEL_BLK_QUEUE_FLUSH], [
|
||||||
|
|||||||
+66
-14
@@ -154,42 +154,69 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_INVALIDATE_BDEV], [
|
|||||||
])
|
])
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 2.6.27, lookup_bdev() was exported.
|
dnl # 5.11 API, lookup_bdev() takes dev_t argument.
|
||||||
dnl # 4.4.0-6.21 - lookup_bdev() takes 2 arguments.
|
dnl # 2.6.27 API, lookup_bdev() was first exported.
|
||||||
|
dnl # 4.4.0-6.21 API, lookup_bdev() on Ubuntu takes mode argument.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_LOOKUP_BDEV], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_LOOKUP_BDEV], [
|
||||||
|
ZFS_LINUX_TEST_SRC([lookup_bdev_devt], [
|
||||||
|
#include <linux/blkdev.h>
|
||||||
|
], [
|
||||||
|
int error __attribute__ ((unused));
|
||||||
|
const char path[] = "/example/path";
|
||||||
|
dev_t dev;
|
||||||
|
|
||||||
|
error = lookup_bdev(path, &dev);
|
||||||
|
])
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([lookup_bdev_1arg], [
|
ZFS_LINUX_TEST_SRC([lookup_bdev_1arg], [
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
], [
|
], [
|
||||||
lookup_bdev(NULL);
|
struct block_device *bdev __attribute__ ((unused));
|
||||||
|
const char path[] = "/example/path";
|
||||||
|
|
||||||
|
bdev = lookup_bdev(path);
|
||||||
])
|
])
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([lookup_bdev_2args], [
|
ZFS_LINUX_TEST_SRC([lookup_bdev_mode], [
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
], [
|
], [
|
||||||
lookup_bdev(NULL, FMODE_READ);
|
struct block_device *bdev __attribute__ ((unused));
|
||||||
|
const char path[] = "/example/path";
|
||||||
|
|
||||||
|
bdev = lookup_bdev(path, FMODE_READ);
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_LOOKUP_BDEV], [
|
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_LOOKUP_BDEV], [
|
||||||
AC_MSG_CHECKING([whether lookup_bdev() wants 1 arg])
|
AC_MSG_CHECKING([whether lookup_bdev() wants dev_t arg])
|
||||||
ZFS_LINUX_TEST_RESULT_SYMBOL([lookup_bdev_1arg],
|
ZFS_LINUX_TEST_RESULT_SYMBOL([lookup_bdev_devt],
|
||||||
[lookup_bdev], [fs/block_dev.c], [
|
[lookup_bdev], [fs/block_dev.c], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_1ARG_LOOKUP_BDEV, 1,
|
AC_DEFINE(HAVE_DEVT_LOOKUP_BDEV, 1,
|
||||||
[lookup_bdev() wants 1 arg])
|
[lookup_bdev() wants dev_t arg])
|
||||||
], [
|
], [
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether lookup_bdev() wants 2 args])
|
AC_MSG_CHECKING([whether lookup_bdev() wants 1 arg])
|
||||||
ZFS_LINUX_TEST_RESULT_SYMBOL([lookup_bdev_2args],
|
ZFS_LINUX_TEST_RESULT_SYMBOL([lookup_bdev_1arg],
|
||||||
[lookup_bdev], [fs/block_dev.c], [
|
[lookup_bdev], [fs/block_dev.c], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_2ARGS_LOOKUP_BDEV, 1,
|
AC_DEFINE(HAVE_1ARG_LOOKUP_BDEV, 1,
|
||||||
[lookup_bdev() wants 2 args])
|
[lookup_bdev() wants 1 arg])
|
||||||
], [
|
], [
|
||||||
ZFS_LINUX_TEST_ERROR([lookup_bdev()])
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether lookup_bdev() wants mode arg])
|
||||||
|
ZFS_LINUX_TEST_RESULT_SYMBOL([lookup_bdev_mode],
|
||||||
|
[lookup_bdev], [fs/block_dev.c], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_MODE_LOOKUP_BDEV, 1,
|
||||||
|
[lookup_bdev() wants mode arg])
|
||||||
|
], [
|
||||||
|
ZFS_LINUX_TEST_ERROR([lookup_bdev()])
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
@@ -244,6 +271,29 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_BDEV_LOGICAL_BLOCK_SIZE], [
|
|||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 5.11 API change
|
||||||
|
dnl # Added bdev_whole() helper.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_WHOLE], [
|
||||||
|
ZFS_LINUX_TEST_SRC([bdev_whole], [
|
||||||
|
#include <linux/blkdev.h>
|
||||||
|
],[
|
||||||
|
struct block_device *bdev = NULL;
|
||||||
|
bdev = bdev_whole(bdev);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_BDEV_WHOLE], [
|
||||||
|
AC_MSG_CHECKING([whether bdev_whole() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([bdev_whole], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_BDEV_WHOLE, 1, [bdev_whole() is available])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV], [
|
||||||
ZFS_AC_KERNEL_SRC_BLKDEV_GET_BY_PATH
|
ZFS_AC_KERNEL_SRC_BLKDEV_GET_BY_PATH
|
||||||
ZFS_AC_KERNEL_SRC_BLKDEV_PUT
|
ZFS_AC_KERNEL_SRC_BLKDEV_PUT
|
||||||
@@ -254,6 +304,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV], [
|
|||||||
ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_PHYSICAL_BLOCK_SIZE
|
ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_PHYSICAL_BLOCK_SIZE
|
||||||
ZFS_AC_KERNEL_SRC_BLKDEV_CHECK_DISK_CHANGE
|
ZFS_AC_KERNEL_SRC_BLKDEV_CHECK_DISK_CHANGE
|
||||||
ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_CHECK_MEDIA_CHANGE
|
ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_CHECK_MEDIA_CHANGE
|
||||||
|
ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_WHOLE
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV], [
|
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV], [
|
||||||
@@ -266,4 +317,5 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV], [
|
|||||||
ZFS_AC_KERNEL_BLKDEV_BDEV_PHYSICAL_BLOCK_SIZE
|
ZFS_AC_KERNEL_BLKDEV_BDEV_PHYSICAL_BLOCK_SIZE
|
||||||
ZFS_AC_KERNEL_BLKDEV_CHECK_DISK_CHANGE
|
ZFS_AC_KERNEL_BLKDEV_CHECK_DISK_CHANGE
|
||||||
ZFS_AC_KERNEL_BLKDEV_BDEV_CHECK_MEDIA_CHANGE
|
ZFS_AC_KERNEL_BLKDEV_BDEV_CHECK_MEDIA_CHANGE
|
||||||
|
ZFS_AC_KERNEL_BLKDEV_BDEV_WHOLE
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_CONFIG_DEBUG_LOCK_ALLOC], [
|
|||||||
mutex_init(&lock);
|
mutex_init(&lock);
|
||||||
mutex_lock(&lock);
|
mutex_lock(&lock);
|
||||||
mutex_unlock(&lock);
|
mutex_unlock(&lock);
|
||||||
], [], [$ZFS_META_LICENSE])
|
], [], [ZFS_META_LICENSE])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_CONFIG_DEBUG_LOCK_ALLOC], [
|
AC_DEFUN([ZFS_AC_KERNEL_CONFIG_DEBUG_LOCK_ALLOC], [
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_FPU], [
|
|||||||
], [
|
], [
|
||||||
kernel_fpu_begin();
|
kernel_fpu_begin();
|
||||||
kernel_fpu_end();
|
kernel_fpu_end();
|
||||||
], [], [$ZFS_META_LICENSE])
|
], [], [ZFS_META_LICENSE])
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([__kernel_fpu], [
|
ZFS_LINUX_TEST_SRC([__kernel_fpu], [
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
@@ -55,7 +55,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_FPU], [
|
|||||||
], [
|
], [
|
||||||
__kernel_fpu_begin();
|
__kernel_fpu_begin();
|
||||||
__kernel_fpu_end();
|
__kernel_fpu_end();
|
||||||
], [], [$ZFS_META_LICENSE])
|
], [], [ZFS_META_LICENSE])
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([fpu_internal], [
|
ZFS_LINUX_TEST_SRC([fpu_internal], [
|
||||||
#if defined(__x86_64) || defined(__x86_64__) || \
|
#if defined(__x86_64) || defined(__x86_64__) || \
|
||||||
|
|||||||
@@ -2,6 +2,16 @@ dnl #
|
|||||||
dnl # Check for generic io accounting interface.
|
dnl # Check for generic io accounting interface.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT], [
|
||||||
|
ZFS_LINUX_TEST_SRC([bio_io_acct], [
|
||||||
|
#include <linux/blkdev.h>
|
||||||
|
], [
|
||||||
|
struct bio *bio = NULL;
|
||||||
|
unsigned long start_time;
|
||||||
|
|
||||||
|
start_time = bio_start_io_acct(bio);
|
||||||
|
bio_end_io_acct(bio, start_time);
|
||||||
|
])
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([generic_acct_3args], [
|
ZFS_LINUX_TEST_SRC([generic_acct_3args], [
|
||||||
#include <linux/bio.h>
|
#include <linux/bio.h>
|
||||||
|
|
||||||
@@ -29,36 +39,49 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_GENERIC_IO_ACCT], [
|
|||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_GENERIC_IO_ACCT], [
|
AC_DEFUN([ZFS_AC_KERNEL_GENERIC_IO_ACCT], [
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 3.19 API addition
|
dnl # 5.7 API,
|
||||||
dnl #
|
dnl #
|
||||||
dnl # torvalds/linux@394ffa50 allows us to increment iostat
|
dnl # Added bio_start_io_acct() and bio_end_io_acct() helpers.
|
||||||
dnl # counters without generic_make_request().
|
|
||||||
dnl #
|
dnl #
|
||||||
AC_MSG_CHECKING([whether generic IO accounting wants 3 args])
|
AC_MSG_CHECKING([whether generic bio_*_io_acct() are available])
|
||||||
ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_3args],
|
ZFS_LINUX_TEST_RESULT([bio_io_acct], [
|
||||||
[generic_start_io_acct], [block/bio.c], [
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_GENERIC_IO_ACCT_3ARG, 1,
|
AC_DEFINE(HAVE_BIO_IO_ACCT, 1, [bio_*_io_acct() available])
|
||||||
[generic_start_io_acct()/generic_end_io_acct() available])
|
|
||||||
], [
|
], [
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # Linux 4.14 API,
|
dnl # 4.14 API,
|
||||||
dnl #
|
dnl #
|
||||||
dnl # generic_start_io_acct/generic_end_io_acct now require
|
dnl # generic_start_io_acct/generic_end_io_acct now require
|
||||||
dnl # request_queue to be provided. No functional changes,
|
dnl # request_queue to be provided. No functional changes,
|
||||||
dnl # but preparation for inflight accounting.
|
dnl # but preparation for inflight accounting.
|
||||||
dnl #
|
dnl #
|
||||||
AC_MSG_CHECKING([whether generic IO accounting wants 4 args])
|
AC_MSG_CHECKING([whether generic_*_io_acct wants 4 args])
|
||||||
ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_4args],
|
ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_4args],
|
||||||
[generic_start_io_acct], [block/bio.c], [
|
[generic_start_io_acct], [block/bio.c], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_GENERIC_IO_ACCT_4ARG, 1,
|
AC_DEFINE(HAVE_GENERIC_IO_ACCT_4ARG, 1,
|
||||||
[generic_start_io_acct()/generic_end_io_acct() ]
|
[generic_*_io_acct() 4 arg available])
|
||||||
[4 arg available])
|
|
||||||
], [
|
], [
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 3.19 API addition
|
||||||
|
dnl #
|
||||||
|
dnl # torvalds/linux@394ffa50 allows us to increment
|
||||||
|
dnl # iostat counters without generic_make_request().
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING(
|
||||||
|
[whether generic_*_io_acct wants 3 args])
|
||||||
|
ZFS_LINUX_TEST_RESULT_SYMBOL([generic_acct_3args],
|
||||||
|
[generic_start_io_acct], [block/bio.c], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_GENERIC_IO_ACCT_3ARG, 1,
|
||||||
|
[generic_*_io_acct() 3 arg available])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
dnl #
|
|
||||||
dnl # 4.16 API change
|
|
||||||
dnl # Verify if get_disk_and_module() symbol is available.
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_GET_DISK_AND_MODULE], [
|
|
||||||
ZFS_LINUX_TEST_SRC([get_disk_and_module], [
|
|
||||||
#include <linux/genhd.h>
|
|
||||||
], [
|
|
||||||
struct gendisk *disk = NULL;
|
|
||||||
(void) get_disk_and_module(disk);
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_GET_DISK_AND_MODULE], [
|
|
||||||
AC_MSG_CHECKING([whether get_disk_and_module() is available])
|
|
||||||
ZFS_LINUX_TEST_RESULT_SYMBOL([get_disk_and_module],
|
|
||||||
[get_disk_and_module], [block/genhd.c], [
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
AC_DEFINE(HAVE_GET_DISK_AND_MODULE,
|
|
||||||
1, [get_disk_and_module() is available])
|
|
||||||
], [
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
])
|
|
||||||
])
|
|
||||||
@@ -27,6 +27,15 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_MAKE_REQUEST_FN], [
|
|||||||
q = blk_alloc_queue(make_request, NUMA_NO_NODE);
|
q = blk_alloc_queue(make_request, NUMA_NO_NODE);
|
||||||
])
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([blk_alloc_queue_request_fn_rh], [
|
||||||
|
#include <linux/blkdev.h>
|
||||||
|
blk_qc_t make_request(struct request_queue *q,
|
||||||
|
struct bio *bio) { return (BLK_QC_T_NONE); }
|
||||||
|
],[
|
||||||
|
struct request_queue *q __attribute__ ((unused));
|
||||||
|
q = blk_alloc_queue_rh(make_request, NUMA_NO_NODE);
|
||||||
|
])
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([block_device_operations_submit_bio], [
|
ZFS_LINUX_TEST_SRC([block_device_operations_submit_bio], [
|
||||||
#include <linux/blkdev.h>
|
#include <linux/blkdev.h>
|
||||||
],[
|
],[
|
||||||
@@ -47,7 +56,9 @@ AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [
|
|||||||
|
|
||||||
AC_DEFINE(HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS, 1,
|
AC_DEFINE(HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS, 1,
|
||||||
[submit_bio is member of struct block_device_operations])
|
[submit_bio is member of struct block_device_operations])
|
||||||
],[
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
dnl # Checked as part of the blk_alloc_queue_request_fn test
|
dnl # Checked as part of the blk_alloc_queue_request_fn test
|
||||||
dnl #
|
dnl #
|
||||||
dnl # Linux 5.7 API Change
|
dnl # Linux 5.7 API Change
|
||||||
@@ -55,6 +66,9 @@ AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [
|
|||||||
dnl #
|
dnl #
|
||||||
AC_MSG_CHECKING([whether blk_alloc_queue() expects request function])
|
AC_MSG_CHECKING([whether blk_alloc_queue() expects request function])
|
||||||
ZFS_LINUX_TEST_RESULT([blk_alloc_queue_request_fn], [
|
ZFS_LINUX_TEST_RESULT([blk_alloc_queue_request_fn], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
|
||||||
|
dnl # This is currently always the case.
|
||||||
AC_MSG_CHECKING([whether make_request_fn() returns blk_qc_t])
|
AC_MSG_CHECKING([whether make_request_fn() returns blk_qc_t])
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
|
|
||||||
@@ -66,34 +80,59 @@ AC_DEFUN([ZFS_AC_KERNEL_MAKE_REQUEST_FN], [
|
|||||||
[Noting that make_request_fn() returns blk_qc_t])
|
[Noting that make_request_fn() returns blk_qc_t])
|
||||||
],[
|
],[
|
||||||
dnl #
|
dnl #
|
||||||
dnl # Linux 3.2 API Change
|
dnl # CentOS Stream 4.18.0-257 API Change
|
||||||
dnl # make_request_fn returns void.
|
dnl # The Linux 5.7 blk_alloc_queue() change was back-
|
||||||
|
dnl # ported and the symbol renamed blk_alloc_queue_rh().
|
||||||
|
dnl # As of this kernel version they're not providing
|
||||||
|
dnl # any compatibility code in the kernel for this.
|
||||||
dnl #
|
dnl #
|
||||||
AC_MSG_CHECKING([whether make_request_fn() returns void])
|
ZFS_LINUX_TEST_RESULT([blk_alloc_queue_request_fn_rh], [
|
||||||
ZFS_LINUX_TEST_RESULT([make_request_fn_void], [
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(MAKE_REQUEST_FN_RET, void,
|
|
||||||
|
dnl # This is currently always the case.
|
||||||
|
AC_MSG_CHECKING([whether make_request_fn_rh() returns blk_qc_t])
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
|
||||||
|
AC_DEFINE(HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH, 1,
|
||||||
|
[blk_alloc_queue_rh() expects request function])
|
||||||
|
AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
|
||||||
[make_request_fn() return type])
|
[make_request_fn() return type])
|
||||||
AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_VOID, 1,
|
AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
|
||||||
[Noting that make_request_fn() returns void])
|
[Noting that make_request_fn() returns blk_qc_t])
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # Linux 4.4 API Change
|
dnl # Linux 3.2 API Change
|
||||||
dnl # make_request_fn returns blk_qc_t.
|
dnl # make_request_fn returns void.
|
||||||
dnl #
|
dnl #
|
||||||
AC_MSG_CHECKING(
|
AC_MSG_CHECKING(
|
||||||
[whether make_request_fn() returns blk_qc_t])
|
[whether make_request_fn() returns void])
|
||||||
ZFS_LINUX_TEST_RESULT([make_request_fn_blk_qc_t], [
|
ZFS_LINUX_TEST_RESULT([make_request_fn_void], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
|
AC_DEFINE(MAKE_REQUEST_FN_RET, void,
|
||||||
[make_request_fn() return type])
|
[make_request_fn() return type])
|
||||||
AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
|
AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_VOID, 1,
|
||||||
[Noting that make_request_fn() ]
|
[Noting that make_request_fn() returns void])
|
||||||
[returns blk_qc_t])
|
|
||||||
],[
|
],[
|
||||||
ZFS_LINUX_TEST_ERROR([make_request_fn])
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # Linux 4.4 API Change
|
||||||
|
dnl # make_request_fn returns blk_qc_t.
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING(
|
||||||
|
[whether make_request_fn() returns blk_qc_t])
|
||||||
|
ZFS_LINUX_TEST_RESULT([make_request_fn_blk_qc_t], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(MAKE_REQUEST_FN_RET, blk_qc_t,
|
||||||
|
[make_request_fn() return type])
|
||||||
|
AC_DEFINE(HAVE_MAKE_REQUEST_FN_RET_QC, 1,
|
||||||
|
[Noting that make_request_fn() ]
|
||||||
|
[returns blk_qc_t])
|
||||||
|
],[
|
||||||
|
ZFS_LINUX_TEST_ERROR([make_request_fn])
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -1,24 +1,46 @@
|
|||||||
dnl #
|
dnl #
|
||||||
|
dnl # 5.11 API change
|
||||||
|
dnl # revalidate_disk_size() has been removed entirely.
|
||||||
|
dnl #
|
||||||
dnl # 5.10 API change
|
dnl # 5.10 API change
|
||||||
dnl # revalidate_disk() was replaced by revalidate_disk_size()
|
dnl # revalidate_disk() was replaced by revalidate_disk_size()
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_REVALIDATE_DISK_SIZE], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_REVALIDATE_DISK], [
|
||||||
|
|
||||||
ZFS_LINUX_TEST_SRC([revalidate_disk_size], [
|
ZFS_LINUX_TEST_SRC([revalidate_disk_size], [
|
||||||
#include <linux/genhd.h>
|
#include <linux/genhd.h>
|
||||||
], [
|
], [
|
||||||
struct gendisk *disk = NULL;
|
struct gendisk *disk = NULL;
|
||||||
(void) revalidate_disk_size(disk, false);
|
(void) revalidate_disk_size(disk, false);
|
||||||
])
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([revalidate_disk], [
|
||||||
|
#include <linux/genhd.h>
|
||||||
|
], [
|
||||||
|
struct gendisk *disk = NULL;
|
||||||
|
(void) revalidate_disk(disk);
|
||||||
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_REVALIDATE_DISK_SIZE], [
|
AC_DEFUN([ZFS_AC_KERNEL_REVALIDATE_DISK], [
|
||||||
|
|
||||||
AC_MSG_CHECKING([whether revalidate_disk_size() is available])
|
AC_MSG_CHECKING([whether revalidate_disk_size() is available])
|
||||||
ZFS_LINUX_TEST_RESULT_SYMBOL([revalidate_disk_size],
|
ZFS_LINUX_TEST_RESULT_SYMBOL([revalidate_disk_size],
|
||||||
[revalidate_disk_size], [block/genhd.c], [
|
[revalidate_disk_size], [block/genhd.c], [
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_REVALIDATE_DISK_SIZE, 1,
|
AC_DEFINE(HAVE_REVALIDATE_DISK_SIZE, 1,
|
||||||
[revalidate_disk_size() is available])
|
[revalidate_disk_size() is available])
|
||||||
], [
|
], [
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether revalidate_disk() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT_SYMBOL([revalidate_disk],
|
||||||
|
[revalidate_disk], [block/genhd.c], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_REVALIDATE_DISK, 1,
|
||||||
|
[revalidate_disk() is available])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -1,29 +1,3 @@
|
|||||||
dnl #
|
|
||||||
dnl # 3.1 API Change
|
|
||||||
dnl #
|
|
||||||
dnl # The rw_semaphore.wait_lock member was changed from spinlock_t to
|
|
||||||
dnl # raw_spinlock_t at commit ddb6c9b58a19edcfac93ac670b066c836ff729f1.
|
|
||||||
dnl #
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_RWSEM_SPINLOCK_IS_RAW], [
|
|
||||||
ZFS_LINUX_TEST_SRC([rwsem_spinlock_is_raw], [
|
|
||||||
#include <linux/rwsem.h>
|
|
||||||
],[
|
|
||||||
struct rw_semaphore dummy_semaphore __attribute__ ((unused));
|
|
||||||
raw_spinlock_t dummy_lock __attribute__ ((unused)) =
|
|
||||||
__RAW_SPIN_LOCK_INITIALIZER(dummy_lock);
|
|
||||||
dummy_semaphore.wait_lock = dummy_lock;
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_RWSEM_SPINLOCK_IS_RAW], [
|
|
||||||
AC_MSG_CHECKING([whether struct rw_semaphore member wait_lock is raw])
|
|
||||||
ZFS_LINUX_TEST_RESULT([rwsem_spinlock_is_raw], [
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
],[
|
|
||||||
ZFS_LINUX_TEST_ERROR([rwsem_spinlock_is_raw])
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 3.16 API Change
|
dnl # 3.16 API Change
|
||||||
dnl #
|
dnl #
|
||||||
@@ -76,13 +50,11 @@ AC_DEFUN([ZFS_AC_KERNEL_RWSEM_ATOMIC_LONG_COUNT], [
|
|||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_RWSEM], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_RWSEM], [
|
||||||
ZFS_AC_KERNEL_SRC_RWSEM_SPINLOCK_IS_RAW
|
|
||||||
ZFS_AC_KERNEL_SRC_RWSEM_ACTIVITY
|
ZFS_AC_KERNEL_SRC_RWSEM_ACTIVITY
|
||||||
ZFS_AC_KERNEL_SRC_RWSEM_ATOMIC_LONG_COUNT
|
ZFS_AC_KERNEL_SRC_RWSEM_ATOMIC_LONG_COUNT
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_RWSEM], [
|
AC_DEFUN([ZFS_AC_KERNEL_RWSEM], [
|
||||||
ZFS_AC_KERNEL_RWSEM_SPINLOCK_IS_RAW
|
|
||||||
ZFS_AC_KERNEL_RWSEM_ACTIVITY
|
ZFS_AC_KERNEL_RWSEM_ACTIVITY
|
||||||
ZFS_AC_KERNEL_RWSEM_ATOMIC_LONG_COUNT
|
ZFS_AC_KERNEL_RWSEM_ATOMIC_LONG_COUNT
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -0,0 +1,206 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # Check for available iov_iter functionality.
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_VFS_IOV_ITER], [
|
||||||
|
ZFS_LINUX_TEST_SRC([iov_iter_types], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/uio.h>
|
||||||
|
],[
|
||||||
|
int type __attribute__ ((unused)) =
|
||||||
|
ITER_IOVEC | ITER_KVEC | ITER_BVEC | ITER_PIPE;
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([iov_iter_init], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/uio.h>
|
||||||
|
],[
|
||||||
|
struct iov_iter iter = { 0 };
|
||||||
|
struct iovec iov;
|
||||||
|
unsigned long nr_segs = 1;
|
||||||
|
size_t count = 1024;
|
||||||
|
|
||||||
|
iov_iter_init(&iter, WRITE, &iov, nr_segs, count);
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([iov_iter_init_legacy], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/uio.h>
|
||||||
|
],[
|
||||||
|
struct iov_iter iter = { 0 };
|
||||||
|
struct iovec iov;
|
||||||
|
unsigned long nr_segs = 1;
|
||||||
|
size_t count = 1024;
|
||||||
|
size_t written = 0;
|
||||||
|
|
||||||
|
iov_iter_init(&iter, &iov, nr_segs, count, written);
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([iov_iter_advance], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/uio.h>
|
||||||
|
],[
|
||||||
|
struct iov_iter iter = { 0 };
|
||||||
|
size_t advance = 512;
|
||||||
|
|
||||||
|
iov_iter_advance(&iter, advance);
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([iov_iter_revert], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/uio.h>
|
||||||
|
],[
|
||||||
|
struct iov_iter iter = { 0 };
|
||||||
|
size_t revert = 512;
|
||||||
|
|
||||||
|
iov_iter_revert(&iter, revert);
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([iov_iter_fault_in_readable], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/uio.h>
|
||||||
|
],[
|
||||||
|
struct iov_iter iter = { 0 };
|
||||||
|
size_t size = 512;
|
||||||
|
int error __attribute__ ((unused));
|
||||||
|
|
||||||
|
error = iov_iter_fault_in_readable(&iter, size);
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([iov_iter_count], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/uio.h>
|
||||||
|
],[
|
||||||
|
struct iov_iter iter = { 0 };
|
||||||
|
size_t bytes __attribute__ ((unused));
|
||||||
|
|
||||||
|
bytes = iov_iter_count(&iter);
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([copy_to_iter], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/uio.h>
|
||||||
|
],[
|
||||||
|
struct iov_iter iter = { 0 };
|
||||||
|
char buf[512] = { 0 };
|
||||||
|
size_t size = 512;
|
||||||
|
size_t bytes __attribute__ ((unused));
|
||||||
|
|
||||||
|
bytes = copy_to_iter((const void *)&buf, size, &iter);
|
||||||
|
])
|
||||||
|
|
||||||
|
ZFS_LINUX_TEST_SRC([copy_from_iter], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/uio.h>
|
||||||
|
],[
|
||||||
|
struct iov_iter iter = { 0 };
|
||||||
|
char buf[512] = { 0 };
|
||||||
|
size_t size = 512;
|
||||||
|
size_t bytes __attribute__ ((unused));
|
||||||
|
|
||||||
|
bytes = copy_from_iter((void *)&buf, size, &iter);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_VFS_IOV_ITER], [
|
||||||
|
enable_vfs_iov_iter="yes"
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether iov_iter types are available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([iov_iter_types], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_IOV_ITER_TYPES, 1,
|
||||||
|
[iov_iter types are available])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
enable_vfs_iov_iter="no"
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 'iov_iter_init' available in Linux 3.16 and newer.
|
||||||
|
dnl # 'iov_iter_init_legacy' available in Linux 3.15 and older.
|
||||||
|
dnl #
|
||||||
|
AC_MSG_CHECKING([whether iov_iter_init() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([iov_iter_init], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_IOV_ITER_INIT, 1,
|
||||||
|
[iov_iter_init() is available])
|
||||||
|
],[
|
||||||
|
ZFS_LINUX_TEST_RESULT([iov_iter_init_legacy], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_IOV_ITER_INIT_LEGACY, 1,
|
||||||
|
[iov_iter_init() is available])
|
||||||
|
],[
|
||||||
|
ZFS_LINUX_TEST_ERROR([iov_iter_init()])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether iov_iter_advance() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([iov_iter_advance], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_IOV_ITER_ADVANCE, 1,
|
||||||
|
[iov_iter_advance() is available])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
enable_vfs_iov_iter="no"
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether iov_iter_revert() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([iov_iter_revert], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_IOV_ITER_REVERT, 1,
|
||||||
|
[iov_iter_revert() is available])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
enable_vfs_iov_iter="no"
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether iov_iter_fault_in_readable() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([iov_iter_fault_in_readable], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_IOV_ITER_FAULT_IN_READABLE, 1,
|
||||||
|
[iov_iter_fault_in_readable() is available])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
enable_vfs_iov_iter="no"
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether iov_iter_count() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([iov_iter_count], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_IOV_ITER_COUNT, 1,
|
||||||
|
[iov_iter_count() is available])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
enable_vfs_iov_iter="no"
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether copy_to_iter() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([copy_to_iter], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_COPY_TO_ITER, 1,
|
||||||
|
[copy_to_iter() is available])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
enable_vfs_iov_iter="no"
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([whether copy_from_iter() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT([copy_from_iter], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_COPY_FROM_ITER, 1,
|
||||||
|
[copy_from_iter() is available])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
enable_vfs_iov_iter="no"
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # As of the 4.9 kernel support is provided for iovecs, kvecs,
|
||||||
|
dnl # bvecs and pipes in the iov_iter structure. As long as the
|
||||||
|
dnl # other support interfaces are all available the iov_iter can
|
||||||
|
dnl # be correctly used in the uio structure.
|
||||||
|
dnl #
|
||||||
|
AS_IF([test "x$enable_vfs_iov_iter" = "xyes"], [
|
||||||
|
AC_DEFINE(HAVE_VFS_IOV_ITER, 1,
|
||||||
|
[All required iov_iter interfaces are available])
|
||||||
|
])
|
||||||
|
])
|
||||||
+28
-21
@@ -61,8 +61,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_BIO
|
ZFS_AC_KERNEL_SRC_BIO
|
||||||
ZFS_AC_KERNEL_SRC_BLKDEV
|
ZFS_AC_KERNEL_SRC_BLKDEV
|
||||||
ZFS_AC_KERNEL_SRC_BLK_QUEUE
|
ZFS_AC_KERNEL_SRC_BLK_QUEUE
|
||||||
ZFS_AC_KERNEL_SRC_GET_DISK_AND_MODULE
|
ZFS_AC_KERNEL_SRC_REVALIDATE_DISK
|
||||||
ZFS_AC_KERNEL_SRC_REVALIDATE_DISK_SIZE
|
|
||||||
ZFS_AC_KERNEL_SRC_GET_DISK_RO
|
ZFS_AC_KERNEL_SRC_GET_DISK_RO
|
||||||
ZFS_AC_KERNEL_SRC_GENERIC_READLINK_GLOBAL
|
ZFS_AC_KERNEL_SRC_GENERIC_READLINK_GLOBAL
|
||||||
ZFS_AC_KERNEL_SRC_DISCARD_GRANULARITY
|
ZFS_AC_KERNEL_SRC_DISCARD_GRANULARITY
|
||||||
@@ -106,6 +105,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
ZFS_AC_KERNEL_SRC_VFS_DIRECT_IO
|
ZFS_AC_KERNEL_SRC_VFS_DIRECT_IO
|
||||||
ZFS_AC_KERNEL_SRC_VFS_RW_ITERATE
|
ZFS_AC_KERNEL_SRC_VFS_RW_ITERATE
|
||||||
ZFS_AC_KERNEL_SRC_VFS_GENERIC_WRITE_CHECKS
|
ZFS_AC_KERNEL_SRC_VFS_GENERIC_WRITE_CHECKS
|
||||||
|
ZFS_AC_KERNEL_SRC_VFS_IOV_ITER
|
||||||
ZFS_AC_KERNEL_SRC_KMAP_ATOMIC_ARGS
|
ZFS_AC_KERNEL_SRC_KMAP_ATOMIC_ARGS
|
||||||
ZFS_AC_KERNEL_SRC_FOLLOW_DOWN_ONE
|
ZFS_AC_KERNEL_SRC_FOLLOW_DOWN_ONE
|
||||||
ZFS_AC_KERNEL_SRC_MAKE_REQUEST_FN
|
ZFS_AC_KERNEL_SRC_MAKE_REQUEST_FN
|
||||||
@@ -158,8 +158,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_BIO
|
ZFS_AC_KERNEL_BIO
|
||||||
ZFS_AC_KERNEL_BLKDEV
|
ZFS_AC_KERNEL_BLKDEV
|
||||||
ZFS_AC_KERNEL_BLK_QUEUE
|
ZFS_AC_KERNEL_BLK_QUEUE
|
||||||
ZFS_AC_KERNEL_GET_DISK_AND_MODULE
|
ZFS_AC_KERNEL_REVALIDATE_DISK
|
||||||
ZFS_AC_KERNEL_REVALIDATE_DISK_SIZE
|
|
||||||
ZFS_AC_KERNEL_GET_DISK_RO
|
ZFS_AC_KERNEL_GET_DISK_RO
|
||||||
ZFS_AC_KERNEL_GENERIC_READLINK_GLOBAL
|
ZFS_AC_KERNEL_GENERIC_READLINK_GLOBAL
|
||||||
ZFS_AC_KERNEL_DISCARD_GRANULARITY
|
ZFS_AC_KERNEL_DISCARD_GRANULARITY
|
||||||
@@ -203,6 +202,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
ZFS_AC_KERNEL_VFS_DIRECT_IO
|
ZFS_AC_KERNEL_VFS_DIRECT_IO
|
||||||
ZFS_AC_KERNEL_VFS_RW_ITERATE
|
ZFS_AC_KERNEL_VFS_RW_ITERATE
|
||||||
ZFS_AC_KERNEL_VFS_GENERIC_WRITE_CHECKS
|
ZFS_AC_KERNEL_VFS_GENERIC_WRITE_CHECKS
|
||||||
|
ZFS_AC_KERNEL_VFS_IOV_ITER
|
||||||
ZFS_AC_KERNEL_KMAP_ATOMIC_ARGS
|
ZFS_AC_KERNEL_KMAP_ATOMIC_ARGS
|
||||||
ZFS_AC_KERNEL_FOLLOW_DOWN_ONE
|
ZFS_AC_KERNEL_FOLLOW_DOWN_ONE
|
||||||
ZFS_AC_KERNEL_MAKE_REQUEST_FN
|
ZFS_AC_KERNEL_MAKE_REQUEST_FN
|
||||||
@@ -320,19 +320,15 @@ AC_DEFUN([ZFS_AC_KERNEL], [
|
|||||||
utsrelease2=$kernelbuild/include/linux/utsrelease.h
|
utsrelease2=$kernelbuild/include/linux/utsrelease.h
|
||||||
utsrelease3=$kernelbuild/include/generated/utsrelease.h
|
utsrelease3=$kernelbuild/include/generated/utsrelease.h
|
||||||
AS_IF([test -r $utsrelease1 && fgrep -q UTS_RELEASE $utsrelease1], [
|
AS_IF([test -r $utsrelease1 && fgrep -q UTS_RELEASE $utsrelease1], [
|
||||||
utsrelease=linux/version.h
|
utsrelease=$utsrelease1
|
||||||
], [test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2], [
|
], [test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2], [
|
||||||
utsrelease=linux/utsrelease.h
|
utsrelease=$utsrelease2
|
||||||
], [test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3], [
|
], [test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3], [
|
||||||
utsrelease=generated/utsrelease.h
|
utsrelease=$utsrelease3
|
||||||
])
|
])
|
||||||
|
|
||||||
AS_IF([test "$utsrelease"], [
|
AS_IF([test -n "$utsrelease"], [
|
||||||
kernsrcver=`(echo "#include <$utsrelease>";
|
kernsrcver=$($AWK '/UTS_RELEASE/ { gsub(/"/, "", $[3]); print $[3] }' $utsrelease)
|
||||||
echo "kernsrcver=UTS_RELEASE") |
|
|
||||||
${CPP} -I $kernelbuild/include - |
|
|
||||||
grep "^kernsrcver=" | cut -d \" -f 2`
|
|
||||||
|
|
||||||
AS_IF([test -z "$kernsrcver"], [
|
AS_IF([test -z "$kernsrcver"], [
|
||||||
AC_MSG_RESULT([Not found])
|
AC_MSG_RESULT([Not found])
|
||||||
AC_MSG_ERROR([
|
AC_MSG_ERROR([
|
||||||
@@ -539,7 +535,9 @@ dnl #
|
|||||||
dnl # ZFS_LINUX_TEST_PROGRAM(C)([PROLOGUE], [BODY])
|
dnl # ZFS_LINUX_TEST_PROGRAM(C)([PROLOGUE], [BODY])
|
||||||
dnl #
|
dnl #
|
||||||
m4_define([ZFS_LINUX_TEST_PROGRAM], [
|
m4_define([ZFS_LINUX_TEST_PROGRAM], [
|
||||||
|
#include <linux/module.h>
|
||||||
$1
|
$1
|
||||||
|
|
||||||
int
|
int
|
||||||
main (void)
|
main (void)
|
||||||
{
|
{
|
||||||
@@ -547,6 +545,11 @@ $2
|
|||||||
;
|
;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MODULE_DESCRIPTION("conftest");
|
||||||
|
MODULE_AUTHOR(ZFS_META_AUTHOR);
|
||||||
|
MODULE_VERSION(ZFS_META_VERSION "-" ZFS_META_RELEASE);
|
||||||
|
MODULE_LICENSE($3);
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
@@ -686,19 +689,21 @@ dnl # $3 - source
|
|||||||
dnl # $4 - extra cflags
|
dnl # $4 - extra cflags
|
||||||
dnl # $5 - check license-compatibility
|
dnl # $5 - check license-compatibility
|
||||||
dnl #
|
dnl #
|
||||||
|
dnl # Check if the test source is buildable at all and then if it is
|
||||||
|
dnl # license compatible.
|
||||||
|
dnl #
|
||||||
dnl # N.B because all of the test cases are compiled in parallel they
|
dnl # N.B because all of the test cases are compiled in parallel they
|
||||||
dnl # must never depend on the results of previous tests. Each test
|
dnl # must never depend on the results of previous tests. Each test
|
||||||
dnl # needs to be entirely independent.
|
dnl # needs to be entirely independent.
|
||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_LINUX_TEST_SRC], [
|
AC_DEFUN([ZFS_LINUX_TEST_SRC], [
|
||||||
ZFS_LINUX_CONFTEST_C([ZFS_LINUX_TEST_PROGRAM([[$2]], [[$3]])], [$1])
|
ZFS_LINUX_CONFTEST_C([ZFS_LINUX_TEST_PROGRAM([[$2]], [[$3]],
|
||||||
|
[["Dual BSD/GPL"]])], [$1])
|
||||||
ZFS_LINUX_CONFTEST_MAKEFILE([$1], [yes], [$4])
|
ZFS_LINUX_CONFTEST_MAKEFILE([$1], [yes], [$4])
|
||||||
|
|
||||||
AS_IF([ test -n "$5" ], [
|
AS_IF([ test -n "$5" ], [
|
||||||
ZFS_LINUX_CONFTEST_C([ZFS_LINUX_TEST_PROGRAM([[
|
ZFS_LINUX_CONFTEST_C([ZFS_LINUX_TEST_PROGRAM(
|
||||||
#include <linux/module.h>
|
[[$2]], [[$3]], [[$5]])], [$1_license])
|
||||||
MODULE_LICENSE("$5");
|
|
||||||
$2]], [[$3]])], [$1_license])
|
|
||||||
ZFS_LINUX_CONFTEST_MAKEFILE([$1_license], [yes], [$4])
|
ZFS_LINUX_CONFTEST_MAKEFILE([$1_license], [yes], [$4])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
@@ -788,11 +793,13 @@ dnl #
|
|||||||
AC_DEFUN([ZFS_LINUX_TRY_COMPILE], [
|
AC_DEFUN([ZFS_LINUX_TRY_COMPILE], [
|
||||||
AS_IF([test "x$enable_linux_builtin" = "xyes"], [
|
AS_IF([test "x$enable_linux_builtin" = "xyes"], [
|
||||||
ZFS_LINUX_COMPILE_IFELSE(
|
ZFS_LINUX_COMPILE_IFELSE(
|
||||||
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]])],
|
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]],
|
||||||
|
[[ZFS_META_LICENSE]])],
|
||||||
[test -f build/conftest/conftest.o], [$3], [$4])
|
[test -f build/conftest/conftest.o], [$3], [$4])
|
||||||
], [
|
], [
|
||||||
ZFS_LINUX_COMPILE_IFELSE(
|
ZFS_LINUX_COMPILE_IFELSE(
|
||||||
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]])],
|
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]],
|
||||||
|
[[ZFS_META_LICENSE]])],
|
||||||
[test -f build/conftest/conftest.ko], [$3], [$4])
|
[test -f build/conftest/conftest.ko], [$3], [$4])
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
@@ -858,7 +865,7 @@ dnl # provided via the fifth parameter
|
|||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_LINUX_TRY_COMPILE_HEADER], [
|
AC_DEFUN([ZFS_LINUX_TRY_COMPILE_HEADER], [
|
||||||
ZFS_LINUX_COMPILE_IFELSE(
|
ZFS_LINUX_COMPILE_IFELSE(
|
||||||
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]])],
|
[ZFS_LINUX_TEST_PROGRAM([[$1]], [[$2]], [[ZFS_META_LICENSE]])],
|
||||||
[test -f build/conftest/conftest.ko],
|
[test -f build/conftest/conftest.ko],
|
||||||
[$3], [$4], [$5])
|
[$3], [$4], [$5])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
AC_DEFUN([ZFS_AC_CONFIG_USER_MOUNT_HELPER], [
|
AC_DEFUN([ZFS_AC_CONFIG_USER_MOUNT_HELPER], [
|
||||||
AC_ARG_WITH(mounthelperdir,
|
AC_ARG_WITH(mounthelperdir,
|
||||||
AC_HELP_STRING([--with-mounthelperdir=DIR],
|
AS_HELP_STRING([--with-mounthelperdir=DIR],
|
||||||
[install mount.zfs in dir [[/sbin]]]),
|
[install mount.zfs in dir [[/sbin]]]),
|
||||||
mounthelperdir=$withval,mounthelperdir=/sbin)
|
mounthelperdir=$withval,mounthelperdir=/sbin)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
AC_DEFUN([ZFS_AC_CONFIG_USER_DRACUT], [
|
AC_DEFUN([ZFS_AC_CONFIG_USER_DRACUT], [
|
||||||
AC_MSG_CHECKING(for dracut directory)
|
AC_MSG_CHECKING(for dracut directory)
|
||||||
AC_ARG_WITH([dracutdir],
|
AC_ARG_WITH([dracutdir],
|
||||||
AC_HELP_STRING([--with-dracutdir=DIR],
|
AS_HELP_STRING([--with-dracutdir=DIR],
|
||||||
[install dracut helpers @<:@default=check@:>@]),
|
[install dracut helpers @<:@default=check@:>@]),
|
||||||
[dracutdir=$withval],
|
[dracutdir=$withval],
|
||||||
[dracutdir=check])
|
[dracutdir=check])
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
AC_DEFUN([ZFS_AC_CONFIG_USER_ZFSEXEC], [
|
AC_DEFUN([ZFS_AC_CONFIG_USER_ZFSEXEC], [
|
||||||
AC_ARG_WITH(zfsexecdir,
|
AC_ARG_WITH(zfsexecdir,
|
||||||
AC_HELP_STRING([--with-zfsexecdir=DIR],
|
AS_HELP_STRING([--with-zfsexecdir=DIR],
|
||||||
[install scripts [[@<:@libexecdir@:>@/zfs]]]),
|
[install scripts [[@<:@libexecdir@:>@/zfs]]]),
|
||||||
[zfsexecdir=$withval],
|
[zfsexecdir=$withval],
|
||||||
[zfsexecdir="${libexecdir}/zfs"])
|
[zfsexecdir="${libexecdir}/zfs"])
|
||||||
|
|||||||
@@ -3,13 +3,12 @@ dnl # glibc 2.25
|
|||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_CONFIG_USER_MAKEDEV_IN_SYSMACROS], [
|
AC_DEFUN([ZFS_AC_CONFIG_USER_MAKEDEV_IN_SYSMACROS], [
|
||||||
AC_MSG_CHECKING([makedev() is declared in sys/sysmacros.h])
|
AC_MSG_CHECKING([makedev() is declared in sys/sysmacros.h])
|
||||||
AC_TRY_COMPILE(
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||||
[
|
|
||||||
#include <sys/sysmacros.h>
|
#include <sys/sysmacros.h>
|
||||||
],[
|
]], [[
|
||||||
int k;
|
int k;
|
||||||
k = makedev(0,0);
|
k = makedev(0,0);
|
||||||
],[
|
]])],[
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_MAKEDEV_IN_SYSMACROS, 1,
|
AC_DEFINE(HAVE_MAKEDEV_IN_SYSMACROS, 1,
|
||||||
[makedev() is declared in sys/sysmacros.h])
|
[makedev() is declared in sys/sysmacros.h])
|
||||||
@@ -23,13 +22,12 @@ dnl # glibc X < Y < 2.25
|
|||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_CONFIG_USER_MAKEDEV_IN_MKDEV], [
|
AC_DEFUN([ZFS_AC_CONFIG_USER_MAKEDEV_IN_MKDEV], [
|
||||||
AC_MSG_CHECKING([makedev() is declared in sys/mkdev.h])
|
AC_MSG_CHECKING([makedev() is declared in sys/mkdev.h])
|
||||||
AC_TRY_COMPILE(
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||||
[
|
|
||||||
#include <sys/mkdev.h>
|
#include <sys/mkdev.h>
|
||||||
],[
|
]], [[
|
||||||
int k;
|
int k;
|
||||||
k = makedev(0,0);
|
k = makedev(0,0);
|
||||||
],[
|
]])],[
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
AC_DEFINE(HAVE_MAKEDEV_IN_MKDEV, 1,
|
AC_DEFINE(HAVE_MAKEDEV_IN_MKDEV, 1,
|
||||||
[makedev() is declared in sys/mkdev.h])
|
[makedev() is declared in sys/mkdev.h])
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
AC_DEFUN([ZFS_AC_CONFIG_USER_SYSTEMD], [
|
AC_DEFUN([ZFS_AC_CONFIG_USER_SYSTEMD], [
|
||||||
AC_ARG_ENABLE(systemd,
|
AC_ARG_ENABLE(systemd,
|
||||||
AC_HELP_STRING([--enable-systemd],
|
AS_HELP_STRING([--enable-systemd],
|
||||||
[install systemd unit/preset files [[default: yes]]]),
|
[install systemd unit/preset files [[default: yes]]]),
|
||||||
[enable_systemd=$enableval],
|
[enable_systemd=$enableval],
|
||||||
[enable_systemd=check])
|
[enable_systemd=check])
|
||||||
|
|
||||||
AC_ARG_WITH(systemdunitdir,
|
AC_ARG_WITH(systemdunitdir,
|
||||||
AC_HELP_STRING([--with-systemdunitdir=DIR],
|
AS_HELP_STRING([--with-systemdunitdir=DIR],
|
||||||
[install systemd unit files in dir [[/usr/lib/systemd/system]]]),
|
[install systemd unit files in dir [[/usr/lib/systemd/system]]]),
|
||||||
systemdunitdir=$withval,systemdunitdir=/usr/lib/systemd/system)
|
systemdunitdir=$withval,systemdunitdir=/usr/lib/systemd/system)
|
||||||
|
|
||||||
AC_ARG_WITH(systemdpresetdir,
|
AC_ARG_WITH(systemdpresetdir,
|
||||||
AC_HELP_STRING([--with-systemdpresetdir=DIR],
|
AS_HELP_STRING([--with-systemdpresetdir=DIR],
|
||||||
[install systemd preset files in dir [[/usr/lib/systemd/system-preset]]]),
|
[install systemd preset files in dir [[/usr/lib/systemd/system-preset]]]),
|
||||||
systemdpresetdir=$withval,systemdpresetdir=/usr/lib/systemd/system-preset)
|
systemdpresetdir=$withval,systemdpresetdir=/usr/lib/systemd/system-preset)
|
||||||
|
|
||||||
AC_ARG_WITH(systemdmodulesloaddir,
|
AC_ARG_WITH(systemdmodulesloaddir,
|
||||||
AC_HELP_STRING([--with-systemdmodulesloaddir=DIR],
|
AS_HELP_STRING([--with-systemdmodulesloaddir=DIR],
|
||||||
[install systemd module load files into dir [[/usr/lib/modules-load.d]]]),
|
[install systemd module load files into dir [[/usr/lib/modules-load.d]]]),
|
||||||
systemdmodulesloaddir=$withval,systemdmodulesloaddir=/usr/lib/modules-load.d)
|
systemdmodulesloaddir=$withval,systemdmodulesloaddir=/usr/lib/modules-load.d)
|
||||||
|
|
||||||
AC_ARG_WITH(systemdgeneratordir,
|
AC_ARG_WITH(systemdgeneratordir,
|
||||||
AC_HELP_STRING([--with-systemdgeneratordir=DIR],
|
AS_HELP_STRING([--with-systemdgeneratordir=DIR],
|
||||||
[install systemd generators in dir [[/usr/lib/systemd/system-generators]]]),
|
[install systemd generators in dir [[/usr/lib/systemd/system-generators]]]),
|
||||||
systemdgeneratordir=$withval,systemdgeneratordir=/usr/lib/systemd/system-generators)
|
systemdgeneratordir=$withval,systemdgeneratordir=/usr/lib/systemd/system-generators)
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
AC_DEFUN([ZFS_AC_CONFIG_USER_SYSVINIT], [
|
AC_DEFUN([ZFS_AC_CONFIG_USER_SYSVINIT], [
|
||||||
AC_ARG_ENABLE(sysvinit,
|
AC_ARG_ENABLE(sysvinit,
|
||||||
AC_HELP_STRING([--enable-sysvinit],
|
AS_HELP_STRING([--enable-sysvinit],
|
||||||
[install SysV init scripts [default: yes]]),
|
[install SysV init scripts [default: yes]]),
|
||||||
[],enable_sysvinit=yes)
|
[],enable_sysvinit=yes)
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
AC_DEFUN([ZFS_AC_CONFIG_USER_UDEV], [
|
AC_DEFUN([ZFS_AC_CONFIG_USER_UDEV], [
|
||||||
AC_MSG_CHECKING(for udev directories)
|
AC_MSG_CHECKING(for udev directories)
|
||||||
AC_ARG_WITH(udevdir,
|
AC_ARG_WITH(udevdir,
|
||||||
AC_HELP_STRING([--with-udevdir=DIR],
|
AS_HELP_STRING([--with-udevdir=DIR],
|
||||||
[install udev helpers @<:@default=check@:>@]),
|
[install udev helpers @<:@default=check@:>@]),
|
||||||
[udevdir=$withval],
|
[udevdir=$withval],
|
||||||
[udevdir=check])
|
[udevdir=check])
|
||||||
@@ -18,7 +18,7 @@ AC_DEFUN([ZFS_AC_CONFIG_USER_UDEV], [
|
|||||||
])
|
])
|
||||||
|
|
||||||
AC_ARG_WITH(udevruledir,
|
AC_ARG_WITH(udevruledir,
|
||||||
AC_HELP_STRING([--with-udevruledir=DIR],
|
AS_HELP_STRING([--with-udevruledir=DIR],
|
||||||
[install udev rules [[UDEVDIR/rules.d]]]),
|
[install udev rules [[UDEVDIR/rules.d]]]),
|
||||||
[udevruledir=$withval],
|
[udevruledir=$withval],
|
||||||
[udevruledir="${udevdir}/rules.d"])
|
[udevruledir="${udevdir}/rules.d"])
|
||||||
|
|||||||
+1
-1
@@ -180,7 +180,7 @@ AC_DEFUN([ZFS_AC_CONFIG], [
|
|||||||
[Config file 'kernel|user|all|srpm']),
|
[Config file 'kernel|user|all|srpm']),
|
||||||
[ZFS_CONFIG="$withval"])
|
[ZFS_CONFIG="$withval"])
|
||||||
AC_ARG_ENABLE([linux-builtin],
|
AC_ARG_ENABLE([linux-builtin],
|
||||||
[AC_HELP_STRING([--enable-linux-builtin],
|
[AS_HELP_STRING([--enable-linux-builtin],
|
||||||
[Configure for builtin in-tree kernel modules @<:@default=no@:>@])],
|
[Configure for builtin in-tree kernel modules @<:@default=no@:>@])],
|
||||||
[],
|
[],
|
||||||
[enable_linux_builtin=no])
|
[enable_linux_builtin=no])
|
||||||
|
|||||||
+2
-2
@@ -36,7 +36,7 @@ AC_LANG(C)
|
|||||||
ZFS_AC_META
|
ZFS_AC_META
|
||||||
AC_CONFIG_AUX_DIR([config])
|
AC_CONFIG_AUX_DIR([config])
|
||||||
AC_CONFIG_MACRO_DIR([config])
|
AC_CONFIG_MACRO_DIR([config])
|
||||||
AC_CANONICAL_SYSTEM
|
AC_CANONICAL_TARGET
|
||||||
AM_MAINTAINER_MODE
|
AM_MAINTAINER_MODE
|
||||||
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||||
AM_INIT_AUTOMAKE([subdir-objects])
|
AM_INIT_AUTOMAKE([subdir-objects])
|
||||||
@@ -45,9 +45,9 @@ AC_CONFIG_HEADERS([zfs_config.h], [
|
|||||||
awk -f ${ac_srcdir}/config/config.awk zfs_config.h.tmp >zfs_config.h &&
|
awk -f ${ac_srcdir}/config/config.awk zfs_config.h.tmp >zfs_config.h &&
|
||||||
rm zfs_config.h.tmp) || exit 1])
|
rm zfs_config.h.tmp) || exit 1])
|
||||||
|
|
||||||
|
LT_INIT
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_PROG_LIBTOOL
|
|
||||||
PKG_PROG_PKG_CONFIG
|
PKG_PROG_PKG_CONFIG
|
||||||
AM_PROG_AS
|
AM_PROG_AS
|
||||||
AM_PROG_CC_C_O
|
AM_PROG_CC_C_O
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ check() {
|
|||||||
[ "${1}" = "-d" ] && return 0
|
[ "${1}" = "-d" ] && return 0
|
||||||
|
|
||||||
# Verify the zfs tool chain
|
# Verify the zfs tool chain
|
||||||
for tool in "@bindir@/zgenhostid" "@sbindir@/zpool" "@sbindir@/zfs" "@mounthelperdir@/mount.zfs" ; do
|
for tool in "@sbindir@/zgenhostid" "@sbindir@/zpool" "@sbindir@/zfs" "@mounthelperdir@/mount.zfs" ; do
|
||||||
test -x "$tool" || return 1
|
test -x "$tool" || return 1
|
||||||
done
|
done
|
||||||
# Verify grep exists
|
# Verify grep exists
|
||||||
@@ -38,7 +38,7 @@ install() {
|
|||||||
inst_rules @udevruledir@/60-zvol.rules
|
inst_rules @udevruledir@/60-zvol.rules
|
||||||
dracut_install hostid
|
dracut_install hostid
|
||||||
dracut_install grep
|
dracut_install grep
|
||||||
dracut_install @bindir@/zgenhostid
|
dracut_install @sbindir@/zgenhostid
|
||||||
dracut_install @sbindir@/zfs
|
dracut_install @sbindir@/zfs
|
||||||
dracut_install @sbindir@/zpool
|
dracut_install @sbindir@/zpool
|
||||||
# Workaround for https://github.com/openzfs/zfs/issues/4749 by
|
# Workaround for https://github.com/openzfs/zfs/issues/4749 by
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ Before=zfs-import.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/bin/sh -c "/bin/systemctl set-environment BOOTFS=$(@sbindir@/zpool list -H -o bootfs | grep -m1 -v '^-$')"
|
ExecStart=/bin/sh -c "systemctl set-environment BOOTFS=$(@sbindir@/zpool list -H -o bootfs | grep -m1 -v '^-$')"
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=zfs-import.target
|
WantedBy=zfs-import.target
|
||||||
|
|||||||
@@ -59,4 +59,12 @@ echo "zfs-generator: writing extension for sysroot.mount to $GENERATOR_DIR"/sysr
|
|||||||
[ -d "$GENERATOR_DIR"/initrd-root-fs.target.requires ] || mkdir -p "$GENERATOR_DIR"/initrd-root-fs.target.requires
|
[ -d "$GENERATOR_DIR"/initrd-root-fs.target.requires ] || mkdir -p "$GENERATOR_DIR"/initrd-root-fs.target.requires
|
||||||
ln -s ../sysroot.mount "$GENERATOR_DIR"/initrd-root-fs.target.requires/sysroot.mount
|
ln -s ../sysroot.mount "$GENERATOR_DIR"/initrd-root-fs.target.requires/sysroot.mount
|
||||||
|
|
||||||
|
|
||||||
|
[ -d "$GENERATOR_DIR"/dracut-pre-mount.service.d ] || mkdir "$GENERATOR_DIR"/dracut-pre-mount.service.d
|
||||||
|
|
||||||
|
{
|
||||||
|
echo "[Unit]"
|
||||||
|
echo "After=zfs-import.target"
|
||||||
|
} > "$GENERATOR_DIR"/dracut-pre-mount.service.d/zfs-enhancement.conf
|
||||||
|
|
||||||
echo "zfs-generator: finished" >> /dev/kmsg
|
echo "zfs-generator: finished" >> /dev/kmsg
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# only run this on systemd systems, we handle the decrypt in mount-zfs.sh in the mount hook otherwise
|
# only run this on systemd systems, we handle the decrypt in mount-zfs.sh in the mount hook otherwise
|
||||||
[ -e /bin/systemctl ] || return 0
|
[ -e /bin/systemctl ] || [ -e /usr/bin/systemctl ] || return 0
|
||||||
|
|
||||||
# This script only gets executed on systemd systems, see mount-zfs.sh for non-systemd systems
|
# This script only gets executed on systemd systems, see mount-zfs.sh for non-systemd systems
|
||||||
|
|
||||||
|
|||||||
@@ -154,8 +154,8 @@ def os_open(name, mode):
|
|||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
def dev_null():
|
def dev_null():
|
||||||
with os_open('/dev/null', os.O_WRONLY) as fd:
|
with tempfile.TemporaryFile(suffix='.zstream') as fd:
|
||||||
yield fd
|
yield fd.fileno()
|
||||||
|
|
||||||
|
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ After=cryptsetup.target
|
|||||||
After=multipathd.target
|
After=multipathd.target
|
||||||
After=systemd-remount-fs.service
|
After=systemd-remount-fs.service
|
||||||
Before=zfs-import.target
|
Before=zfs-import.target
|
||||||
ConditionPathExists=@sysconfdir@/zfs/zpool.cache
|
ConditionFileNotEmpty=@sysconfdir@/zfs/zpool.cache
|
||||||
ConditionPathIsDirectory=/sys/module/zfs
|
ConditionPathIsDirectory=/sys/module/zfs
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ After=systemd-udev-settle.service
|
|||||||
After=cryptsetup.target
|
After=cryptsetup.target
|
||||||
After=multipathd.target
|
After=multipathd.target
|
||||||
Before=zfs-import.target
|
Before=zfs-import.target
|
||||||
ConditionPathExists=!@sysconfdir@/zfs/zpool.cache
|
ConditionFileNotEmpty=!@sysconfdir@/zfs/zpool.cache
|
||||||
ConditionPathIsDirectory=/sys/module/zfs
|
ConditionPathIsDirectory=/sys/module/zfs
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ KERNEL_H = \
|
|||||||
disp.h \
|
disp.h \
|
||||||
dkio.h \
|
dkio.h \
|
||||||
extdirent.h \
|
extdirent.h \
|
||||||
|
fcntl.h \
|
||||||
file.h \
|
file.h \
|
||||||
freebsd_rwlock.h \
|
freebsd_rwlock.h \
|
||||||
inttypes.h \
|
inttypes.h \
|
||||||
|
|||||||
@@ -166,10 +166,6 @@ extern "C" {
|
|||||||
#define ECHRNG ENXIO
|
#define ECHRNG ENXIO
|
||||||
#define ETIME ETIMEDOUT
|
#define ETIME ETIMEDOUT
|
||||||
|
|
||||||
#define O_LARGEFILE 0
|
|
||||||
#define O_RSYNC 0
|
|
||||||
#define O_DSYNC 0
|
|
||||||
|
|
||||||
#ifndef LOCORE
|
#ifndef LOCORE
|
||||||
#ifndef HAVE_RPC_TYPES
|
#ifndef HAVE_RPC_TYPES
|
||||||
typedef int bool_t;
|
typedef int bool_t;
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2021 iXsystems, Inc.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||||
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||||
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
|
* SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _SPL_SYS_FCNTL_H_
|
||||||
|
#define _SPL_SYS_FCNTL_H_
|
||||||
|
|
||||||
|
#include_next <sys/fcntl.h>
|
||||||
|
|
||||||
|
#define O_LARGEFILE 0
|
||||||
|
#define O_RSYNC 0
|
||||||
|
|
||||||
|
#ifndef O_DSYNC
|
||||||
|
#define O_DSYNC 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _SPL_SYS_FCNTL_H_ */
|
||||||
@@ -53,4 +53,7 @@ struct opensolaris_utsname {
|
|||||||
|
|
||||||
extern char hw_serial[11];
|
extern char hw_serial[11];
|
||||||
|
|
||||||
|
#define task_io_account_read(n)
|
||||||
|
#define task_io_account_write(n)
|
||||||
|
|
||||||
#endif /* _OPENSOLARIS_SYS_MISC_H_ */
|
#endif /* _OPENSOLARIS_SYS_MISC_H_ */
|
||||||
|
|||||||
@@ -57,6 +57,8 @@
|
|||||||
#define ZFS_MODULE_PARAM_CALL(scope_prefix, name_prefix, name, func, _, perm, desc) \
|
#define ZFS_MODULE_PARAM_CALL(scope_prefix, name_prefix, name, func, _, perm, desc) \
|
||||||
ZFS_MODULE_PARAM_CALL_IMPL(_vfs_ ## scope_prefix, name, perm, func ## _args(name_prefix ## name), desc)
|
ZFS_MODULE_PARAM_CALL_IMPL(_vfs_ ## scope_prefix, name, perm, func ## _args(name_prefix ## name), desc)
|
||||||
|
|
||||||
|
#define ZFS_MODULE_VIRTUAL_PARAM_CALL ZFS_MODULE_PARAM_CALL
|
||||||
|
|
||||||
#define param_set_arc_long_args(var) \
|
#define param_set_arc_long_args(var) \
|
||||||
CTLTYPE_ULONG, &var, 0, param_set_arc_long, "LU"
|
CTLTYPE_ULONG, &var, 0, param_set_arc_long, "LU"
|
||||||
|
|
||||||
@@ -84,6 +86,9 @@
|
|||||||
#define param_set_max_auto_ashift_args(var) \
|
#define param_set_max_auto_ashift_args(var) \
|
||||||
CTLTYPE_U64, &var, 0, param_set_max_auto_ashift, "QU"
|
CTLTYPE_U64, &var, 0, param_set_max_auto_ashift, "QU"
|
||||||
|
|
||||||
|
#define fletcher_4_param_set_args(var) \
|
||||||
|
CTLTYPE_STRING, NULL, 0, fletcher_4_param, "A"
|
||||||
|
|
||||||
#include <sys/kernel.h>
|
#include <sys/kernel.h>
|
||||||
#define module_init(fn) \
|
#define module_init(fn) \
|
||||||
static void \
|
static void \
|
||||||
@@ -93,6 +98,13 @@ wrap_ ## fn(void *dummy __unused) \
|
|||||||
} \
|
} \
|
||||||
SYSINIT(zfs_ ## fn, SI_SUB_LAST, SI_ORDER_FIRST, wrap_ ## fn, NULL)
|
SYSINIT(zfs_ ## fn, SI_SUB_LAST, SI_ORDER_FIRST, wrap_ ## fn, NULL)
|
||||||
|
|
||||||
|
#define module_init_early(fn) \
|
||||||
|
static void \
|
||||||
|
wrap_ ## fn(void *dummy __unused) \
|
||||||
|
{ \
|
||||||
|
fn(); \
|
||||||
|
} \
|
||||||
|
SYSINIT(zfs_ ## fn, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_FIRST, wrap_ ## fn, NULL)
|
||||||
|
|
||||||
#define module_exit(fn) \
|
#define module_exit(fn) \
|
||||||
static void \
|
static void \
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
#include <sys/vnode.h>
|
#include <sys/vnode.h>
|
||||||
struct mount;
|
struct mount;
|
||||||
struct vattr;
|
struct vattr;
|
||||||
|
struct znode;
|
||||||
|
|
||||||
int secpolicy_nfs(cred_t *cr);
|
int secpolicy_nfs(cred_t *cr);
|
||||||
int secpolicy_zfs(cred_t *crd);
|
int secpolicy_zfs(cred_t *crd);
|
||||||
@@ -57,7 +58,7 @@ int secpolicy_vnode_setattr(cred_t *cr, vnode_t *vp, struct vattr *vap,
|
|||||||
int unlocked_access(void *, int, cred_t *), void *node);
|
int unlocked_access(void *, int, cred_t *), void *node);
|
||||||
int secpolicy_vnode_create_gid(cred_t *cr);
|
int secpolicy_vnode_create_gid(cred_t *cr);
|
||||||
int secpolicy_vnode_setids_setgids(vnode_t *vp, cred_t *cr, gid_t gid);
|
int secpolicy_vnode_setids_setgids(vnode_t *vp, cred_t *cr, gid_t gid);
|
||||||
int secpolicy_vnode_setid_retain(vnode_t *vp, cred_t *cr,
|
int secpolicy_vnode_setid_retain(struct znode *zp, cred_t *cr,
|
||||||
boolean_t issuidroot);
|
boolean_t issuidroot);
|
||||||
void secpolicy_setid_clear(struct vattr *vap, vnode_t *vp, cred_t *cr);
|
void secpolicy_setid_clear(struct vattr *vap, vnode_t *vp, cred_t *cr);
|
||||||
int secpolicy_setid_setsticky_clear(vnode_t *vp, struct vattr *vap,
|
int secpolicy_setid_setsticky_clear(vnode_t *vp, struct vattr *vap,
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ typedef u_int uint_t;
|
|||||||
typedef u_char uchar_t;
|
typedef u_char uchar_t;
|
||||||
typedef u_short ushort_t;
|
typedef u_short ushort_t;
|
||||||
typedef u_long ulong_t;
|
typedef u_long ulong_t;
|
||||||
typedef u_int minor_t;
|
typedef int minor_t;
|
||||||
/* END CSTYLED */
|
/* END CSTYLED */
|
||||||
#ifndef _OFF64_T_DECLARED
|
#ifndef _OFF64_T_DECLARED
|
||||||
#define _OFF64_T_DECLARED
|
#define _OFF64_T_DECLARED
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ void uioskip(uio_t *uiop, size_t n);
|
|||||||
#define uio_iovcnt(uio) (uio)->uio_iovcnt
|
#define uio_iovcnt(uio) (uio)->uio_iovcnt
|
||||||
#define uio_iovlen(uio, idx) (uio)->uio_iov[(idx)].iov_len
|
#define uio_iovlen(uio, idx) (uio)->uio_iov[(idx)].iov_len
|
||||||
#define uio_iovbase(uio, idx) (uio)->uio_iov[(idx)].iov_base
|
#define uio_iovbase(uio, idx) (uio)->uio_iov[(idx)].iov_base
|
||||||
|
#define uio_fault_disable(uio, set)
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
uio_iov_at_index(uio_t *uio, uint_t idx, void **base, uint64_t *len)
|
uio_iov_at_index(uio_t *uio, uint_t idx, void **base, uint64_t *len)
|
||||||
|
|||||||
@@ -127,7 +127,9 @@ vn_is_readonly(vnode_t *vp)
|
|||||||
#define FCREAT O_CREAT
|
#define FCREAT O_CREAT
|
||||||
#define FTRUNC O_TRUNC
|
#define FTRUNC O_TRUNC
|
||||||
#define FEXCL O_EXCL
|
#define FEXCL O_EXCL
|
||||||
|
#ifndef FDSYNC
|
||||||
#define FDSYNC FFSYNC
|
#define FDSYNC FFSYNC
|
||||||
|
#endif
|
||||||
#define FRSYNC FFSYNC
|
#define FRSYNC FFSYNC
|
||||||
#define FSYNC FFSYNC
|
#define FSYNC FFSYNC
|
||||||
#define FOFFMAX 0x00
|
#define FOFFMAX 0x00
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ KERNEL_H = \
|
|||||||
zfs_dir.h \
|
zfs_dir.h \
|
||||||
zfs_ioctl_compat.h \
|
zfs_ioctl_compat.h \
|
||||||
zfs_vfsops_os.h \
|
zfs_vfsops_os.h \
|
||||||
zfs_vnops.h \
|
zfs_vnops_os.h \
|
||||||
zfs_znode_impl.h \
|
zfs_znode_impl.h \
|
||||||
zpl.h
|
zpl.h
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
|
|
||||||
#define cond_resched() kern_yield(PRI_USER)
|
#define cond_resched() kern_yield(PRI_USER)
|
||||||
|
#define uio_prefaultpages(size, uio) (0)
|
||||||
|
|
||||||
#define taskq_create_sysdc(a, b, d, e, p, dc, f) \
|
#define taskq_create_sysdc(a, b, d, e, p, dc, f) \
|
||||||
(taskq_create(a, b, maxclsyspri, d, e, f))
|
(taskq_create(a, b, maxclsyspri, d, e, f))
|
||||||
|
|||||||
@@ -26,8 +26,9 @@
|
|||||||
* $FreeBSD$
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SYS_ZFS_VNOPS_H_
|
#ifndef _SYS_FS_ZFS_VNOPS_OS_H
|
||||||
#define _SYS_ZFS_VNOPS_H_
|
#define _SYS_FS_ZFS_VNOPS_OS_H
|
||||||
|
|
||||||
int dmu_write_pages(objset_t *os, uint64_t object, uint64_t offset,
|
int dmu_write_pages(objset_t *os, uint64_t object, uint64_t offset,
|
||||||
uint64_t size, struct vm_page **ppa, dmu_tx_t *tx);
|
uint64_t size, struct vm_page **ppa, dmu_tx_t *tx);
|
||||||
int dmu_read_pages(objset_t *os, uint64_t object, vm_page_t *ma, int count,
|
int dmu_read_pages(objset_t *os, uint64_t object, vm_page_t *ma, int count,
|
||||||
@@ -39,6 +39,7 @@
|
|||||||
#include <sys/zfs_acl.h>
|
#include <sys/zfs_acl.h>
|
||||||
#include <sys/zil.h>
|
#include <sys/zil.h>
|
||||||
#include <sys/zfs_project.h>
|
#include <sys/zfs_project.h>
|
||||||
|
#include <vm/vm_object.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@@ -113,7 +114,10 @@ extern minor_t zfsdev_minor_alloc(void);
|
|||||||
#define Z_ISBLK(type) ((type) == VBLK)
|
#define Z_ISBLK(type) ((type) == VBLK)
|
||||||
#define Z_ISCHR(type) ((type) == VCHR)
|
#define Z_ISCHR(type) ((type) == VCHR)
|
||||||
#define Z_ISLNK(type) ((type) == VLNK)
|
#define Z_ISLNK(type) ((type) == VLNK)
|
||||||
|
#define Z_ISDIR(type) ((type) == VDIR)
|
||||||
|
|
||||||
|
#define zn_has_cached_data(zp) vn_has_cached_data(ZTOV(zp))
|
||||||
|
#define zn_rlimit_fsize(zp, uio, td) vn_rlimit_fsize(ZTOV(zp), (uio), (td))
|
||||||
|
|
||||||
/* Called on entry to each ZFS vnode and vfs operation */
|
/* Called on entry to each ZFS vnode and vfs operation */
|
||||||
#define ZFS_ENTER(zfsvfs) \
|
#define ZFS_ENTER(zfsvfs) \
|
||||||
@@ -175,7 +179,7 @@ extern int zfsfstype;
|
|||||||
|
|
||||||
extern int zfs_znode_parent_and_name(struct znode *zp, struct znode **dzpp,
|
extern int zfs_znode_parent_and_name(struct znode *zp, struct znode **dzpp,
|
||||||
char *buf);
|
char *buf);
|
||||||
|
extern void zfs_inode_update(struct znode *);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -99,14 +99,6 @@ blk_queue_set_read_ahead(struct request_queue *q, unsigned long ra_pages)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(HAVE_GET_DISK_AND_MODULE)
|
|
||||||
static inline struct kobject *
|
|
||||||
get_disk_and_module(struct gendisk *disk)
|
|
||||||
{
|
|
||||||
return (get_disk(disk));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_BIO_BVEC_ITER
|
#ifdef HAVE_BIO_BVEC_ITER
|
||||||
#define BIO_BI_SECTOR(bio) (bio)->bi_iter.bi_sector
|
#define BIO_BI_SECTOR(bio) (bio)->bi_iter.bi_sector
|
||||||
#define BIO_BI_SIZE(bio) (bio)->bi_iter.bi_size
|
#define BIO_BI_SIZE(bio) (bio)->bi_iter.bi_size
|
||||||
@@ -318,16 +310,38 @@ zfs_check_media_change(struct block_device *bdev)
|
|||||||
*
|
*
|
||||||
* 4.4.0-6.21 API change for Ubuntu
|
* 4.4.0-6.21 API change for Ubuntu
|
||||||
* lookup_bdev() gained a second argument, FMODE_*, to check inode permissions.
|
* lookup_bdev() gained a second argument, FMODE_*, to check inode permissions.
|
||||||
|
*
|
||||||
|
* 5.11 API change
|
||||||
|
* Changed to take a dev_t argument which is set on success and return a
|
||||||
|
* non-zero error code on failure.
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_1ARG_LOOKUP_BDEV
|
static inline int
|
||||||
#define vdev_lookup_bdev(path) lookup_bdev(path)
|
vdev_lookup_bdev(const char *path, dev_t *dev)
|
||||||
#else
|
{
|
||||||
#ifdef HAVE_2ARGS_LOOKUP_BDEV
|
#if defined(HAVE_DEVT_LOOKUP_BDEV)
|
||||||
#define vdev_lookup_bdev(path) lookup_bdev(path, 0)
|
return (lookup_bdev(path, dev));
|
||||||
|
#elif defined(HAVE_1ARG_LOOKUP_BDEV)
|
||||||
|
struct block_device *bdev = lookup_bdev(path);
|
||||||
|
if (IS_ERR(bdev))
|
||||||
|
return (PTR_ERR(bdev));
|
||||||
|
|
||||||
|
*dev = bdev->bd_dev;
|
||||||
|
bdput(bdev);
|
||||||
|
|
||||||
|
return (0);
|
||||||
|
#elif defined(HAVE_MODE_LOOKUP_BDEV)
|
||||||
|
struct block_device *bdev = lookup_bdev(path, FMODE_READ);
|
||||||
|
if (IS_ERR(bdev))
|
||||||
|
return (PTR_ERR(bdev));
|
||||||
|
|
||||||
|
*dev = bdev->bd_dev;
|
||||||
|
bdput(bdev);
|
||||||
|
|
||||||
|
return (0);
|
||||||
#else
|
#else
|
||||||
#error "Unsupported kernel"
|
#error "Unsupported kernel"
|
||||||
#endif /* HAVE_2ARGS_LOOKUP_BDEV */
|
#endif
|
||||||
#endif /* HAVE_1ARG_LOOKUP_BDEV */
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Kernels without bio_set_op_attrs use bi_rw for the bio flags.
|
* Kernels without bio_set_op_attrs use bi_rw for the bio flags.
|
||||||
@@ -501,25 +515,38 @@ blk_queue_discard_secure(struct request_queue *q)
|
|||||||
*/
|
*/
|
||||||
#define VDEV_HOLDER ((void *)0x2401de7)
|
#define VDEV_HOLDER ((void *)0x2401de7)
|
||||||
|
|
||||||
static inline void
|
static inline unsigned long
|
||||||
blk_generic_start_io_acct(struct request_queue *q, int rw,
|
blk_generic_start_io_acct(struct request_queue *q __attribute__((unused)),
|
||||||
unsigned long sectors, struct hd_struct *part)
|
struct gendisk *disk __attribute__((unused)),
|
||||||
|
int rw __attribute__((unused)), struct bio *bio)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_GENERIC_IO_ACCT_3ARG)
|
#if defined(HAVE_BIO_IO_ACCT)
|
||||||
generic_start_io_acct(rw, sectors, part);
|
return (bio_start_io_acct(bio));
|
||||||
|
#elif defined(HAVE_GENERIC_IO_ACCT_3ARG)
|
||||||
|
unsigned long start_time = jiffies;
|
||||||
|
generic_start_io_acct(rw, bio_sectors(bio), &disk->part0);
|
||||||
|
return (start_time);
|
||||||
#elif defined(HAVE_GENERIC_IO_ACCT_4ARG)
|
#elif defined(HAVE_GENERIC_IO_ACCT_4ARG)
|
||||||
generic_start_io_acct(q, rw, sectors, part);
|
unsigned long start_time = jiffies;
|
||||||
|
generic_start_io_acct(q, rw, bio_sectors(bio), &disk->part0);
|
||||||
|
return (start_time);
|
||||||
|
#else
|
||||||
|
/* Unsupported */
|
||||||
|
return (0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
blk_generic_end_io_acct(struct request_queue *q, int rw,
|
blk_generic_end_io_acct(struct request_queue *q __attribute__((unused)),
|
||||||
struct hd_struct *part, unsigned long start_time)
|
struct gendisk *disk __attribute__((unused)),
|
||||||
|
int rw __attribute__((unused)), struct bio *bio, unsigned long start_time)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_GENERIC_IO_ACCT_3ARG)
|
#if defined(HAVE_BIO_IO_ACCT)
|
||||||
generic_end_io_acct(rw, part, start_time);
|
bio_end_io_acct(bio, start_time);
|
||||||
|
#elif defined(HAVE_GENERIC_IO_ACCT_3ARG)
|
||||||
|
generic_end_io_acct(rw, &disk->part0, start_time);
|
||||||
#elif defined(HAVE_GENERIC_IO_ACCT_4ARG)
|
#elif defined(HAVE_GENERIC_IO_ACCT_4ARG)
|
||||||
generic_end_io_acct(q, rw, part, start_time);
|
generic_end_io_acct(q, rw, &disk->part0, start_time);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -529,6 +556,8 @@ blk_generic_alloc_queue(make_request_fn make_request, int node_id)
|
|||||||
{
|
{
|
||||||
#if defined(HAVE_BLK_ALLOC_QUEUE_REQUEST_FN)
|
#if defined(HAVE_BLK_ALLOC_QUEUE_REQUEST_FN)
|
||||||
return (blk_alloc_queue(make_request, node_id));
|
return (blk_alloc_queue(make_request, node_id));
|
||||||
|
#elif defined(HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH)
|
||||||
|
return (blk_alloc_queue_rh(make_request, node_id));
|
||||||
#else
|
#else
|
||||||
struct request_queue *q = blk_alloc_queue(GFP_KERNEL);
|
struct request_queue *q = blk_alloc_queue(GFP_KERNEL);
|
||||||
if (q != NULL)
|
if (q != NULL)
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ enum scope_prefix_types {
|
|||||||
zfs_vdev_cache,
|
zfs_vdev_cache,
|
||||||
zfs_vdev_file,
|
zfs_vdev_file,
|
||||||
zfs_vdev_mirror,
|
zfs_vdev_mirror,
|
||||||
|
zfs_vnops,
|
||||||
zfs_zevent,
|
zfs_zevent,
|
||||||
zfs_zio,
|
zfs_zio,
|
||||||
zfs_zil
|
zfs_zil
|
||||||
@@ -143,6 +144,17 @@ enum scope_prefix_types {
|
|||||||
MODULE_PARM_DESC(name_prefix ## name, desc)
|
MODULE_PARM_DESC(name_prefix ## name, desc)
|
||||||
/* END CSTYLED */
|
/* END CSTYLED */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* As above, but there is no variable with the name name_prefix ## name,
|
||||||
|
* so NULL is passed to module_param_call instead.
|
||||||
|
*/
|
||||||
|
/* BEGIN CSTYLED */
|
||||||
|
#define ZFS_MODULE_VIRTUAL_PARAM_CALL(scope_prefix, name_prefix, name, setfunc, getfunc, perm, desc) \
|
||||||
|
CTASSERT_GLOBAL((sizeof (scope_prefix) == sizeof (enum scope_prefix_types))); \
|
||||||
|
module_param_call(name_prefix ## name, setfunc, getfunc, NULL, perm); \
|
||||||
|
MODULE_PARM_DESC(name_prefix ## name, desc)
|
||||||
|
/* END CSTYLED */
|
||||||
|
|
||||||
#define ZFS_MODULE_PARAM_ARGS const char *buf, zfs_kernel_param_t *kp
|
#define ZFS_MODULE_PARAM_ARGS const char *buf, zfs_kernel_param_t *kp
|
||||||
|
|
||||||
#define ZFS_MODULE_DESCRIPTION(s) MODULE_DESCRIPTION(s)
|
#define ZFS_MODULE_DESCRIPTION(s) MODULE_DESCRIPTION(s)
|
||||||
@@ -150,4 +162,6 @@ enum scope_prefix_types {
|
|||||||
#define ZFS_MODULE_LICENSE(s) MODULE_LICENSE(s)
|
#define ZFS_MODULE_LICENSE(s) MODULE_LICENSE(s)
|
||||||
#define ZFS_MODULE_VERSION(s) MODULE_VERSION(s)
|
#define ZFS_MODULE_VERSION(s) MODULE_VERSION(s)
|
||||||
|
|
||||||
|
#define module_init_early(fn) module_init(fn)
|
||||||
|
|
||||||
#endif /* _MOD_COMPAT_H */
|
#endif /* _MOD_COMPAT_H */
|
||||||
|
|||||||
@@ -44,14 +44,19 @@ typedef enum uio_rw {
|
|||||||
typedef enum uio_seg {
|
typedef enum uio_seg {
|
||||||
UIO_USERSPACE = 0,
|
UIO_USERSPACE = 0,
|
||||||
UIO_SYSSPACE = 1,
|
UIO_SYSSPACE = 1,
|
||||||
UIO_USERISPACE = 2,
|
UIO_BVEC = 2,
|
||||||
UIO_BVEC = 3,
|
#if defined(HAVE_VFS_IOV_ITER)
|
||||||
|
UIO_ITER = 3,
|
||||||
|
#endif
|
||||||
} uio_seg_t;
|
} uio_seg_t;
|
||||||
|
|
||||||
typedef struct uio {
|
typedef struct uio {
|
||||||
union {
|
union {
|
||||||
const struct iovec *uio_iov;
|
const struct iovec *uio_iov;
|
||||||
const struct bio_vec *uio_bvec;
|
const struct bio_vec *uio_bvec;
|
||||||
|
#if defined(HAVE_VFS_IOV_ITER)
|
||||||
|
struct iov_iter *uio_iter;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
int uio_iovcnt;
|
int uio_iovcnt;
|
||||||
offset_t uio_loffset;
|
offset_t uio_loffset;
|
||||||
@@ -59,7 +64,6 @@ typedef struct uio {
|
|||||||
boolean_t uio_fault_disable;
|
boolean_t uio_fault_disable;
|
||||||
uint16_t uio_fmode;
|
uint16_t uio_fmode;
|
||||||
uint16_t uio_extflg;
|
uint16_t uio_extflg;
|
||||||
offset_t uio_limit;
|
|
||||||
ssize_t uio_resid;
|
ssize_t uio_resid;
|
||||||
size_t uio_skip;
|
size_t uio_skip;
|
||||||
} uio_t;
|
} uio_t;
|
||||||
@@ -113,6 +117,7 @@ typedef struct xuio {
|
|||||||
#define uio_iovcnt(uio) (uio)->uio_iovcnt
|
#define uio_iovcnt(uio) (uio)->uio_iovcnt
|
||||||
#define uio_iovlen(uio, idx) (uio)->uio_iov[(idx)].iov_len
|
#define uio_iovlen(uio, idx) (uio)->uio_iov[(idx)].iov_len
|
||||||
#define uio_iovbase(uio, idx) (uio)->uio_iov[(idx)].iov_base
|
#define uio_iovbase(uio, idx) (uio)->uio_iov[(idx)].iov_base
|
||||||
|
#define uio_fault_disable(uio, set) (uio)->uio_fault_disable = set
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
uio_iov_at_index(uio_t *uio, uint_t idx, void **base, uint64_t *len)
|
uio_iov_at_index(uio_t *uio, uint_t idx, void **base, uint64_t *len)
|
||||||
@@ -140,4 +145,65 @@ uio_index_at_offset(uio_t *uio, offset_t off, uint_t *vec_idx)
|
|||||||
return (off);
|
return (off);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
iov_iter_init_compat(struct iov_iter *iter, unsigned int dir,
|
||||||
|
const struct iovec *iov, unsigned long nr_segs, size_t count)
|
||||||
|
{
|
||||||
|
#if defined(HAVE_IOV_ITER_INIT)
|
||||||
|
iov_iter_init(iter, dir, iov, nr_segs, count);
|
||||||
|
#elif defined(HAVE_IOV_ITER_INIT_LEGACY)
|
||||||
|
iov_iter_init(iter, iov, nr_segs, count, 0);
|
||||||
|
#else
|
||||||
|
#error "Unsupported kernel"
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
uio_iovec_init(uio_t *uio, const struct iovec *iov, unsigned long nr_segs,
|
||||||
|
offset_t offset, uio_seg_t seg, ssize_t resid, size_t skip)
|
||||||
|
{
|
||||||
|
ASSERT(seg == UIO_USERSPACE || seg == UIO_SYSSPACE);
|
||||||
|
|
||||||
|
uio->uio_iov = iov;
|
||||||
|
uio->uio_iovcnt = nr_segs;
|
||||||
|
uio->uio_loffset = offset;
|
||||||
|
uio->uio_segflg = seg;
|
||||||
|
uio->uio_fault_disable = B_FALSE;
|
||||||
|
uio->uio_fmode = 0;
|
||||||
|
uio->uio_extflg = 0;
|
||||||
|
uio->uio_resid = resid;
|
||||||
|
uio->uio_skip = skip;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
uio_bvec_init(uio_t *uio, struct bio *bio)
|
||||||
|
{
|
||||||
|
uio->uio_bvec = &bio->bi_io_vec[BIO_BI_IDX(bio)];
|
||||||
|
uio->uio_iovcnt = bio->bi_vcnt - BIO_BI_IDX(bio);
|
||||||
|
uio->uio_loffset = BIO_BI_SECTOR(bio) << 9;
|
||||||
|
uio->uio_segflg = UIO_BVEC;
|
||||||
|
uio->uio_fault_disable = B_FALSE;
|
||||||
|
uio->uio_fmode = 0;
|
||||||
|
uio->uio_extflg = 0;
|
||||||
|
uio->uio_resid = BIO_BI_SIZE(bio);
|
||||||
|
uio->uio_skip = BIO_BI_SKIP(bio);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(HAVE_VFS_IOV_ITER)
|
||||||
|
static inline void
|
||||||
|
uio_iov_iter_init(uio_t *uio, struct iov_iter *iter, offset_t offset,
|
||||||
|
ssize_t resid, size_t skip)
|
||||||
|
{
|
||||||
|
uio->uio_iter = iter;
|
||||||
|
uio->uio_iovcnt = iter->nr_segs;
|
||||||
|
uio->uio_loffset = offset;
|
||||||
|
uio->uio_segflg = UIO_ITER;
|
||||||
|
uio->uio_fault_disable = B_FALSE;
|
||||||
|
uio->uio_fmode = 0;
|
||||||
|
uio->uio_extflg = 0;
|
||||||
|
uio->uio_resid = resid;
|
||||||
|
uio->uio_skip = skip;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* SPL_UIO_H */
|
#endif /* SPL_UIO_H */
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ KERNEL_H = \
|
|||||||
zfs_ctldir.h \
|
zfs_ctldir.h \
|
||||||
zfs_dir.h \
|
zfs_dir.h \
|
||||||
zfs_vfsops_os.h \
|
zfs_vfsops_os.h \
|
||||||
zfs_vnops.h \
|
zfs_vnops_os.h \
|
||||||
zfs_znode_impl.h \
|
zfs_znode_impl.h \
|
||||||
zpl.h
|
zpl.h
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,8 @@
|
|||||||
#include <sys/xvattr.h>
|
#include <sys/xvattr.h>
|
||||||
#include <sys/zpl.h>
|
#include <sys/zpl.h>
|
||||||
|
|
||||||
|
struct znode;
|
||||||
|
|
||||||
int secpolicy_nfs(const cred_t *);
|
int secpolicy_nfs(const cred_t *);
|
||||||
int secpolicy_sys_config(const cred_t *, boolean_t);
|
int secpolicy_sys_config(const cred_t *, boolean_t);
|
||||||
int secpolicy_vnode_access2(const cred_t *, struct inode *,
|
int secpolicy_vnode_access2(const cred_t *, struct inode *,
|
||||||
@@ -44,7 +46,7 @@ int secpolicy_vnode_chown(const cred_t *, uid_t);
|
|||||||
int secpolicy_vnode_create_gid(const cred_t *);
|
int secpolicy_vnode_create_gid(const cred_t *);
|
||||||
int secpolicy_vnode_remove(const cred_t *);
|
int secpolicy_vnode_remove(const cred_t *);
|
||||||
int secpolicy_vnode_setdac(const cred_t *, uid_t);
|
int secpolicy_vnode_setdac(const cred_t *, uid_t);
|
||||||
int secpolicy_vnode_setid_retain(const cred_t *, boolean_t);
|
int secpolicy_vnode_setid_retain(struct znode *, const cred_t *, boolean_t);
|
||||||
int secpolicy_vnode_setids_setgids(const cred_t *, gid_t);
|
int secpolicy_vnode_setids_setgids(const cred_t *, gid_t);
|
||||||
int secpolicy_zinject(const cred_t *);
|
int secpolicy_zinject(const cred_t *);
|
||||||
int secpolicy_zfs(const cred_t *);
|
int secpolicy_zfs(const cred_t *);
|
||||||
|
|||||||
@@ -22,8 +22,8 @@
|
|||||||
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SYS_FS_ZFS_VNOPS_H
|
#ifndef _SYS_FS_ZFS_VNOPS_OS_H
|
||||||
#define _SYS_FS_ZFS_VNOPS_H
|
#define _SYS_FS_ZFS_VNOPS_OS_H
|
||||||
|
|
||||||
#include <sys/vnode.h>
|
#include <sys/vnode.h>
|
||||||
#include <sys/xvattr.h>
|
#include <sys/xvattr.h>
|
||||||
@@ -41,8 +41,6 @@ extern "C" {
|
|||||||
extern int zfs_open(struct inode *ip, int mode, int flag, cred_t *cr);
|
extern int zfs_open(struct inode *ip, int mode, int flag, cred_t *cr);
|
||||||
extern int zfs_close(struct inode *ip, int flag, cred_t *cr);
|
extern int zfs_close(struct inode *ip, int flag, cred_t *cr);
|
||||||
extern int zfs_holey(struct inode *ip, int cmd, loff_t *off);
|
extern int zfs_holey(struct inode *ip, int cmd, loff_t *off);
|
||||||
extern int zfs_read(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr);
|
|
||||||
extern int zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr);
|
|
||||||
extern int zfs_write_simple(znode_t *zp, const void *data, size_t len,
|
extern int zfs_write_simple(znode_t *zp, const void *data, size_t len,
|
||||||
loff_t pos, size_t *resid);
|
loff_t pos, size_t *resid);
|
||||||
extern int zfs_access(struct inode *ip, int mode, int flag, cred_t *cr);
|
extern int zfs_access(struct inode *ip, int mode, int flag, cred_t *cr);
|
||||||
@@ -58,7 +56,6 @@ extern int zfs_mkdir(znode_t *dzp, char *dirname, vattr_t *vap,
|
|||||||
extern int zfs_rmdir(znode_t *dzp, char *name, znode_t *cwd,
|
extern int zfs_rmdir(znode_t *dzp, char *name, znode_t *cwd,
|
||||||
cred_t *cr, int flags);
|
cred_t *cr, int flags);
|
||||||
extern int zfs_readdir(struct inode *ip, zpl_dir_context_t *ctx, cred_t *cr);
|
extern int zfs_readdir(struct inode *ip, zpl_dir_context_t *ctx, cred_t *cr);
|
||||||
extern int zfs_fsync(znode_t *zp, int syncflag, cred_t *cr);
|
|
||||||
extern int zfs_getattr_fast(struct inode *ip, struct kstat *sp);
|
extern int zfs_getattr_fast(struct inode *ip, struct kstat *sp);
|
||||||
extern int zfs_setattr(znode_t *zp, vattr_t *vap, int flag, cred_t *cr);
|
extern int zfs_setattr(znode_t *zp, vattr_t *vap, int flag, cred_t *cr);
|
||||||
extern int zfs_rename(znode_t *sdzp, char *snm, znode_t *tdzp,
|
extern int zfs_rename(znode_t *sdzp, char *snm, znode_t *tdzp,
|
||||||
@@ -72,10 +69,6 @@ extern void zfs_inactive(struct inode *ip);
|
|||||||
extern int zfs_space(znode_t *zp, int cmd, flock64_t *bfp, int flag,
|
extern int zfs_space(znode_t *zp, int cmd, flock64_t *bfp, int flag,
|
||||||
offset_t offset, cred_t *cr);
|
offset_t offset, cred_t *cr);
|
||||||
extern int zfs_fid(struct inode *ip, fid_t *fidp);
|
extern int zfs_fid(struct inode *ip, fid_t *fidp);
|
||||||
extern int zfs_getsecattr(struct inode *ip, vsecattr_t *vsecp, int flag,
|
|
||||||
cred_t *cr);
|
|
||||||
extern int zfs_setsecattr(znode_t *zp, vsecattr_t *vsecp, int flag,
|
|
||||||
cred_t *cr);
|
|
||||||
extern int zfs_getpage(struct inode *ip, struct page *pl[], int nr_pages);
|
extern int zfs_getpage(struct inode *ip, struct page *pl[], int nr_pages);
|
||||||
extern int zfs_putpage(struct inode *ip, struct page *pp,
|
extern int zfs_putpage(struct inode *ip, struct page *pp,
|
||||||
struct writeback_control *wbc);
|
struct writeback_control *wbc);
|
||||||
@@ -68,6 +68,10 @@ extern "C" {
|
|||||||
#define Z_ISCHR(type) S_ISCHR(type)
|
#define Z_ISCHR(type) S_ISCHR(type)
|
||||||
#define Z_ISLNK(type) S_ISLNK(type)
|
#define Z_ISLNK(type) S_ISLNK(type)
|
||||||
#define Z_ISDEV(type) (S_ISCHR(type) || S_ISBLK(type) || S_ISFIFO(type))
|
#define Z_ISDEV(type) (S_ISCHR(type) || S_ISBLK(type) || S_ISFIFO(type))
|
||||||
|
#define Z_ISDIR(type) S_ISDIR(type)
|
||||||
|
|
||||||
|
#define zn_has_cached_data(zp) ((zp)->z_is_mapped)
|
||||||
|
#define zn_rlimit_fsize(zp, uio, td) (0)
|
||||||
|
|
||||||
#define zhold(zp) igrab(ZTOI((zp)))
|
#define zhold(zp) igrab(ZTOI((zp)))
|
||||||
#define zrele(zp) iput(ZTOI((zp)))
|
#define zrele(zp) iput(ZTOI((zp)))
|
||||||
@@ -147,6 +151,8 @@ do { \
|
|||||||
} while (0)
|
} while (0)
|
||||||
#endif /* HAVE_INODE_TIMESPEC64_TIMES */
|
#endif /* HAVE_INODE_TIMESPEC64_TIMES */
|
||||||
|
|
||||||
|
#define ZFS_ACCESSTIME_STAMP(zfsvfs, zp)
|
||||||
|
|
||||||
struct znode;
|
struct znode;
|
||||||
|
|
||||||
extern int zfs_sync(struct super_block *, int, cred_t *);
|
extern int zfs_sync(struct super_block *, int, cred_t *);
|
||||||
|
|||||||
@@ -46,15 +46,6 @@ extern const struct inode_operations zpl_dir_inode_operations;
|
|||||||
extern const struct inode_operations zpl_symlink_inode_operations;
|
extern const struct inode_operations zpl_symlink_inode_operations;
|
||||||
extern const struct inode_operations zpl_special_inode_operations;
|
extern const struct inode_operations zpl_special_inode_operations;
|
||||||
extern dentry_operations_t zpl_dentry_operations;
|
extern dentry_operations_t zpl_dentry_operations;
|
||||||
|
|
||||||
/* zpl_file.c */
|
|
||||||
extern ssize_t zpl_read_common(struct inode *ip, const char *buf,
|
|
||||||
size_t len, loff_t *ppos, uio_seg_t segment, int flags,
|
|
||||||
cred_t *cr);
|
|
||||||
extern ssize_t zpl_write_common(struct inode *ip, const char *buf,
|
|
||||||
size_t len, loff_t *ppos, uio_seg_t segment, int flags,
|
|
||||||
cred_t *cr);
|
|
||||||
|
|
||||||
extern const struct address_space_operations zpl_address_space_operations;
|
extern const struct address_space_operations zpl_address_space_operations;
|
||||||
extern const struct file_operations zpl_file_operations;
|
extern const struct file_operations zpl_file_operations;
|
||||||
extern const struct file_operations zpl_dir_file_operations;
|
extern const struct file_operations zpl_dir_file_operations;
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ COMMON_H = \
|
|||||||
zfs_stat.h \
|
zfs_stat.h \
|
||||||
zfs_sysfs.h \
|
zfs_sysfs.h \
|
||||||
zfs_vfsops.h \
|
zfs_vfsops.h \
|
||||||
|
zfs_vnops.h \
|
||||||
zfs_znode.h \
|
zfs_znode.h \
|
||||||
zil.h \
|
zil.h \
|
||||||
zil_impl.h \
|
zil_impl.h \
|
||||||
|
|||||||
@@ -316,6 +316,7 @@ typedef struct dsl_dataset_snapshot_arg {
|
|||||||
|
|
||||||
/* flags for holding the dataset */
|
/* flags for holding the dataset */
|
||||||
typedef enum ds_hold_flags {
|
typedef enum ds_hold_flags {
|
||||||
|
DS_HOLD_FLAG_NONE = 0 << 0,
|
||||||
DS_HOLD_FLAG_DECRYPT = 1 << 0 /* needs access to encrypted data */
|
DS_HOLD_FLAG_DECRYPT = 1 << 0 /* needs access to encrypted data */
|
||||||
} ds_hold_flags_t;
|
} ds_hold_flags_t;
|
||||||
|
|
||||||
|
|||||||
@@ -377,7 +377,7 @@ struct spa {
|
|||||||
kcondvar_t spa_proc_cv; /* spa_proc_state transitions */
|
kcondvar_t spa_proc_cv; /* spa_proc_state transitions */
|
||||||
spa_proc_state_t spa_proc_state; /* see definition */
|
spa_proc_state_t spa_proc_state; /* see definition */
|
||||||
proc_t *spa_proc; /* "zpool-poolname" process */
|
proc_t *spa_proc; /* "zpool-poolname" process */
|
||||||
uint64_t spa_did; /* if procp != p0, did of t1 */
|
uintptr_t spa_did; /* if procp != p0, did of t1 */
|
||||||
boolean_t spa_autoreplace; /* autoreplace set in open */
|
boolean_t spa_autoreplace; /* autoreplace set in open */
|
||||||
int spa_vdev_locks; /* locks grabbed */
|
int spa_vdev_locks; /* locks grabbed */
|
||||||
uint64_t spa_creation_version; /* version at pool creation */
|
uint64_t spa_creation_version; /* version at pool creation */
|
||||||
|
|||||||
@@ -148,6 +148,9 @@ struct vdev_queue {
|
|||||||
avl_tree_t vq_write_offset_tree;
|
avl_tree_t vq_write_offset_tree;
|
||||||
avl_tree_t vq_trim_offset_tree;
|
avl_tree_t vq_trim_offset_tree;
|
||||||
uint64_t vq_last_offset;
|
uint64_t vq_last_offset;
|
||||||
|
zio_priority_t vq_last_prio; /* Last sent I/O priority. */
|
||||||
|
uint32_t vq_ia_active; /* Active interactive I/Os. */
|
||||||
|
uint32_t vq_nia_credit; /* Non-interactive I/Os credit. */
|
||||||
hrtime_t vq_io_complete_ts; /* time last i/o completed */
|
hrtime_t vq_io_complete_ts; /* time last i/o completed */
|
||||||
hrtime_t vq_io_delta_ts;
|
hrtime_t vq_io_delta_ts;
|
||||||
zio_t vq_io_search; /* used as local for stack reduction */
|
zio_t vq_io_search; /* used as local for stack reduction */
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
/*
|
||||||
|
* 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) 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _SYS_FS_ZFS_VNOPS_H
|
||||||
|
#define _SYS_FS_ZFS_VNOPS_H
|
||||||
|
#include <sys/zfs_vnops_os.h>
|
||||||
|
|
||||||
|
extern int zfs_fsync(znode_t *, int, cred_t *);
|
||||||
|
extern int zfs_read(znode_t *, uio_t *, int, cred_t *);
|
||||||
|
extern int zfs_write(znode_t *, uio_t *, int, cred_t *);
|
||||||
|
extern int zfs_getsecattr(znode_t *zp, vsecattr_t *vsecp, int flag, cred_t *cr);
|
||||||
|
extern int zfs_setsecattr(znode_t *zp, vsecattr_t *vsecp, int flag, cred_t *cr);
|
||||||
|
|
||||||
|
extern int mappedread(znode_t *, int, uio_t *);
|
||||||
|
extern int mappedread_sf(znode_t *, int, uio_t *);
|
||||||
|
extern void update_pages(znode_t *, int64_t, int, objset_t *);
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -1 +1,5 @@
|
|||||||
SUBDIRS = sys
|
SUBDIRS = sys
|
||||||
|
|
||||||
|
libspldir = $(includedir)/libspl
|
||||||
|
libspl_HEADERS = \
|
||||||
|
fcntl.h
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2021 iXsystems, Inc.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||||
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||||
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
|
* SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _LIBSPL_FCNTL_H_
|
||||||
|
#define _LIBSPL_FCNTL_H_
|
||||||
|
|
||||||
|
#include_next <fcntl.h>
|
||||||
|
|
||||||
|
#include <sys/fcntl.h>
|
||||||
|
|
||||||
|
#endif /* _LIBSPL_FCNTL_H_ */
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
libspldir = $(includedir)/libspl/sys
|
libspldir = $(includedir)/libspl/sys
|
||||||
libspl_HEADERS = \
|
libspl_HEADERS = \
|
||||||
byteorder.h \
|
byteorder.h \
|
||||||
|
fcntl.h \
|
||||||
file.h \
|
file.h \
|
||||||
mnttab.h \
|
mnttab.h \
|
||||||
mount.h \
|
mount.h \
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2021 iXsystems, Inc.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||||
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||||
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
|
* SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _LIBSPL_SYS_FCNTL_H_
|
||||||
|
#define _LIBSPL_SYS_FCNTL_H_
|
||||||
|
|
||||||
|
#include_next <sys/fcntl.h>
|
||||||
|
|
||||||
|
#define O_LARGEFILE 0
|
||||||
|
#define O_RSYNC 0
|
||||||
|
|
||||||
|
#ifndef O_DSYNC
|
||||||
|
#define O_DSYNC 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _LIBSPL_SYS_FCNTL_H_ */
|
||||||
@@ -59,7 +59,6 @@ typedef enum uio_rw {
|
|||||||
typedef enum uio_seg {
|
typedef enum uio_seg {
|
||||||
UIO_USERSPACE = 0,
|
UIO_USERSPACE = 0,
|
||||||
UIO_SYSSPACE = 1,
|
UIO_SYSSPACE = 1,
|
||||||
UIO_USERISPACE = 2,
|
|
||||||
} uio_seg_t;
|
} uio_seg_t;
|
||||||
|
|
||||||
#elif defined(__FreeBSD__)
|
#elif defined(__FreeBSD__)
|
||||||
@@ -73,7 +72,6 @@ typedef struct uio {
|
|||||||
uio_seg_t uio_segflg; /* address space (kernel or user) */
|
uio_seg_t uio_segflg; /* address space (kernel or user) */
|
||||||
uint16_t uio_fmode; /* file mode flags */
|
uint16_t uio_fmode; /* file mode flags */
|
||||||
uint16_t uio_extflg; /* extended flags */
|
uint16_t uio_extflg; /* extended flags */
|
||||||
offset_t uio_limit; /* u-limit (maximum byte offset) */
|
|
||||||
ssize_t uio_resid; /* residual count */
|
ssize_t uio_resid; /* residual count */
|
||||||
} uio_t;
|
} uio_t;
|
||||||
|
|
||||||
|
|||||||
@@ -128,6 +128,7 @@ uu_avl_pool_destroy(uu_avl_pool_t *pp)
|
|||||||
pp->uap_next->uap_prev = pp->uap_prev;
|
pp->uap_next->uap_prev = pp->uap_prev;
|
||||||
pp->uap_prev->uap_next = pp->uap_next;
|
pp->uap_prev->uap_next = pp->uap_next;
|
||||||
(void) pthread_mutex_unlock(&uu_apool_list_lock);
|
(void) pthread_mutex_unlock(&uu_apool_list_lock);
|
||||||
|
(void) pthread_mutex_destroy(&pp->uap_lock);
|
||||||
pp->uap_prev = NULL;
|
pp->uap_prev = NULL;
|
||||||
pp->uap_next = NULL;
|
pp->uap_next = NULL;
|
||||||
uu_free(pp);
|
uu_free(pp);
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ KERNEL_C = \
|
|||||||
zfs_fletcher_superscalar4.c \
|
zfs_fletcher_superscalar4.c \
|
||||||
zfs_namecheck.c \
|
zfs_namecheck.c \
|
||||||
zfs_prop.c \
|
zfs_prop.c \
|
||||||
zfs_uio.c \
|
|
||||||
zpool_prop.c \
|
zpool_prop.c \
|
||||||
zprop_common.c
|
zprop_common.c
|
||||||
|
|
||||||
|
|||||||
@@ -3388,7 +3388,7 @@ zpool_vdev_split(zpool_handle_t *zhp, char *newname, nvlist_t **newroot,
|
|||||||
nvlist_t *props, splitflags_t flags)
|
nvlist_t *props, splitflags_t flags)
|
||||||
{
|
{
|
||||||
zfs_cmd_t zc = {"\0"};
|
zfs_cmd_t zc = {"\0"};
|
||||||
char msg[1024];
|
char msg[1024], *bias;
|
||||||
nvlist_t *tree, *config, **child, **newchild, *newconfig = NULL;
|
nvlist_t *tree, *config, **child, **newchild, *newconfig = NULL;
|
||||||
nvlist_t **varray = NULL, *zc_props = NULL;
|
nvlist_t **varray = NULL, *zc_props = NULL;
|
||||||
uint_t c, children, newchildren, lastlog = 0, vcount, found = 0;
|
uint_t c, children, newchildren, lastlog = 0, vcount, found = 0;
|
||||||
@@ -3446,6 +3446,7 @@ zpool_vdev_split(zpool_handle_t *zhp, char *newname, nvlist_t **newroot,
|
|||||||
|
|
||||||
for (c = 0; c < children; c++) {
|
for (c = 0; c < children; c++) {
|
||||||
uint64_t is_log = B_FALSE, is_hole = B_FALSE;
|
uint64_t is_log = B_FALSE, is_hole = B_FALSE;
|
||||||
|
boolean_t is_special = B_FALSE, is_dedup = B_FALSE;
|
||||||
char *type;
|
char *type;
|
||||||
nvlist_t **mchild, *vdev;
|
nvlist_t **mchild, *vdev;
|
||||||
uint_t mchildren;
|
uint_t mchildren;
|
||||||
@@ -3492,6 +3493,13 @@ zpool_vdev_split(zpool_handle_t *zhp, char *newname, nvlist_t **newroot,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nvlist_lookup_string(child[c],
|
||||||
|
ZPOOL_CONFIG_ALLOCATION_BIAS, &bias) == 0) {
|
||||||
|
if (strcmp(bias, VDEV_ALLOC_BIAS_SPECIAL) == 0)
|
||||||
|
is_special = B_TRUE;
|
||||||
|
else if (strcmp(bias, VDEV_ALLOC_BIAS_DEDUP) == 0)
|
||||||
|
is_dedup = B_TRUE;
|
||||||
|
}
|
||||||
verify(nvlist_lookup_nvlist_array(child[c],
|
verify(nvlist_lookup_nvlist_array(child[c],
|
||||||
ZPOOL_CONFIG_CHILDREN, &mchild, &mchildren) == 0);
|
ZPOOL_CONFIG_CHILDREN, &mchild, &mchildren) == 0);
|
||||||
|
|
||||||
@@ -3509,6 +3517,20 @@ zpool_vdev_split(zpool_handle_t *zhp, char *newname, nvlist_t **newroot,
|
|||||||
|
|
||||||
if (nvlist_dup(vdev, &varray[vcount++], 0) != 0)
|
if (nvlist_dup(vdev, &varray[vcount++], 0) != 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
if (flags.dryrun != 0) {
|
||||||
|
if (is_dedup == B_TRUE) {
|
||||||
|
if (nvlist_add_string(varray[vcount - 1],
|
||||||
|
ZPOOL_CONFIG_ALLOCATION_BIAS,
|
||||||
|
VDEV_ALLOC_BIAS_DEDUP) != 0)
|
||||||
|
goto out;
|
||||||
|
} else if (is_special == B_TRUE) {
|
||||||
|
if (nvlist_add_string(varray[vcount - 1],
|
||||||
|
ZPOOL_CONFIG_ALLOCATION_BIAS,
|
||||||
|
VDEV_ALLOC_BIAS_SPECIAL) != 0)
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* did we find every disk the user specified? */
|
/* did we find every disk the user specified? */
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ execvpe(const char *name, char * const argv[], char * const envp[])
|
|||||||
|
|
||||||
#define ERRBUFLEN 256
|
#define ERRBUFLEN 256
|
||||||
|
|
||||||
__thread static char errbuf[ERRBUFLEN];
|
static __thread char errbuf[ERRBUFLEN];
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
libzfs_error_init(int error)
|
libzfs_error_init(int error)
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ KERNEL_C = \
|
|||||||
zfs_fletcher_superscalar4.c \
|
zfs_fletcher_superscalar4.c \
|
||||||
zfs_namecheck.c \
|
zfs_namecheck.c \
|
||||||
zfs_prop.c \
|
zfs_prop.c \
|
||||||
zfs_uio.c \
|
|
||||||
zpool_prop.c \
|
zpool_prop.c \
|
||||||
zprop_common.c \
|
zprop_common.c \
|
||||||
abd.c \
|
abd.c \
|
||||||
|
|||||||
@@ -1539,7 +1539,7 @@ zpool_find_config(void *hdl, const char *target, nvlist_t **configp,
|
|||||||
nvlist_t *pools;
|
nvlist_t *pools;
|
||||||
nvlist_t *match = NULL;
|
nvlist_t *match = NULL;
|
||||||
nvlist_t *config = NULL;
|
nvlist_t *config = NULL;
|
||||||
char *name = NULL, *sepp = NULL;
|
char *sepp = NULL;
|
||||||
char sep = '\0';
|
char sep = '\0';
|
||||||
int count = 0;
|
int count = 0;
|
||||||
char *targetdup = strdup(target);
|
char *targetdup = strdup(target);
|
||||||
@@ -1563,11 +1563,11 @@ zpool_find_config(void *hdl, const char *target, nvlist_t **configp,
|
|||||||
/* multiple matches found */
|
/* multiple matches found */
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
match = config;
|
match = fnvlist_dup(config);
|
||||||
name = nvpair_name(elem);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
fnvlist_free(pools);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
@@ -1577,6 +1577,7 @@ zpool_find_config(void *hdl, const char *target, nvlist_t **configp,
|
|||||||
|
|
||||||
if (count > 1) {
|
if (count > 1) {
|
||||||
free(targetdup);
|
free(targetdup);
|
||||||
|
fnvlist_free(match);
|
||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2011,8 +2011,7 @@ Default value: \fB1\fR.
|
|||||||
.ad
|
.ad
|
||||||
.RS 12n
|
.RS 12n
|
||||||
The maximum number of I/Os active to each device. Ideally, this will be >=
|
The maximum number of I/Os active to each device. Ideally, this will be >=
|
||||||
the sum of each queue's max_active. It must be at least the sum of each
|
the sum of each queue's max_active. See the section "ZFS I/O SCHEDULER".
|
||||||
queue's min_active. See the section "ZFS I/O SCHEDULER".
|
|
||||||
.sp
|
.sp
|
||||||
Default value: \fB1,000\fR.
|
Default value: \fB1,000\fR.
|
||||||
.RE
|
.RE
|
||||||
@@ -2161,6 +2160,42 @@ See the section "ZFS I/O SCHEDULER".
|
|||||||
Default value: \fB1\fR.
|
Default value: \fB1\fR.
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
|
.sp
|
||||||
|
.ne 2
|
||||||
|
.na
|
||||||
|
\fBzfs_vdev_nia_delay\fR (int)
|
||||||
|
.ad
|
||||||
|
.RS 12n
|
||||||
|
For non-interactive I/O (scrub, resilver, removal, initialize and rebuild),
|
||||||
|
the number of concurrently-active I/O's is limited to *_min_active, unless
|
||||||
|
the vdev is "idle". When there are no interactive I/Os active (sync or
|
||||||
|
async), and zfs_vdev_nia_delay I/Os have completed since the last
|
||||||
|
interactive I/O, then the vdev is considered to be "idle", and the number
|
||||||
|
of concurrently-active non-interactive I/O's is increased to *_max_active.
|
||||||
|
See the section "ZFS I/O SCHEDULER".
|
||||||
|
.sp
|
||||||
|
Default value: \fB5\fR.
|
||||||
|
.RE
|
||||||
|
|
||||||
|
.sp
|
||||||
|
.ne 2
|
||||||
|
.na
|
||||||
|
\fBzfs_vdev_nia_credit\fR (int)
|
||||||
|
.ad
|
||||||
|
.RS 12n
|
||||||
|
Some HDDs tend to prioritize sequential I/O so high, that concurrent
|
||||||
|
random I/O latency reaches several seconds. On some HDDs it happens
|
||||||
|
even if sequential I/Os are submitted one at a time, and so setting
|
||||||
|
*_max_active to 1 does not help. To prevent non-interactive I/Os, like
|
||||||
|
scrub, from monopolizing the device no more than zfs_vdev_nia_credit
|
||||||
|
I/Os can be sent while there are outstanding incomplete interactive
|
||||||
|
I/Os. This enforced wait ensures the HDD services the interactive I/O
|
||||||
|
within a reasonable amount of time.
|
||||||
|
See the section "ZFS I/O SCHEDULER".
|
||||||
|
.sp
|
||||||
|
Default value: \fB5\fR.
|
||||||
|
.RE
|
||||||
|
|
||||||
.sp
|
.sp
|
||||||
.ne 2
|
.ne 2
|
||||||
.na
|
.na
|
||||||
|
|||||||
+1
-1
@@ -66,7 +66,7 @@ R The path has been renamed
|
|||||||
.Bl -tag -width "-F"
|
.Bl -tag -width "-F"
|
||||||
.It Fl F
|
.It Fl F
|
||||||
Display an indication of the type of file, in a manner similar to the
|
Display an indication of the type of file, in a manner similar to the
|
||||||
.Fl
|
.Fl F
|
||||||
option of
|
option of
|
||||||
.Xr ls 1 .
|
.Xr ls 1 .
|
||||||
.Bd -literal
|
.Bd -literal
|
||||||
|
|||||||
+8
-3
@@ -63,12 +63,17 @@ If specified, you can list property information by the absolute pathname or the
|
|||||||
relative pathname.
|
relative pathname.
|
||||||
By default, all file systems and volumes are displayed.
|
By default, all file systems and volumes are displayed.
|
||||||
Snapshots are displayed if the
|
Snapshots are displayed if the
|
||||||
.Sy listsnaps
|
.Sy listsnapshots
|
||||||
property is
|
pool property is
|
||||||
.Sy on
|
.Sy on
|
||||||
.Po the default is
|
.Po the default is
|
||||||
.Sy off
|
.Sy off
|
||||||
.Pc .
|
.Pc ,
|
||||||
|
or if the
|
||||||
|
.Fl t Sy snapshot
|
||||||
|
or
|
||||||
|
.Fl t Sy all
|
||||||
|
options are specified.
|
||||||
The following fields are displayed:
|
The following fields are displayed:
|
||||||
.Sy name Ns \&, Sy used Ns \&, Sy available Ns \&, Sy referenced Ns \&, Sy mountpoint Ns .
|
.Sy name Ns \&, Sy used Ns \&, Sy available Ns \&, Sy referenced Ns \&, Sy mountpoint Ns .
|
||||||
.Bl -tag -width "-H"
|
.Bl -tag -width "-H"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
.\" Copyright (c) 2019, 2020 by Christian Schwarz. All Rights Reserved.
|
.\" Copyright (c) 2019, 2020 by Christian Schwarz. All Rights Reserved.
|
||||||
.\" Copyright 2020 Joyent, Inc.
|
.\" Copyright 2020 Joyent, Inc.
|
||||||
.\"
|
.\"
|
||||||
.Dd February 3, 2020
|
.Dd January 26, 2021
|
||||||
.Dt ZFS-PROGRAM 8
|
.Dt ZFS-PROGRAM 8
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@@ -290,7 +290,7 @@ EBADF EXDEV EFBIG
|
|||||||
.Ss API Functions
|
.Ss API Functions
|
||||||
For detailed descriptions of the exact behavior of any zfs administrative
|
For detailed descriptions of the exact behavior of any zfs administrative
|
||||||
operations, see the main
|
operations, see the main
|
||||||
.Xr zfs 1
|
.Xr zfs 8
|
||||||
manual page.
|
manual page.
|
||||||
.Bl -tag -width "xx"
|
.Bl -tag -width "xx"
|
||||||
.It Em zfs.debug(msg)
|
.It Em zfs.debug(msg)
|
||||||
|
|||||||
+1
-1
@@ -1766,7 +1766,7 @@ where
|
|||||||
and
|
and
|
||||||
.Sy none
|
.Sy none
|
||||||
are encoded as 1, 2 and 3 respectively.
|
are encoded as 1, 2 and 3 respectively.
|
||||||
The default values is
|
The default value is
|
||||||
.Sy full .
|
.Sy full .
|
||||||
.It Sy vscan Ns = Ns Sy on Ns | Ns Sy off
|
.It Sy vscan Ns = Ns Sy on Ns | Ns Sy off
|
||||||
Controls whether regular files should be scanned for viruses when a file is
|
Controls whether regular files should be scanned for viruses when a file is
|
||||||
|
|||||||
+14
-13
@@ -107,9 +107,10 @@ SRCS+= nvpair.c \
|
|||||||
|
|
||||||
#os/freebsd/spl
|
#os/freebsd/spl
|
||||||
SRCS+= acl_common.c \
|
SRCS+= acl_common.c \
|
||||||
btree.c \
|
|
||||||
callb.c \
|
callb.c \
|
||||||
list.c \
|
list.c \
|
||||||
|
sha256c.c \
|
||||||
|
sha512c.c \
|
||||||
spl_acl.c \
|
spl_acl.c \
|
||||||
spl_cmn_err.c \
|
spl_cmn_err.c \
|
||||||
spl_dtrace.c \
|
spl_dtrace.c \
|
||||||
@@ -117,6 +118,7 @@ SRCS+= acl_common.c \
|
|||||||
spl_kstat.c \
|
spl_kstat.c \
|
||||||
spl_misc.c \
|
spl_misc.c \
|
||||||
spl_policy.c \
|
spl_policy.c \
|
||||||
|
spl_procfs_list.c \
|
||||||
spl_string.c \
|
spl_string.c \
|
||||||
spl_sunddi.c \
|
spl_sunddi.c \
|
||||||
spl_sysevent.c \
|
spl_sysevent.c \
|
||||||
@@ -124,11 +126,8 @@ SRCS+= acl_common.c \
|
|||||||
spl_uio.c \
|
spl_uio.c \
|
||||||
spl_vfs.c \
|
spl_vfs.c \
|
||||||
spl_vm.c \
|
spl_vm.c \
|
||||||
spl_zone.c \
|
spl_zlib.c \
|
||||||
sha256c.c \
|
spl_zone.c
|
||||||
sha512c.c \
|
|
||||||
spl_procfs_list.c \
|
|
||||||
spl_zlib.c
|
|
||||||
|
|
||||||
|
|
||||||
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
|
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \
|
||||||
@@ -138,6 +137,7 @@ SRCS+= spl_atomic.c
|
|||||||
|
|
||||||
#os/freebsd/zfs
|
#os/freebsd/zfs
|
||||||
SRCS+= abd_os.c \
|
SRCS+= abd_os.c \
|
||||||
|
arc_os.c \
|
||||||
crypto_os.c \
|
crypto_os.c \
|
||||||
dmu_os.c \
|
dmu_os.c \
|
||||||
hkdf.c \
|
hkdf.c \
|
||||||
@@ -145,17 +145,16 @@ SRCS+= abd_os.c \
|
|||||||
spa_os.c \
|
spa_os.c \
|
||||||
sysctl_os.c \
|
sysctl_os.c \
|
||||||
vdev_file.c \
|
vdev_file.c \
|
||||||
vdev_label_os.c \
|
|
||||||
vdev_geom.c \
|
vdev_geom.c \
|
||||||
|
vdev_label_os.c \
|
||||||
zfs_acl.c \
|
zfs_acl.c \
|
||||||
zfs_ctldir.c \
|
zfs_ctldir.c \
|
||||||
|
zfs_debug.c \
|
||||||
zfs_dir.c \
|
zfs_dir.c \
|
||||||
zfs_ioctl_compat.c \
|
zfs_ioctl_compat.c \
|
||||||
zfs_ioctl_os.c \
|
zfs_ioctl_os.c \
|
||||||
zfs_log.c \
|
|
||||||
zfs_replay.c \
|
|
||||||
zfs_vfsops.c \
|
zfs_vfsops.c \
|
||||||
zfs_vnops.c \
|
zfs_vnops_os.c \
|
||||||
zfs_znode.c \
|
zfs_znode.c \
|
||||||
zio_crypt.c \
|
zio_crypt.c \
|
||||||
zvol_os.c
|
zvol_os.c
|
||||||
@@ -183,10 +182,10 @@ SRCS+= zfeature_common.c \
|
|||||||
SRCS+= abd.c \
|
SRCS+= abd.c \
|
||||||
aggsum.c \
|
aggsum.c \
|
||||||
arc.c \
|
arc.c \
|
||||||
arc_os.c \
|
|
||||||
blkptr.c \
|
blkptr.c \
|
||||||
bplist.c \
|
bplist.c \
|
||||||
bpobj.c \
|
bpobj.c \
|
||||||
|
btree.c \
|
||||||
cityhash.c \
|
cityhash.c \
|
||||||
dbuf.c \
|
dbuf.c \
|
||||||
dbuf_stats.c \
|
dbuf_stats.c \
|
||||||
@@ -281,16 +280,18 @@ SRCS+= abd.c \
|
|||||||
zcp_synctask.c \
|
zcp_synctask.c \
|
||||||
zfeature.c \
|
zfeature.c \
|
||||||
zfs_byteswap.c \
|
zfs_byteswap.c \
|
||||||
zfs_debug.c \
|
|
||||||
zfs_file_os.c \
|
zfs_file_os.c \
|
||||||
zfs_fm.c \
|
zfs_fm.c \
|
||||||
zfs_fuid.c \
|
zfs_fuid.c \
|
||||||
zfs_ioctl.c \
|
zfs_ioctl.c \
|
||||||
|
zfs_log.c \
|
||||||
zfs_onexit.c \
|
zfs_onexit.c \
|
||||||
zfs_quota.c \
|
zfs_quota.c \
|
||||||
zfs_ratelimit.c \
|
zfs_ratelimit.c \
|
||||||
|
zfs_replay.c \
|
||||||
zfs_rlock.c \
|
zfs_rlock.c \
|
||||||
zfs_sa.c \
|
zfs_sa.c \
|
||||||
|
zfs_vnops.c \
|
||||||
zil.c \
|
zil.c \
|
||||||
zio.c \
|
zio.c \
|
||||||
zio_checksum.c \
|
zio_checksum.c \
|
||||||
@@ -328,7 +329,7 @@ CFLAGS.spl_vm.c= -Wno-cast-qual
|
|||||||
CFLAGS.spl_zlib.c= -Wno-cast-qual
|
CFLAGS.spl_zlib.c= -Wno-cast-qual
|
||||||
CFLAGS.abd.c= -Wno-cast-qual
|
CFLAGS.abd.c= -Wno-cast-qual
|
||||||
CFLAGS.zfs_log.c= -Wno-cast-qual
|
CFLAGS.zfs_log.c= -Wno-cast-qual
|
||||||
CFLAGS.zfs_vnops.c= -Wno-pointer-arith
|
CFLAGS.zfs_vnops_os.c= -Wno-pointer-arith
|
||||||
CFLAGS.u8_textprep.c= -Wno-cast-qual
|
CFLAGS.u8_textprep.c= -Wno-cast-qual
|
||||||
CFLAGS.zfs_fletcher.c= -Wno-cast-qual -Wno-pointer-arith
|
CFLAGS.zfs_fletcher.c= -Wno-cast-qual -Wno-pointer-arith
|
||||||
CFLAGS.zfs_fletcher_intel.c= -Wno-cast-qual -Wno-pointer-arith
|
CFLAGS.zfs_fletcher_intel.c= -Wno-cast-qual -Wno-pointer-arith
|
||||||
|
|||||||
+6
-4
@@ -33,14 +33,16 @@
|
|||||||
#if defined (_KERNEL) && defined(__linux__)
|
#if defined (_KERNEL) && defined(__linux__)
|
||||||
#include <asm/current.h>
|
#include <asm/current.h>
|
||||||
static intptr_t stack_remaining(void) {
|
static intptr_t stack_remaining(void) {
|
||||||
char local;
|
intptr_t local;
|
||||||
return (intptr_t)(&local - (char *)current->stack);
|
local = (intptr_t)&local - (intptr_t)current->stack;
|
||||||
|
return local;
|
||||||
}
|
}
|
||||||
#elif defined (_KERNEL) && defined(__FreeBSD__)
|
#elif defined (_KERNEL) && defined(__FreeBSD__)
|
||||||
#include <sys/pcpu.h>
|
#include <sys/pcpu.h>
|
||||||
static intptr_t stack_remaining(void) {
|
static intptr_t stack_remaining(void) {
|
||||||
char local;
|
intptr_t local;
|
||||||
return (intptr_t)(&local - (char *)curthread->td_kstack);
|
local = (intptr_t)&local - (intptr_t)curthread->td_kstack;
|
||||||
|
return local;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static intptr_t stack_remaining(void) {
|
static intptr_t stack_remaining(void) {
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <sys/jail.h>
|
#include <sys/jail.h>
|
||||||
#include <sys/policy.h>
|
#include <sys/policy.h>
|
||||||
#include <sys/zfs_vfsops.h>
|
#include <sys/zfs_vfsops.h>
|
||||||
|
#include <sys/zfs_znode.h>
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
@@ -312,11 +313,11 @@ secpolicy_vnode_setids_setgids(vnode_t *vp, cred_t *cr, gid_t gid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
secpolicy_vnode_setid_retain(vnode_t *vp, cred_t *cr,
|
secpolicy_vnode_setid_retain(znode_t *zp, cred_t *cr,
|
||||||
boolean_t issuidroot __unused)
|
boolean_t issuidroot __unused)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (secpolicy_fs_owner(vp->v_mount, cr) == 0)
|
if (secpolicy_fs_owner(ZTOV(zp)->v_mount, cr) == 0)
|
||||||
return (0);
|
return (0);
|
||||||
return (spl_priv_check_cred(cr, PRIV_VFS_RETAINSUGID));
|
return (spl_priv_check_cred(cr, PRIV_VFS_RETAINSUGID));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -240,9 +240,11 @@ mount_snapshot(kthread_t *td, vnode_t **vpp, const char *fstype, char *fspath,
|
|||||||
#endif
|
#endif
|
||||||
VI_LOCK(vp);
|
VI_LOCK(vp);
|
||||||
vp->v_iflag &= ~VI_MOUNT;
|
vp->v_iflag &= ~VI_MOUNT;
|
||||||
VI_UNLOCK(vp);
|
#ifdef VIRF_MOUNTPOINT
|
||||||
|
vn_irflag_set_locked(vp, VIRF_MOUNTPOINT);
|
||||||
|
#endif
|
||||||
vp->v_mountedhere = mp;
|
vp->v_mountedhere = mp;
|
||||||
|
VI_UNLOCK(vp);
|
||||||
/* Put the new filesystem on the mount list. */
|
/* Put the new filesystem on the mount list. */
|
||||||
mtx_lock(&mountlist_mtx);
|
mtx_lock(&mountlist_mtx);
|
||||||
TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list);
|
TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user