mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 11:18:52 +03:00
Compare commits
213 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dcbf847493 | |||
| 2757204434 | |||
| 24a6f83847 | |||
| 2c36eb763f | |||
| a4ab0c607e | |||
| a3a4b8def7 | |||
| 14bdf57a99 | |||
| 45061cc797 | |||
| cb01817f22 | |||
| 1c4ccfb34e | |||
| 056287e3f7 | |||
| ccfa35c6f9 | |||
| 8471f71132 | |||
| 813185d141 | |||
| be12087783 | |||
| 4f9014b70b | |||
| 043ef5c25e | |||
| c06118e0b1 | |||
| 5f24bd11ee | |||
| f6f3089cf6 | |||
| a09aeb9fc4 | |||
| e4257ed76d | |||
| c4a5e3b90f | |||
| d02fc15ba1 | |||
| 435dc4baab | |||
| 04177b9c3f | |||
| 4a87c280dc | |||
| d237d9a918 | |||
| 2132ae465d | |||
| 87f01fc158 | |||
| 995b80fa3a | |||
| d842f99c6b | |||
| 8cad25a39c | |||
| c00bb5f4ea | |||
| d33cbbbf93 | |||
| a4efa59a94 | |||
| cb4d3fb737 | |||
| 4a2e9811e9 | |||
| 050dfc5045 | |||
| b49118220c | |||
| 806dda56ce | |||
| 97f5cfea77 | |||
| 5ecbea67eb | |||
| 957b4e9fbd | |||
| ef648fec0e | |||
| e518548e17 | |||
| 1f442afa41 | |||
| 62d549d757 | |||
| ab9011e79b | |||
| b42f36f0b0 | |||
| a30fed54f4 | |||
| e767b1cacc | |||
| d2090becab | |||
| 54f10674f3 | |||
| f8460e7e62 | |||
| 45479eb1de | |||
| aaeffd09bf | |||
| 0c270bb6c4 | |||
| c2c643256c | |||
| 896d0f0906 | |||
| ef525e0841 | |||
| 00a27515f0 | |||
| 52f1ef3b2d | |||
| c6b0680d9b | |||
| 2c37e1416b | |||
| 6e4845aee3 | |||
| 48cf7d674a | |||
| ca54e52122 | |||
| c3ae9321bf | |||
| 2dd2e49cc7 | |||
| 8a1b26eb54 | |||
| 7e76d21bc8 | |||
| e579a4ed0f | |||
| 6867d00403 | |||
| 0dc6fb730f | |||
| f5bffd3748 | |||
| 07c7899a37 | |||
| 79bfba2fa8 | |||
| 73511e3dde | |||
| 3b79394bc9 | |||
| 4df31aa98c | |||
| aeeada355c | |||
| 0905a4fe9b | |||
| 3ba6774e58 | |||
| 26e9c479b5 | |||
| db75854cbb | |||
| bd565f3e24 | |||
| 3c4e580e9a | |||
| b3f4436d37 | |||
| 05f8be3b49 | |||
| d8091c9294 | |||
| 05613fa7a3 | |||
| 725c9e22ca | |||
| fbfc7e843a | |||
| faa62966b1 | |||
| be28cdd1c3 | |||
| 7f0b3fa042 | |||
| f40a1ad9e0 | |||
| 9cf33c99fc | |||
| a51019f4ec | |||
| c71847b77b | |||
| 5c6d3c21b1 | |||
| 5e7198b873 | |||
| 46c71074ca | |||
| 35ba2ca5b7 | |||
| cbcb88dff8 | |||
| 0df5b5737c | |||
| 102a1db6b2 | |||
| 25e44a17ff | |||
| 718d20ed93 | |||
| 18fea82b89 | |||
| cfb602125e | |||
| 106627caa7 | |||
| d6bee967ed | |||
| 47e3dba972 | |||
| a09e3a8594 | |||
| 5573cbea9a | |||
| fc5966589b | |||
| 5d61d6e8dd | |||
| 775afc4dcd | |||
| 7ce9da0bea | |||
| e58dee8cae | |||
| 83b5a22d86 | |||
| 13c38c4c45 | |||
| fdbec0423b | |||
| 9f29a4d972 | |||
| ced5f71eec | |||
| e5a4f9cfc4 | |||
| 1579483a86 | |||
| edd23dba81 | |||
| 7b353d2c8c | |||
| b37efb872b | |||
| d8a81c3d3c | |||
| 875307b6a1 | |||
| 626abe164d | |||
| ba28919168 | |||
| c70c6e004e | |||
| 227273efa4 | |||
| b199e62d17 | |||
| b9d18bdbdc | |||
| e651a5b233 | |||
| 723726ae7d | |||
| aba5b019cb | |||
| f664153078 | |||
| 4ce06f940e | |||
| 5899ea5a77 | |||
| 56e69c1e9c | |||
| dacb4f6a61 | |||
| 66ccc9b75f | |||
| 7b86ad215e | |||
| aa7817c151 | |||
| 3902eaf9ed | |||
| 2cec08a1f0 | |||
| 0968d689a2 | |||
| 1ce90aa441 | |||
| c9eab8257d | |||
| df39626fdd | |||
| 083ddb7714 | |||
| 7bc2d04398 | |||
| 84d9492e52 | |||
| c8bbb0c93d | |||
| ae93e46716 | |||
| 645ca45a13 | |||
| 29bc31f62f | |||
| 17e2fd3bfd | |||
| 55de40fe47 | |||
| 9cea5f0d69 | |||
| 78d84f56d1 | |||
| 127daad223 | |||
| b155a243a6 | |||
| ac71835706 | |||
| 3625a0131a | |||
| 0b5a4c4d6b | |||
| ee73a8ff3d | |||
| c0234eab65 | |||
| dd34e6cdd9 | |||
| e9c1fa0cc1 | |||
| 18524b936d | |||
| 8afac5dc55 | |||
| bd724261d2 | |||
| a1e03186fd | |||
| e28635396a | |||
| 36f36610c3 | |||
| fd20a81b9a | |||
| ef8a6fe9fe | |||
| 7c36a9e24a | |||
| da81d91d48 | |||
| ecd3976f5b | |||
| 76a157f004 | |||
| 6512c18fe1 | |||
| f5ddb3b481 | |||
| d6a779a278 | |||
| bbba0b7f93 | |||
| 8a06356e24 | |||
| b73a8b1dc2 | |||
| baed4fbacb | |||
| f4c8e9c69b | |||
| 8639ca86da | |||
| c6ee83893e | |||
| 0fba4d138c | |||
| 6bf3f4dfe5 | |||
| fa0cd2d16f | |||
| a00c61db44 | |||
| c2068750d7 | |||
| af424d8a1a | |||
| 1ac6248312 | |||
| 77b01f53e7 | |||
| 57fc3987a0 | |||
| 4f6167deb5 | |||
| 79d6a1b1da | |||
| 510179f086 | |||
| cb16a5e043 | |||
| 3ca31bd0c6 |
+17
-66
@@ -126,8 +126,8 @@ feature needed? What problem does it solve?
|
|||||||
|
|
||||||
#### General
|
#### General
|
||||||
|
|
||||||
* All pull requests must be based on the current master branch and apply
|
* All pull requests, except backports and releases, must be based on the current master branch
|
||||||
without conflicts.
|
and should apply without conflicts.
|
||||||
* Please attempt to limit pull requests to a single commit which resolves
|
* Please attempt to limit pull requests to a single commit which resolves
|
||||||
one specific issue.
|
one specific issue.
|
||||||
* Make sure your commit messages are in the correct format. See the
|
* Make sure your commit messages are in the correct format. See the
|
||||||
@@ -175,6 +175,21 @@ to verify ZFS is behaving as intended.
|
|||||||
|
|
||||||
## Style Guides
|
## Style Guides
|
||||||
|
|
||||||
|
### Repository Structure
|
||||||
|
|
||||||
|
OpenZFS uses a standardised branching structure.
|
||||||
|
- The "development and main branch", is the branch all development should be based on.
|
||||||
|
- "Release branches" contain the latest released code for said version.
|
||||||
|
- "Staging branches" contain selected commits prior to being released.
|
||||||
|
|
||||||
|
**Branch Names:**
|
||||||
|
- Development and Main branch: `master`
|
||||||
|
- Release branches: `zfs-$VERSION-release`
|
||||||
|
- Staging branches: `zfs-$VERSION-staging`
|
||||||
|
|
||||||
|
`$VERSION` should be replaced with the `major.minor` version number.
|
||||||
|
_(This is the version number without the `.patch` version at the end)_
|
||||||
|
|
||||||
### Coding Conventions
|
### Coding Conventions
|
||||||
We currently use [C Style and Coding Standards for
|
We currently use [C Style and Coding Standards for
|
||||||
SunOS](http://www.cis.upenn.edu/%7Elee/06cse480/data/cstyle.ms.pdf) as our
|
SunOS](http://www.cis.upenn.edu/%7Elee/06cse480/data/cstyle.ms.pdf) as our
|
||||||
@@ -215,70 +230,6 @@ attempting to solve.
|
|||||||
Signed-off-by: Contributor <contributor@email.com>
|
Signed-off-by: Contributor <contributor@email.com>
|
||||||
```
|
```
|
||||||
|
|
||||||
#### OpenZFS Patch Ports
|
|
||||||
If you are porting OpenZFS patches, the commit message must meet
|
|
||||||
the following guidelines:
|
|
||||||
* The first line must be the summary line from the most important OpenZFS commit being ported.
|
|
||||||
It must begin with `OpenZFS dddd, dddd - ` where `dddd` are OpenZFS issue numbers.
|
|
||||||
* Provides a `Authored by:` line to attribute each patch for each original author.
|
|
||||||
* Provides the `Reviewed by:` and `Approved by:` lines from each original
|
|
||||||
OpenZFS commit.
|
|
||||||
* Provides a `Ported-by:` line with the developer's name followed by
|
|
||||||
their email for each OpenZFS commit.
|
|
||||||
* Provides a `OpenZFS-issue:` line with link for each original illumos
|
|
||||||
issue.
|
|
||||||
* Provides a `OpenZFS-commit:` line with link for each original OpenZFS commit.
|
|
||||||
* If necessary, provide some porting notes to describe any deviations from
|
|
||||||
the original OpenZFS commits.
|
|
||||||
|
|
||||||
An example OpenZFS patch port commit message for a single patch is provided
|
|
||||||
below.
|
|
||||||
```
|
|
||||||
OpenZFS 1234 - Summary from the original OpenZFS commit
|
|
||||||
|
|
||||||
Authored by: Original Author <original@email.com>
|
|
||||||
Reviewed by: Reviewer One <reviewer1@email.com>
|
|
||||||
Reviewed by: Reviewer Two <reviewer2@email.com>
|
|
||||||
Approved by: Approver One <approver1@email.com>
|
|
||||||
Ported-by: ZFS Contributor <contributor@email.com>
|
|
||||||
|
|
||||||
Provide some porting notes here if necessary.
|
|
||||||
|
|
||||||
OpenZFS-issue: https://www.illumos.org/issues/1234
|
|
||||||
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/abcd1234
|
|
||||||
```
|
|
||||||
|
|
||||||
If necessary, multiple OpenZFS patches can be combined in a single port.
|
|
||||||
This is useful when you are porting a new patch and its subsequent bug
|
|
||||||
fixes. An example commit message is provided below.
|
|
||||||
```
|
|
||||||
OpenZFS 1234, 5678 - Summary of most important OpenZFS commit
|
|
||||||
|
|
||||||
1234 Summary from original OpenZFS commit for 1234
|
|
||||||
|
|
||||||
Authored by: Original Author <original@email.com>
|
|
||||||
Reviewed by: Reviewer Two <reviewer2@email.com>
|
|
||||||
Approved by: Approver One <approver1@email.com>
|
|
||||||
Ported-by: ZFS Contributor <contributor@email.com>
|
|
||||||
|
|
||||||
Provide some porting notes here for 1234 if necessary.
|
|
||||||
|
|
||||||
OpenZFS-issue: https://www.illumos.org/issues/1234
|
|
||||||
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/abcd1234
|
|
||||||
|
|
||||||
5678 Summary from original OpenZFS commit for 5678
|
|
||||||
|
|
||||||
Authored by: Original Author2 <original2@email.com>
|
|
||||||
Reviewed by: Reviewer One <reviewer1@email.com>
|
|
||||||
Approved by: Approver Two <approver2@email.com>
|
|
||||||
Ported-by: ZFS Contributor <contributor@email.com>
|
|
||||||
|
|
||||||
Provide some porting notes here for 5678 if necessary.
|
|
||||||
|
|
||||||
OpenZFS-issue: https://www.illumos.org/issues/5678
|
|
||||||
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/efgh5678
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Coverity Defect Fixes
|
#### Coverity Defect Fixes
|
||||||
If you are submitting a fix to a
|
If you are submitting a fix to a
|
||||||
[Coverity defect](https://scan.coverity.com/projects/zfsonlinux-zfs),
|
[Coverity defect](https://scan.coverity.com/projects/zfsonlinux-zfs),
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
blank_issues_enabled: false
|
||||||
|
contact_links:
|
||||||
|
- name: OpenZFS Community Support Mailing list (Linux)
|
||||||
|
url: https://zfsonlinux.topicbox.com/groups/zfs-discuss
|
||||||
|
about: Get community support for OpenZFS on Linux
|
||||||
|
- name: FreeBSD Community Support Mailing list
|
||||||
|
url: https://lists.freebsd.org/mailman/listinfo/freebsd-fs
|
||||||
|
about: Get community support for OpenZFS on FreeBSD
|
||||||
|
- name: OpenZFS on IRC
|
||||||
|
url: https://webchat.freenode.net/#openzfs
|
||||||
|
about: Use IRC to get community support for OpenZFS
|
||||||
@@ -18,7 +18,7 @@ jobs:
|
|||||||
sudo apt-get install --yes -qq zlib1g-dev uuid-dev libattr1-dev libblkid-dev libselinux-dev libudev-dev libssl-dev python-dev python-setuptools python-cffi python3 python3-dev python3-setuptools python3-cffi
|
sudo apt-get install --yes -qq zlib1g-dev uuid-dev libattr1-dev libblkid-dev libselinux-dev libudev-dev libssl-dev python-dev python-setuptools python-cffi python3 python3-dev python3-setuptools python3-cffi
|
||||||
# packages for tests
|
# packages for tests
|
||||||
sudo apt-get install --yes -qq parted lsscsi ksh attr acl nfs-kernel-server fio
|
sudo apt-get install --yes -qq parted lsscsi ksh attr acl nfs-kernel-server fio
|
||||||
sudo apt-get install --yes -qq mandoc cppcheck pax-utils # devscripts - enable then bashisms fixed
|
sudo apt-get install --yes -qq mandoc cppcheck pax-utils abigail-tools # devscripts - enable then bashisms fixed
|
||||||
sudo -E pip --quiet install flake8
|
sudo -E pip --quiet install flake8
|
||||||
- name: Prepare
|
- name: Prepare
|
||||||
run: |
|
run: |
|
||||||
@@ -30,3 +30,7 @@ jobs:
|
|||||||
- name: Lint
|
- name: Lint
|
||||||
run: |
|
run: |
|
||||||
make lint
|
make lint
|
||||||
|
- name: CheckABI
|
||||||
|
run: |
|
||||||
|
make -j$(nproc)
|
||||||
|
make checkabi
|
||||||
|
|||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
The [OpenZFS Code of Conduct](http://www.open-zfs.org/wiki/Code_of_Conduct)
|
The [OpenZFS Code of Conduct](http://www.open-zfs.org/wiki/Code_of_Conduct)
|
||||||
applies to spaces associated with the ZFS on Linux project, including GitHub.
|
applies to spaces associated with the OpenZFS project, including GitHub.
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ Meta: 1
|
|||||||
Name: zfs
|
Name: zfs
|
||||||
Branch: 1.0
|
Branch: 1.0
|
||||||
Version: 2.0.0
|
Version: 2.0.0
|
||||||
Release: rc1
|
Release: 1
|
||||||
Release-Tags: relext
|
Release-Tags: relext
|
||||||
License: CDDL
|
License: CDDL
|
||||||
Author: OpenZFS
|
Author: OpenZFS
|
||||||
Linux-Maximum: 5.8
|
Linux-Maximum: 5.9
|
||||||
Linux-Minimum: 3.10
|
Linux-Minimum: 3.10
|
||||||
|
|||||||
+9
-1
@@ -136,6 +136,13 @@ shellcheck:
|
|||||||
echo "skipping shellcheck because shellcheck is not installed"; \
|
echo "skipping shellcheck because shellcheck is not installed"; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
PHONY += checkabi storeabi
|
||||||
|
checkabi: lib
|
||||||
|
$(MAKE) -C lib checkabi
|
||||||
|
|
||||||
|
storeabi: lib
|
||||||
|
$(MAKE) -C lib storeabi
|
||||||
|
|
||||||
PHONY += checkbashisms
|
PHONY += checkbashisms
|
||||||
checkbashisms:
|
checkbashisms:
|
||||||
@if type checkbashisms > /dev/null 2>&1; then \
|
@if type checkbashisms > /dev/null 2>&1; then \
|
||||||
@@ -152,9 +159,10 @@ checkbashisms:
|
|||||||
-o -name 'smart' -prune \
|
-o -name 'smart' -prune \
|
||||||
-o -name 'paxcheck.sh' -prune \
|
-o -name 'paxcheck.sh' -prune \
|
||||||
-o -name 'make_gitrev.sh' -prune \
|
-o -name 'make_gitrev.sh' -prune \
|
||||||
|
-o -name '90zfs' -prune \
|
||||||
-o -type f ! -name 'config*' \
|
-o -type f ! -name 'config*' \
|
||||||
! -name 'libtool' \
|
! -name 'libtool' \
|
||||||
-exec bash -c 'awk "NR==1 && /\#\!.*bin\/sh.*/ {print FILENAME;}" "{}"' \;); \
|
-exec sh -c 'awk "NR==1 && /\#\!.*bin\/sh.*/ {print FILENAME;}" "{}"' \;); \
|
||||||
else \
|
else \
|
||||||
echo "skipping checkbashisms because checkbashisms is not installed"; \
|
echo "skipping checkbashisms because checkbashisms is not installed"; \
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
Descriptions of all releases can be found on github:
|
Descriptions of all releases can be found on github:
|
||||||
|
|
||||||
https://github.com/zfsonlinux/zfs/releases
|
https://github.com/openzfs/zfs/releases
|
||||||
|
|||||||
@@ -16,8 +16,8 @@ This repository contains the code for running OpenZFS on Linux and FreeBSD.
|
|||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
Full documentation for installing OpenZFS on your favorite Linux distribution can
|
Full documentation for installing OpenZFS on your favorite operating system can
|
||||||
be found at the [ZoL Site](https://zfsonlinux.org/).
|
be found at the [Getting Started Page](https://openzfs.github.io/openzfs-docs/Getting%20Started/index.html).
|
||||||
|
|
||||||
# Contribute & Develop
|
# Contribute & Develop
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
Provides basic information on the ARC, its efficiency, the L2ARC (if present),
|
Provides basic information on the ARC, its efficiency, the L2ARC (if present),
|
||||||
the Data Management Unit (DMU), Virtual Devices (VDEVs), and tunables. See the
|
the Data Management Unit (DMU), Virtual Devices (VDEVs), and tunables. See the
|
||||||
in-source documentation and code at
|
in-source documentation and code at
|
||||||
https://github.com/zfsonlinux/zfs/blob/master/module/zfs/arc.c for details.
|
https://github.com/openzfs/zfs/blob/master/module/zfs/arc.c for details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import getopt
|
import getopt
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
Provides basic information on the ARC, its efficiency, the L2ARC (if present),
|
Provides basic information on the ARC, its efficiency, the L2ARC (if present),
|
||||||
the Data Management Unit (DMU), Virtual Devices (VDEVs), and tunables. See
|
the Data Management Unit (DMU), Virtual Devices (VDEVs), and tunables. See
|
||||||
the in-source documentation and code at
|
the in-source documentation and code at
|
||||||
https://github.com/zfsonlinux/zfs/blob/master/module/zfs/arc.c for details.
|
https://github.com/openzfs/zfs/blob/master/module/zfs/arc.c for details.
|
||||||
The original introduction to arc_summary can be found at
|
The original introduction to arc_summary can be found at
|
||||||
http://cuddletech.com/?p=454
|
http://cuddletech.com/?p=454
|
||||||
"""
|
"""
|
||||||
@@ -43,7 +43,7 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
DESCRIPTION = 'Print ARC and other statistics for ZFS on Linux'
|
DESCRIPTION = 'Print ARC and other statistics for OpenZFS'
|
||||||
INDENT = ' '*8
|
INDENT = ' '*8
|
||||||
LINE_LENGTH = 72
|
LINE_LENGTH = 72
|
||||||
DATE_FORMAT = '%a %b %d %H:%M:%S %Y'
|
DATE_FORMAT = '%a %b %d %H:%M:%S %Y'
|
||||||
@@ -831,7 +831,7 @@ def section_vdev(kstats_dict):
|
|||||||
|
|
||||||
# Currently [Nov 2017] the VDEV cache is disabled, because it is actually
|
# Currently [Nov 2017] the VDEV cache is disabled, because it is actually
|
||||||
# harmful. When this is the case, we just skip the whole entry. See
|
# harmful. When this is the case, we just skip the whole entry. See
|
||||||
# https://github.com/zfsonlinux/zfs/blob/master/module/zfs/vdev_cache.c
|
# https://github.com/openzfs/zfs/blob/master/module/zfs/vdev_cache.c
|
||||||
# for details
|
# for details
|
||||||
tunables = get_vdev_params()
|
tunables = get_vdev_params()
|
||||||
|
|
||||||
@@ -857,7 +857,7 @@ def section_vdev(kstats_dict):
|
|||||||
|
|
||||||
def section_zil(kstats_dict):
|
def section_zil(kstats_dict):
|
||||||
"""Collect information on the ZFS Intent Log. Some of the information
|
"""Collect information on the ZFS Intent Log. Some of the information
|
||||||
taken from https://github.com/zfsonlinux/zfs/blob/master/include/sys/zil.h
|
taken from https://github.com/openzfs/zfs/blob/master/include/sys/zil.h
|
||||||
"""
|
"""
|
||||||
|
|
||||||
zil_stats = isolate_section('zil', kstats_dict)
|
zil_stats = isolate_section('zil', kstats_dict)
|
||||||
|
|||||||
+32
-6
@@ -118,12 +118,13 @@ opfile = None
|
|||||||
sep = " " # Default separator is 2 spaces
|
sep = " " # Default separator is 2 spaces
|
||||||
version = "0.4"
|
version = "0.4"
|
||||||
l2exist = False
|
l2exist = False
|
||||||
cmd = ("Usage: arcstat [-hvx] [-f fields] [-o file] [-s string] [interval "
|
cmd = ("Usage: arcstat [-havxp] [-f fields] [-o file] [-s string] [interval "
|
||||||
"[count]]\n")
|
"[count]]\n")
|
||||||
cur = {}
|
cur = {}
|
||||||
d = {}
|
d = {}
|
||||||
out = None
|
out = None
|
||||||
kstat = None
|
kstat = None
|
||||||
|
pretty_print = True
|
||||||
|
|
||||||
|
|
||||||
if sys.platform.startswith('freebsd'):
|
if sys.platform.startswith('freebsd'):
|
||||||
@@ -181,6 +182,7 @@ def detailed_usage():
|
|||||||
def usage():
|
def usage():
|
||||||
sys.stderr.write("%s\n" % cmd)
|
sys.stderr.write("%s\n" % cmd)
|
||||||
sys.stderr.write("\t -h : Print this help message\n")
|
sys.stderr.write("\t -h : Print this help message\n")
|
||||||
|
sys.stderr.write("\t -a : Print all possible stats\n")
|
||||||
sys.stderr.write("\t -v : List all possible field headers and definitions"
|
sys.stderr.write("\t -v : List all possible field headers and definitions"
|
||||||
"\n")
|
"\n")
|
||||||
sys.stderr.write("\t -x : Print extended stats\n")
|
sys.stderr.write("\t -x : Print extended stats\n")
|
||||||
@@ -188,6 +190,7 @@ def usage():
|
|||||||
sys.stderr.write("\t -o : Redirect output to the specified file\n")
|
sys.stderr.write("\t -o : Redirect output to the specified file\n")
|
||||||
sys.stderr.write("\t -s : Override default field separator with custom "
|
sys.stderr.write("\t -s : Override default field separator with custom "
|
||||||
"character or string\n")
|
"character or string\n")
|
||||||
|
sys.stderr.write("\t -p : Disable auto-scaling of numerical fields\n")
|
||||||
sys.stderr.write("\nExamples:\n")
|
sys.stderr.write("\nExamples:\n")
|
||||||
sys.stderr.write("\tarcstat -o /tmp/a.log 2 10\n")
|
sys.stderr.write("\tarcstat -o /tmp/a.log 2 10\n")
|
||||||
sys.stderr.write("\tarcstat -s \",\" -o /tmp/a.log 2 10\n")
|
sys.stderr.write("\tarcstat -s \",\" -o /tmp/a.log 2 10\n")
|
||||||
@@ -246,10 +249,14 @@ def print_values():
|
|||||||
global hdr
|
global hdr
|
||||||
global sep
|
global sep
|
||||||
global v
|
global v
|
||||||
|
global pretty_print
|
||||||
|
|
||||||
sys.stdout.write(sep.join(
|
if pretty_print:
|
||||||
prettynum(cols[col][0], cols[col][1], v[col]) for col in hdr))
|
fmt = lambda col: prettynum(cols[col][0], cols[col][1], v[col])
|
||||||
|
else:
|
||||||
|
fmt = lambda col: v[col]
|
||||||
|
|
||||||
|
sys.stdout.write(sep.join(fmt(col) for col in hdr))
|
||||||
sys.stdout.write("\n")
|
sys.stdout.write("\n")
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
@@ -257,9 +264,14 @@ def print_values():
|
|||||||
def print_header():
|
def print_header():
|
||||||
global hdr
|
global hdr
|
||||||
global sep
|
global sep
|
||||||
|
global pretty_print
|
||||||
|
|
||||||
sys.stdout.write(sep.join("%*s" % (cols[col][0], col) for col in hdr))
|
if pretty_print:
|
||||||
|
fmt = lambda col: "%*s" % (cols[col][0], col)
|
||||||
|
else:
|
||||||
|
fmt = lambda col: col
|
||||||
|
|
||||||
|
sys.stdout.write(sep.join(fmt(col) for col in hdr))
|
||||||
sys.stdout.write("\n")
|
sys.stdout.write("\n")
|
||||||
|
|
||||||
|
|
||||||
@@ -296,8 +308,10 @@ def init():
|
|||||||
global sep
|
global sep
|
||||||
global out
|
global out
|
||||||
global l2exist
|
global l2exist
|
||||||
|
global pretty_print
|
||||||
|
|
||||||
desired_cols = None
|
desired_cols = None
|
||||||
|
aflag = False
|
||||||
xflag = False
|
xflag = False
|
||||||
hflag = False
|
hflag = False
|
||||||
vflag = False
|
vflag = False
|
||||||
@@ -306,14 +320,16 @@ def init():
|
|||||||
try:
|
try:
|
||||||
opts, args = getopt.getopt(
|
opts, args = getopt.getopt(
|
||||||
sys.argv[1:],
|
sys.argv[1:],
|
||||||
"xo:hvs:f:",
|
"axo:hvs:f:p",
|
||||||
[
|
[
|
||||||
|
"all",
|
||||||
"extended",
|
"extended",
|
||||||
"outfile",
|
"outfile",
|
||||||
"help",
|
"help",
|
||||||
"verbose",
|
"verbose",
|
||||||
"separator",
|
"separator",
|
||||||
"columns"
|
"columns",
|
||||||
|
"parsable"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
except getopt.error as msg:
|
except getopt.error as msg:
|
||||||
@@ -322,6 +338,8 @@ def init():
|
|||||||
opts = None
|
opts = None
|
||||||
|
|
||||||
for opt, arg in opts:
|
for opt, arg in opts:
|
||||||
|
if opt in ('-a', '--all'):
|
||||||
|
aflag = True
|
||||||
if opt in ('-x', '--extended'):
|
if opt in ('-x', '--extended'):
|
||||||
xflag = True
|
xflag = True
|
||||||
if opt in ('-o', '--outfile'):
|
if opt in ('-o', '--outfile'):
|
||||||
@@ -337,6 +355,8 @@ def init():
|
|||||||
if opt in ('-f', '--columns'):
|
if opt in ('-f', '--columns'):
|
||||||
desired_cols = arg
|
desired_cols = arg
|
||||||
i += 1
|
i += 1
|
||||||
|
if opt in ('-p', '--parsable'):
|
||||||
|
pretty_print = False
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
argv = sys.argv[i:]
|
argv = sys.argv[i:]
|
||||||
@@ -381,6 +401,12 @@ def init():
|
|||||||
incompat)
|
incompat)
|
||||||
usage()
|
usage()
|
||||||
|
|
||||||
|
if aflag:
|
||||||
|
if l2exist:
|
||||||
|
hdr = cols.keys()
|
||||||
|
else:
|
||||||
|
hdr = [col for col in cols.keys() if not col.startswith("l2")]
|
||||||
|
|
||||||
if opfile:
|
if opfile:
|
||||||
try:
|
try:
|
||||||
out = open(opfile, "w")
|
out = open(opfile, "w")
|
||||||
|
|||||||
@@ -113,6 +113,21 @@ cmd = ("Usage: dbufstat [-bdhnrtvx] [-i file] [-f fields] [-o file] "
|
|||||||
raw = 0
|
raw = 0
|
||||||
|
|
||||||
|
|
||||||
|
if sys.platform.startswith("freebsd"):
|
||||||
|
import io
|
||||||
|
# Requires py-sysctl on FreeBSD
|
||||||
|
import sysctl
|
||||||
|
|
||||||
|
def default_ifile():
|
||||||
|
dbufs = sysctl.filter("kstat.zfs.misc.dbufs")[0].value
|
||||||
|
sys.stdin = io.StringIO(dbufs)
|
||||||
|
return "-"
|
||||||
|
|
||||||
|
elif sys.platform.startswith("linux"):
|
||||||
|
def default_ifile():
|
||||||
|
return "/proc/spl/kstat/zfs/dbufs"
|
||||||
|
|
||||||
|
|
||||||
def print_incompat_helper(incompat):
|
def print_incompat_helper(incompat):
|
||||||
cnt = 0
|
cnt = 0
|
||||||
for key in sorted(incompat):
|
for key in sorted(incompat):
|
||||||
@@ -645,7 +660,7 @@ def main():
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if not ifile:
|
if not ifile:
|
||||||
ifile = '/proc/spl/kstat/zfs/dbufs'
|
ifile = default_ifile()
|
||||||
|
|
||||||
if ifile is not "-":
|
if ifile is not "-":
|
||||||
try:
|
try:
|
||||||
|
|||||||
+28
-41
@@ -47,46 +47,34 @@ libzfs_handle_t *g_zfs;
|
|||||||
* is expected to be of the form pool/dataset, however may also refer to
|
* is expected to be of the form pool/dataset, however may also refer to
|
||||||
* a block device if that device contains a valid zfs label.
|
* a block device if that device contains a valid zfs label.
|
||||||
*/
|
*/
|
||||||
static char *
|
static void
|
||||||
parse_dataset(char *dataset)
|
parse_dataset(const char *target, char **dataset)
|
||||||
{
|
{
|
||||||
char cwd[PATH_MAX];
|
|
||||||
struct stat64 statbuf;
|
|
||||||
int error;
|
|
||||||
int len;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We expect a pool/dataset to be provided, however if we're
|
* We expect a pool/dataset to be provided, however if we're
|
||||||
* given a device which is a member of a zpool we attempt to
|
* given a device which is a member of a zpool we attempt to
|
||||||
* extract the pool name stored in the label. Given the pool
|
* extract the pool name stored in the label. Given the pool
|
||||||
* name we can mount the root dataset.
|
* name we can mount the root dataset.
|
||||||
*/
|
*/
|
||||||
error = stat64(dataset, &statbuf);
|
int fd = open(target, O_RDONLY);
|
||||||
if (error == 0) {
|
if (fd >= 0) {
|
||||||
nvlist_t *config;
|
nvlist_t *config = NULL;
|
||||||
char *name;
|
if (zpool_read_label(fd, &config, NULL) != 0)
|
||||||
int fd;
|
config = NULL;
|
||||||
|
if (close(fd))
|
||||||
|
perror("close");
|
||||||
|
|
||||||
fd = open(dataset, O_RDONLY);
|
if (config) {
|
||||||
if (fd < 0)
|
char *name = NULL;
|
||||||
goto out;
|
if (!nvlist_lookup_string(config,
|
||||||
|
ZPOOL_CONFIG_POOL_NAME, &name))
|
||||||
error = zpool_read_label(fd, &config, NULL);
|
(void) strlcpy(*dataset, name, PATH_MAX);
|
||||||
(void) close(fd);
|
|
||||||
if (error)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
error = nvlist_lookup_string(config,
|
|
||||||
ZPOOL_CONFIG_POOL_NAME, &name);
|
|
||||||
if (error) {
|
|
||||||
nvlist_free(config);
|
nvlist_free(config);
|
||||||
} else {
|
if (name)
|
||||||
dataset = strdup(name);
|
return;
|
||||||
nvlist_free(config);
|
|
||||||
return (dataset);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out:
|
|
||||||
/*
|
/*
|
||||||
* If a file or directory in your current working directory is
|
* If a file or directory in your current working directory is
|
||||||
* named 'dataset' then mount(8) will prepend your current working
|
* named 'dataset' then mount(8) will prepend your current working
|
||||||
@@ -94,16 +82,14 @@ out:
|
|||||||
* behavior so we simply check for it and strip the prepended
|
* behavior so we simply check for it and strip the prepended
|
||||||
* patch when it is added.
|
* patch when it is added.
|
||||||
*/
|
*/
|
||||||
if (getcwd(cwd, PATH_MAX) == NULL)
|
char cwd[PATH_MAX];
|
||||||
return (dataset);
|
if (getcwd(cwd, PATH_MAX) != NULL) {
|
||||||
|
int len = strlen(cwd);
|
||||||
len = strlen(cwd);
|
/* Do not add one when cwd already ends in a trailing '/' */
|
||||||
|
if (strncmp(cwd, target, len) == 0)
|
||||||
/* Do not add one when cwd already ends in a trailing '/' */
|
target += len + (cwd[len-1] != '/');
|
||||||
if (strncmp(cwd, dataset, len) == 0)
|
}
|
||||||
return (dataset + len + (cwd[len-1] != '/'));
|
strlcpy(*dataset, target, PATH_MAX);
|
||||||
|
|
||||||
return (dataset);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -176,12 +162,13 @@ main(int argc, char **argv)
|
|||||||
char badopt[MNT_LINE_MAX] = { '\0' };
|
char badopt[MNT_LINE_MAX] = { '\0' };
|
||||||
char mtabopt[MNT_LINE_MAX] = { '\0' };
|
char mtabopt[MNT_LINE_MAX] = { '\0' };
|
||||||
char mntpoint[PATH_MAX];
|
char mntpoint[PATH_MAX];
|
||||||
char *dataset;
|
char dataset[PATH_MAX], *pdataset = dataset;
|
||||||
unsigned long mntflags = 0, zfsflags = 0, remount = 0;
|
unsigned long mntflags = 0, zfsflags = 0, remount = 0;
|
||||||
int sloppy = 0, fake = 0, verbose = 0, nomtab = 0, zfsutil = 0;
|
int sloppy = 0, fake = 0, verbose = 0, nomtab = 0, zfsutil = 0;
|
||||||
int error, c;
|
int error, c;
|
||||||
|
|
||||||
(void) setlocale(LC_ALL, "");
|
(void) setlocale(LC_ALL, "");
|
||||||
|
(void) setlocale(LC_NUMERIC, "C");
|
||||||
(void) textdomain(TEXT_DOMAIN);
|
(void) textdomain(TEXT_DOMAIN);
|
||||||
|
|
||||||
opterr = 0;
|
opterr = 0;
|
||||||
@@ -231,7 +218,7 @@ main(int argc, char **argv)
|
|||||||
return (MOUNT_USAGE);
|
return (MOUNT_USAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
dataset = parse_dataset(argv[0]);
|
parse_dataset(argv[0], &pdataset);
|
||||||
|
|
||||||
/* canonicalize the mount point */
|
/* canonicalize the mount point */
|
||||||
if (realpath(argv[1], mntpoint) == NULL) {
|
if (realpath(argv[1], mntpoint) == NULL) {
|
||||||
|
|||||||
+15
-9
@@ -1120,7 +1120,21 @@ dump_zap(objset_t *os, uint64_t object, void *data, size_t size)
|
|||||||
(void) zap_lookup(os, object, attr.za_name,
|
(void) zap_lookup(os, object, attr.za_name,
|
||||||
attr.za_integer_length, attr.za_num_integers, prop);
|
attr.za_integer_length, attr.za_num_integers, prop);
|
||||||
if (attr.za_integer_length == 1) {
|
if (attr.za_integer_length == 1) {
|
||||||
(void) printf("%s", (char *)prop);
|
if (strcmp(attr.za_name,
|
||||||
|
DSL_CRYPTO_KEY_MASTER_KEY) == 0 ||
|
||||||
|
strcmp(attr.za_name,
|
||||||
|
DSL_CRYPTO_KEY_HMAC_KEY) == 0 ||
|
||||||
|
strcmp(attr.za_name, DSL_CRYPTO_KEY_IV) == 0 ||
|
||||||
|
strcmp(attr.za_name, DSL_CRYPTO_KEY_MAC) == 0 ||
|
||||||
|
strcmp(attr.za_name, DMU_POOL_CHECKSUM_SALT) == 0) {
|
||||||
|
uint8_t *u8 = prop;
|
||||||
|
|
||||||
|
for (i = 0; i < attr.za_num_integers; i++) {
|
||||||
|
(void) printf("%02x", u8[i]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
(void) printf("%s", (char *)prop);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < attr.za_num_integers; i++) {
|
for (i = 0; i < attr.za_num_integers; i++) {
|
||||||
switch (attr.za_integer_length) {
|
switch (attr.za_integer_length) {
|
||||||
@@ -5340,11 +5354,6 @@ load_unflushed_svr_segs_cb(spa_t *spa, space_map_entry_t *sme,
|
|||||||
if (txg < metaslab_unflushed_txg(ms))
|
if (txg < metaslab_unflushed_txg(ms))
|
||||||
return (0);
|
return (0);
|
||||||
|
|
||||||
vdev_indirect_mapping_t *vim = vd->vdev_indirect_mapping;
|
|
||||||
ASSERT(vim != NULL);
|
|
||||||
if (offset >= vdev_indirect_mapping_max_offset(vim))
|
|
||||||
return (0);
|
|
||||||
|
|
||||||
if (sme->sme_type == SM_ALLOC)
|
if (sme->sme_type == SM_ALLOC)
|
||||||
range_tree_add(svr->svr_allocd_segs, offset, size);
|
range_tree_add(svr->svr_allocd_segs, offset, size);
|
||||||
else
|
else
|
||||||
@@ -5407,9 +5416,6 @@ zdb_claim_removing(spa_t *spa, zdb_cb_t *zcb)
|
|||||||
for (uint64_t msi = 0; msi < vd->vdev_ms_count; msi++) {
|
for (uint64_t msi = 0; msi < vd->vdev_ms_count; msi++) {
|
||||||
metaslab_t *msp = vd->vdev_ms[msi];
|
metaslab_t *msp = vd->vdev_ms[msi];
|
||||||
|
|
||||||
if (msp->ms_start >= vdev_indirect_mapping_max_offset(vim))
|
|
||||||
break;
|
|
||||||
|
|
||||||
ASSERT0(range_tree_space(allocs));
|
ASSERT0(range_tree_space(allocs));
|
||||||
if (msp->ms_sm != NULL)
|
if (msp->ms_sm != NULL)
|
||||||
VERIFY0(space_map_load(msp->ms_sm, allocs, SM_ALLOC));
|
VERIFY0(space_map_load(msp->ms_sm, allocs, SM_ALLOC));
|
||||||
|
|||||||
+21
-20
@@ -62,9 +62,9 @@ print_log_bp(const blkptr_t *bp, const char *prefix)
|
|||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
zil_prt_rec_create(zilog_t *zilog, int txtype, void *arg)
|
zil_prt_rec_create(zilog_t *zilog, int txtype, const void *arg)
|
||||||
{
|
{
|
||||||
lr_create_t *lr = arg;
|
const lr_create_t *lr = arg;
|
||||||
time_t crtime = lr->lr_crtime[0];
|
time_t crtime = lr->lr_crtime[0];
|
||||||
char *name, *link;
|
char *name, *link;
|
||||||
lr_attr_t *lrattr;
|
lr_attr_t *lrattr;
|
||||||
@@ -98,9 +98,9 @@ zil_prt_rec_create(zilog_t *zilog, int txtype, void *arg)
|
|||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
zil_prt_rec_remove(zilog_t *zilog, int txtype, void *arg)
|
zil_prt_rec_remove(zilog_t *zilog, int txtype, const void *arg)
|
||||||
{
|
{
|
||||||
lr_remove_t *lr = arg;
|
const lr_remove_t *lr = arg;
|
||||||
|
|
||||||
(void) printf("%sdoid %llu, name %s\n", tab_prefix,
|
(void) printf("%sdoid %llu, name %s\n", tab_prefix,
|
||||||
(u_longlong_t)lr->lr_doid, (char *)(lr + 1));
|
(u_longlong_t)lr->lr_doid, (char *)(lr + 1));
|
||||||
@@ -108,9 +108,9 @@ zil_prt_rec_remove(zilog_t *zilog, int txtype, void *arg)
|
|||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
zil_prt_rec_link(zilog_t *zilog, int txtype, void *arg)
|
zil_prt_rec_link(zilog_t *zilog, int txtype, const void *arg)
|
||||||
{
|
{
|
||||||
lr_link_t *lr = arg;
|
const lr_link_t *lr = arg;
|
||||||
|
|
||||||
(void) printf("%sdoid %llu, link_obj %llu, name %s\n", tab_prefix,
|
(void) printf("%sdoid %llu, link_obj %llu, name %s\n", tab_prefix,
|
||||||
(u_longlong_t)lr->lr_doid, (u_longlong_t)lr->lr_link_obj,
|
(u_longlong_t)lr->lr_doid, (u_longlong_t)lr->lr_link_obj,
|
||||||
@@ -119,9 +119,9 @@ zil_prt_rec_link(zilog_t *zilog, int txtype, void *arg)
|
|||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
zil_prt_rec_rename(zilog_t *zilog, int txtype, void *arg)
|
zil_prt_rec_rename(zilog_t *zilog, int txtype, const void *arg)
|
||||||
{
|
{
|
||||||
lr_rename_t *lr = arg;
|
const lr_rename_t *lr = arg;
|
||||||
char *snm = (char *)(lr + 1);
|
char *snm = (char *)(lr + 1);
|
||||||
char *tnm = snm + strlen(snm) + 1;
|
char *tnm = snm + strlen(snm) + 1;
|
||||||
|
|
||||||
@@ -148,11 +148,11 @@ zil_prt_rec_write_cb(void *data, size_t len, void *unused)
|
|||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
zil_prt_rec_write(zilog_t *zilog, int txtype, void *arg)
|
zil_prt_rec_write(zilog_t *zilog, int txtype, const void *arg)
|
||||||
{
|
{
|
||||||
lr_write_t *lr = arg;
|
const lr_write_t *lr = arg;
|
||||||
abd_t *data;
|
abd_t *data;
|
||||||
blkptr_t *bp = &lr->lr_blkptr;
|
const blkptr_t *bp = &lr->lr_blkptr;
|
||||||
zbookmark_phys_t zb;
|
zbookmark_phys_t zb;
|
||||||
int verbose = MAX(dump_opt['d'], dump_opt['i']);
|
int verbose = MAX(dump_opt['d'], dump_opt['i']);
|
||||||
int error;
|
int error;
|
||||||
@@ -211,9 +211,9 @@ out:
|
|||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
zil_prt_rec_truncate(zilog_t *zilog, int txtype, void *arg)
|
zil_prt_rec_truncate(zilog_t *zilog, int txtype, const void *arg)
|
||||||
{
|
{
|
||||||
lr_truncate_t *lr = arg;
|
const lr_truncate_t *lr = arg;
|
||||||
|
|
||||||
(void) printf("%sfoid %llu, offset 0x%llx, length 0x%llx\n", tab_prefix,
|
(void) printf("%sfoid %llu, offset 0x%llx, length 0x%llx\n", tab_prefix,
|
||||||
(u_longlong_t)lr->lr_foid, (longlong_t)lr->lr_offset,
|
(u_longlong_t)lr->lr_foid, (longlong_t)lr->lr_offset,
|
||||||
@@ -222,9 +222,9 @@ zil_prt_rec_truncate(zilog_t *zilog, int txtype, void *arg)
|
|||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
zil_prt_rec_setattr(zilog_t *zilog, int txtype, void *arg)
|
zil_prt_rec_setattr(zilog_t *zilog, int txtype, const void *arg)
|
||||||
{
|
{
|
||||||
lr_setattr_t *lr = arg;
|
const lr_setattr_t *lr = arg;
|
||||||
time_t atime = (time_t)lr->lr_atime[0];
|
time_t atime = (time_t)lr->lr_atime[0];
|
||||||
time_t mtime = (time_t)lr->lr_mtime[0];
|
time_t mtime = (time_t)lr->lr_mtime[0];
|
||||||
|
|
||||||
@@ -268,15 +268,15 @@ zil_prt_rec_setattr(zilog_t *zilog, int txtype, void *arg)
|
|||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
zil_prt_rec_acl(zilog_t *zilog, int txtype, void *arg)
|
zil_prt_rec_acl(zilog_t *zilog, int txtype, const void *arg)
|
||||||
{
|
{
|
||||||
lr_acl_t *lr = arg;
|
const lr_acl_t *lr = arg;
|
||||||
|
|
||||||
(void) printf("%sfoid %llu, aclcnt %llu\n", tab_prefix,
|
(void) printf("%sfoid %llu, aclcnt %llu\n", tab_prefix,
|
||||||
(u_longlong_t)lr->lr_foid, (u_longlong_t)lr->lr_aclcnt);
|
(u_longlong_t)lr->lr_foid, (u_longlong_t)lr->lr_aclcnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef void (*zil_prt_rec_func_t)(zilog_t *, int, void *);
|
typedef void (*zil_prt_rec_func_t)(zilog_t *, int, const void *);
|
||||||
typedef struct zil_rec_info {
|
typedef struct zil_rec_info {
|
||||||
zil_prt_rec_func_t zri_print;
|
zil_prt_rec_func_t zri_print;
|
||||||
const char *zri_name;
|
const char *zri_name;
|
||||||
@@ -309,7 +309,7 @@ static zil_rec_info_t zil_rec_info[TX_MAX_TYPE] = {
|
|||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static int
|
static int
|
||||||
print_log_record(zilog_t *zilog, lr_t *lr, void *arg, uint64_t claim_txg)
|
print_log_record(zilog_t *zilog, const lr_t *lr, void *arg, uint64_t claim_txg)
|
||||||
{
|
{
|
||||||
int txtype;
|
int txtype;
|
||||||
int verbose = MAX(dump_opt['d'], dump_opt['i']);
|
int verbose = MAX(dump_opt['d'], dump_opt['i']);
|
||||||
@@ -343,7 +343,8 @@ print_log_record(zilog_t *zilog, lr_t *lr, void *arg, uint64_t claim_txg)
|
|||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static int
|
static int
|
||||||
print_log_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg)
|
print_log_block(zilog_t *zilog, const blkptr_t *bp, void *arg,
|
||||||
|
uint64_t claim_txg)
|
||||||
{
|
{
|
||||||
char blkbuf[BP_SPRINTF_LEN + 10];
|
char blkbuf[BP_SPRINTF_LEN + 10];
|
||||||
int verbose = MAX(dump_opt['d'], dump_opt['i']);
|
int verbose = MAX(dump_opt['d'], dump_opt['i']);
|
||||||
|
|||||||
@@ -177,9 +177,9 @@ zfs_agent_post_event(const char *class, const char *subclass, nvlist_t *nvl)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* On ZFS on Linux, we don't get the expected FM_RESOURCE_REMOVED
|
* On Linux, we don't get the expected FM_RESOURCE_REMOVED ereport
|
||||||
* ereport from vdev_disk layer after a hot unplug. Fortunately we
|
* from the vdev_disk layer after a hot unplug. Fortunately we do
|
||||||
* get a 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.
|
||||||
*/
|
*/
|
||||||
if ((strcmp(class, EC_DEV_REMOVE) == 0) &&
|
if ((strcmp(class, EC_DEV_REMOVE) == 0) &&
|
||||||
|
|||||||
@@ -63,9 +63,7 @@
|
|||||||
* If the device could not be replaced, then the second online attempt will
|
* If the device could not be replaced, then the second online attempt will
|
||||||
* trigger the FMA fault that we skipped earlier.
|
* trigger the FMA fault that we skipped earlier.
|
||||||
*
|
*
|
||||||
* ZFS on Linux porting notes:
|
* On Linux udev provides a disk insert for both the disk and the partition.
|
||||||
* Linux udev provides a disk insert for both the disk and the partition
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|||||||
@@ -364,7 +364,7 @@ zfs_retire_recv(fmd_hdl_t *hdl, fmd_event_t *ep, nvlist_t *nvl,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note: on zfsonlinux statechange events are more than just
|
* Note: on Linux statechange events are more than just
|
||||||
* healthy ones so we need to confirm the actual state value.
|
* healthy ones so we need to confirm the actual state value.
|
||||||
*/
|
*/
|
||||||
if (strcmp(class, "resource.fs.zfs.statechange") == 0 &&
|
if (strcmp(class, "resource.fs.zfs.statechange") == 0 &&
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED)
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
* for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
|
*
|
||||||
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
||||||
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
||||||
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
||||||
|
|||||||
@@ -1,14 +1,50 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
||||||
|
# Copyright (c) 2020 by Delphix. All rights reserved.
|
||||||
|
#
|
||||||
|
|
||||||
#
|
#
|
||||||
# Log the zevent via syslog.
|
# Log the zevent via syslog.
|
||||||
|
#
|
||||||
|
|
||||||
[ -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
|
zed_exit_if_ignoring_this_event
|
||||||
|
|
||||||
zed_log_msg "eid=${ZEVENT_EID}" "class=${ZEVENT_SUBCLASS}" \
|
# build a string of name=value pairs for this event
|
||||||
"${ZEVENT_POOL_GUID:+"pool_guid=${ZEVENT_POOL_GUID}"}" \
|
msg="eid=${ZEVENT_EID} class=${ZEVENT_SUBCLASS}"
|
||||||
"${ZEVENT_VDEV_PATH:+"vdev_path=${ZEVENT_VDEV_PATH}"}" \
|
|
||||||
"${ZEVENT_VDEV_STATE_STR:+"vdev_state=${ZEVENT_VDEV_STATE_STR}"}"
|
if [ "${ZED_SYSLOG_DISPLAY_GUIDS}" = "1" ]; then
|
||||||
|
[ -n "${ZEVENT_POOL_GUID}" ] && msg="${msg} pool_guid=${ZEVENT_POOL_GUID}"
|
||||||
|
[ -n "${ZEVENT_VDEV_GUID}" ] && msg="${msg} vdev_guid=${ZEVENT_VDEV_GUID}"
|
||||||
|
else
|
||||||
|
[ -n "${ZEVENT_POOL}" ] && msg="${msg} pool='${ZEVENT_POOL}'"
|
||||||
|
[ -n "${ZEVENT_VDEV_PATH}" ] && msg="${msg} vdev=$(basename "${ZEVENT_VDEV_PATH}")"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# log pool state if state is anything other than 'ACTIVE'
|
||||||
|
[ -n "${ZEVENT_POOL_STATE_STR}" ] && [ "$ZEVENT_POOL_STATE" -ne 0 ] && \
|
||||||
|
msg="${msg} pool_state=${ZEVENT_POOL_STATE_STR}"
|
||||||
|
|
||||||
|
# Log the following payload nvpairs if they are present
|
||||||
|
[ -n "${ZEVENT_VDEV_STATE_STR}" ] && msg="${msg} vdev_state=${ZEVENT_VDEV_STATE_STR}"
|
||||||
|
[ -n "${ZEVENT_CKSUM_ALGORITHM}" ] && msg="${msg} algorithm=${ZEVENT_CKSUM_ALGORITHM}"
|
||||||
|
[ -n "${ZEVENT_ZIO_SIZE}" ] && msg="${msg} size=${ZEVENT_ZIO_SIZE}"
|
||||||
|
[ -n "${ZEVENT_ZIO_OFFSET}" ] && msg="${msg} offset=${ZEVENT_ZIO_OFFSET}"
|
||||||
|
[ -n "${ZEVENT_ZIO_PRIORITY}" ] && msg="${msg} priority=${ZEVENT_ZIO_PRIORITY}"
|
||||||
|
[ -n "${ZEVENT_ZIO_ERR}" ] && msg="${msg} err=${ZEVENT_ZIO_ERR}"
|
||||||
|
[ -n "${ZEVENT_ZIO_FLAGS}" ] && msg="${msg} flags=$(printf '0x%x' "${ZEVENT_ZIO_FLAGS}")"
|
||||||
|
|
||||||
|
# log delays that are >= 10 milisec
|
||||||
|
[ -n "${ZEVENT_ZIO_DELAY}" ] && [ "$ZEVENT_ZIO_DELAY" -gt 10000000 ] && \
|
||||||
|
msg="${msg} delay=$((ZEVENT_ZIO_DELAY / 1000000))ms"
|
||||||
|
|
||||||
|
# list the bookmark data together
|
||||||
|
[ -n "${ZEVENT_ZIO_OBJSET}" ] && \
|
||||||
|
msg="${msg} bookmark=${ZEVENT_ZIO_OBJSET}:${ZEVENT_ZIO_OBJECT}:${ZEVENT_ZIO_LEVEL}:${ZEVENT_ZIO_BLKID}"
|
||||||
|
|
||||||
|
zed_log_msg "${msg}"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@@ -118,5 +118,10 @@ ZED_USE_ENCLOSURE_LEDS=1
|
|||||||
# Otherwise, if ZED_SYSLOG_SUBCLASS_EXCLUDE is set, the
|
# Otherwise, if ZED_SYSLOG_SUBCLASS_EXCLUDE is set, the
|
||||||
# matching subclasses are excluded from logging.
|
# matching subclasses are excluded from logging.
|
||||||
#ZED_SYSLOG_SUBCLASS_INCLUDE="checksum|scrub_*|vdev.*"
|
#ZED_SYSLOG_SUBCLASS_INCLUDE="checksum|scrub_*|vdev.*"
|
||||||
#ZED_SYSLOG_SUBCLASS_EXCLUDE="statechange|config_*|history_event"
|
ZED_SYSLOG_SUBCLASS_EXCLUDE="history_event"
|
||||||
|
|
||||||
|
##
|
||||||
|
# Use GUIDs instead of names when logging pool and vdevs
|
||||||
|
# Disabled by default, 1 to enable and 0 to disable.
|
||||||
|
#ZED_SYSLOG_DISPLAY_GUIDS=1
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED)
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
* for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
|
*
|
||||||
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
||||||
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
||||||
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED)
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
* for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
|
*
|
||||||
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
||||||
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
||||||
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED)
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
* for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
|
*
|
||||||
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
||||||
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
||||||
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED)
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
* for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
|
*
|
||||||
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
||||||
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
||||||
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED)
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
* for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
|
*
|
||||||
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
||||||
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
||||||
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED)
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
* for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
|
*
|
||||||
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
||||||
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
||||||
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED)
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
* for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
|
*
|
||||||
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
||||||
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
||||||
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED)
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
* for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
|
*
|
||||||
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
||||||
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
||||||
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED)
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
* for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
|
*
|
||||||
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
||||||
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
||||||
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED)
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
* for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
|
*
|
||||||
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
||||||
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
||||||
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED)
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
* for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
|
*
|
||||||
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
||||||
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
||||||
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED)
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
* for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
|
*
|
||||||
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
||||||
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
||||||
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of the ZFS Event Daemon (ZED)
|
* This file is part of the ZFS Event Daemon (ZED).
|
||||||
* for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
|
*
|
||||||
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
* Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
|
||||||
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
* Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
|
||||||
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
* Refer to the ZoL git commit log for authoritative copyright attribution.
|
||||||
|
|||||||
+48
-28
@@ -311,7 +311,8 @@ get_usage(zfs_help_t idx)
|
|||||||
case HELP_RENAME:
|
case HELP_RENAME:
|
||||||
return (gettext("\trename [-f] <filesystem|volume|snapshot> "
|
return (gettext("\trename [-f] <filesystem|volume|snapshot> "
|
||||||
"<filesystem|volume|snapshot>\n"
|
"<filesystem|volume|snapshot>\n"
|
||||||
"\trename [-f] -p <filesystem|volume> <filesystem|volume>\n"
|
"\trename -p [-f] <filesystem|volume> <filesystem|volume>\n"
|
||||||
|
"\trename -u [-f] <filesystem> <filesystem>\n"
|
||||||
"\trename -r <snapshot> <snapshot>\n"));
|
"\trename -r <snapshot> <snapshot>\n"));
|
||||||
case HELP_ROLLBACK:
|
case HELP_ROLLBACK:
|
||||||
return (gettext("\trollback [-rRf] <snapshot>\n"));
|
return (gettext("\trollback [-rRf] <snapshot>\n"));
|
||||||
@@ -362,16 +363,16 @@ get_usage(zfs_help_t idx)
|
|||||||
return (gettext("\tuserspace [-Hinp] [-o field[,...]] "
|
return (gettext("\tuserspace [-Hinp] [-o field[,...]] "
|
||||||
"[-s field] ...\n"
|
"[-s field] ...\n"
|
||||||
"\t [-S field] ... [-t type[,...]] "
|
"\t [-S field] ... [-t type[,...]] "
|
||||||
"<filesystem|snapshot>\n"));
|
"<filesystem|snapshot|path>\n"));
|
||||||
case HELP_GROUPSPACE:
|
case HELP_GROUPSPACE:
|
||||||
return (gettext("\tgroupspace [-Hinp] [-o field[,...]] "
|
return (gettext("\tgroupspace [-Hinp] [-o field[,...]] "
|
||||||
"[-s field] ...\n"
|
"[-s field] ...\n"
|
||||||
"\t [-S field] ... [-t type[,...]] "
|
"\t [-S field] ... [-t type[,...]] "
|
||||||
"<filesystem|snapshot>\n"));
|
"<filesystem|snapshot|path>\n"));
|
||||||
case HELP_PROJECTSPACE:
|
case HELP_PROJECTSPACE:
|
||||||
return (gettext("\tprojectspace [-Hp] [-o field[,...]] "
|
return (gettext("\tprojectspace [-Hp] [-o field[,...]] "
|
||||||
"[-s field] ... \n"
|
"[-s field] ... \n"
|
||||||
"\t [-S field] ... <filesystem|snapshot>\n"));
|
"\t [-S field] ... <filesystem|snapshot|path>\n"));
|
||||||
case HELP_PROJECT:
|
case HELP_PROJECT:
|
||||||
return (gettext("\tproject [-d|-r] <directory|file ...>\n"
|
return (gettext("\tproject [-d|-r] <directory|file ...>\n"
|
||||||
"\tproject -c [-0] [-d|-r] [-p id] <directory|file ...>\n"
|
"\tproject -c [-0] [-d|-r] [-p id] <directory|file ...>\n"
|
||||||
@@ -401,7 +402,7 @@ get_usage(zfs_help_t idx)
|
|||||||
"<-a | filesystem|volume>\n"));
|
"<-a | filesystem|volume>\n"));
|
||||||
case HELP_CHANGE_KEY:
|
case HELP_CHANGE_KEY:
|
||||||
return (gettext("\tchange-key [-l] [-o keyformat=<value>]\n"
|
return (gettext("\tchange-key [-l] [-o keyformat=<value>]\n"
|
||||||
"\t [-o keylocation=<value>] [-o pbkfd2iters=<value>]\n"
|
"\t [-o keylocation=<value>] [-o pbkdf2iters=<value>]\n"
|
||||||
"\t <filesystem|volume>\n"
|
"\t <filesystem|volume>\n"
|
||||||
"\tchange-key -i [-l] <filesystem|volume>\n"));
|
"\tchange-key -i [-l] <filesystem|volume>\n"));
|
||||||
case HELP_VERSION:
|
case HELP_VERSION:
|
||||||
@@ -2480,11 +2481,13 @@ zfs_do_upgrade(int argc, char **argv)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* zfs userspace [-Hinp] [-o field[,...]] [-s field [-s field]...]
|
* zfs userspace [-Hinp] [-o field[,...]] [-s field [-s field]...]
|
||||||
* [-S field [-S field]...] [-t type[,...]] filesystem | snapshot
|
* [-S field [-S field]...] [-t type[,...]]
|
||||||
|
* filesystem | snapshot | path
|
||||||
* zfs groupspace [-Hinp] [-o field[,...]] [-s field [-s field]...]
|
* zfs groupspace [-Hinp] [-o field[,...]] [-s field [-s field]...]
|
||||||
* [-S field [-S field]...] [-t type[,...]] filesystem | snapshot
|
* [-S field [-S field]...] [-t type[,...]]
|
||||||
|
* filesystem | snapshot | path
|
||||||
* zfs projectspace [-Hp] [-o field[,...]] [-s field [-s field]...]
|
* zfs projectspace [-Hp] [-o field[,...]] [-s field [-s field]...]
|
||||||
* [-S field [-S field]...] filesystem | snapshot
|
* [-S field [-S field]...] filesystem | snapshot | path
|
||||||
*
|
*
|
||||||
* -H Scripted mode; elide headers and separate columns by tabs.
|
* -H Scripted mode; elide headers and separate columns by tabs.
|
||||||
* -i Translate SID to POSIX ID.
|
* -i Translate SID to POSIX ID.
|
||||||
@@ -3190,7 +3193,7 @@ zfs_do_userspace(int argc, char **argv)
|
|||||||
} while (delim != NULL);
|
} while (delim != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((zhp = zfs_open(g_zfs, argv[0], ZFS_TYPE_FILESYSTEM |
|
if ((zhp = zfs_path_to_zhandle(g_zfs, argv[0], ZFS_TYPE_FILESYSTEM |
|
||||||
ZFS_TYPE_SNAPSHOT)) == NULL)
|
ZFS_TYPE_SNAPSHOT)) == NULL)
|
||||||
return (1);
|
return (1);
|
||||||
if (zhp->zfs_head_type != ZFS_TYPE_FILESYSTEM) {
|
if (zhp->zfs_head_type != ZFS_TYPE_FILESYSTEM) {
|
||||||
@@ -3603,36 +3606,40 @@ zfs_do_list(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* zfs rename [-f] <fs | snap | vol> <fs | snap | vol>
|
* zfs rename [-fu] <fs | snap | vol> <fs | snap | vol>
|
||||||
* zfs rename [-f] -p <fs | vol> <fs | vol>
|
* zfs rename [-f] -p <fs | vol> <fs | vol>
|
||||||
* zfs rename -r <snap> <snap>
|
* zfs rename [-u] -r <snap> <snap>
|
||||||
*
|
*
|
||||||
* Renames the given dataset to another of the same type.
|
* Renames the given dataset to another of the same type.
|
||||||
*
|
*
|
||||||
* The '-p' flag creates all the non-existing ancestors of the target first.
|
* The '-p' flag creates all the non-existing ancestors of the target first.
|
||||||
|
* The '-u' flag prevents file systems from being remounted during rename.
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static int
|
static int
|
||||||
zfs_do_rename(int argc, char **argv)
|
zfs_do_rename(int argc, char **argv)
|
||||||
{
|
{
|
||||||
zfs_handle_t *zhp;
|
zfs_handle_t *zhp;
|
||||||
|
renameflags_t flags = { 0 };
|
||||||
int c;
|
int c;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
boolean_t recurse = B_FALSE;
|
int types;
|
||||||
boolean_t parents = B_FALSE;
|
boolean_t parents = B_FALSE;
|
||||||
boolean_t force_unmount = B_FALSE;
|
|
||||||
|
|
||||||
/* check options */
|
/* check options */
|
||||||
while ((c = getopt(argc, argv, "prf")) != -1) {
|
while ((c = getopt(argc, argv, "pruf")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'p':
|
case 'p':
|
||||||
parents = B_TRUE;
|
parents = B_TRUE;
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
recurse = B_TRUE;
|
flags.recursive = B_TRUE;
|
||||||
|
break;
|
||||||
|
case 'u':
|
||||||
|
flags.nounmount = B_TRUE;
|
||||||
break;
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
force_unmount = B_TRUE;
|
flags.forceunmount = B_TRUE;
|
||||||
break;
|
break;
|
||||||
case '?':
|
case '?':
|
||||||
default:
|
default:
|
||||||
@@ -3661,20 +3668,32 @@ zfs_do_rename(int argc, char **argv)
|
|||||||
usage(B_FALSE);
|
usage(B_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recurse && parents) {
|
if (flags.recursive && parents) {
|
||||||
(void) fprintf(stderr, gettext("-p and -r options are mutually "
|
(void) fprintf(stderr, gettext("-p and -r options are mutually "
|
||||||
"exclusive\n"));
|
"exclusive\n"));
|
||||||
usage(B_FALSE);
|
usage(B_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recurse && strchr(argv[0], '@') == 0) {
|
if (flags.nounmount && parents) {
|
||||||
|
(void) fprintf(stderr, gettext("-u and -p options are mutually "
|
||||||
|
"exclusive\n"));
|
||||||
|
usage(B_FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flags.recursive && strchr(argv[0], '@') == 0) {
|
||||||
(void) fprintf(stderr, gettext("source dataset for recursive "
|
(void) fprintf(stderr, gettext("source dataset for recursive "
|
||||||
"rename must be a snapshot\n"));
|
"rename must be a snapshot\n"));
|
||||||
usage(B_FALSE);
|
usage(B_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((zhp = zfs_open(g_zfs, argv[0], parents ? ZFS_TYPE_FILESYSTEM |
|
if (flags.nounmount)
|
||||||
ZFS_TYPE_VOLUME : ZFS_TYPE_DATASET)) == NULL)
|
types = ZFS_TYPE_FILESYSTEM;
|
||||||
|
else if (parents)
|
||||||
|
types = ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME;
|
||||||
|
else
|
||||||
|
types = ZFS_TYPE_DATASET;
|
||||||
|
|
||||||
|
if ((zhp = zfs_open(g_zfs, argv[0], types)) == NULL)
|
||||||
return (1);
|
return (1);
|
||||||
|
|
||||||
/* If we were asked and the name looks good, try to create ancestors. */
|
/* If we were asked and the name looks good, try to create ancestors. */
|
||||||
@@ -3684,7 +3703,7 @@ zfs_do_rename(int argc, char **argv)
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = (zfs_rename(zhp, argv[1], recurse, force_unmount) != 0);
|
ret = (zfs_rename(zhp, argv[1], flags) != 0);
|
||||||
|
|
||||||
zfs_close(zhp);
|
zfs_close(zhp);
|
||||||
return (ret);
|
return (ret);
|
||||||
@@ -6577,9 +6596,9 @@ share_mount_one(zfs_handle_t *zhp, int op, int flags, char *protocol,
|
|||||||
|
|
||||||
(void) fprintf(stderr, gettext("cannot share '%s': "
|
(void) fprintf(stderr, gettext("cannot share '%s': "
|
||||||
"legacy share\n"), zfs_get_name(zhp));
|
"legacy share\n"), zfs_get_name(zhp));
|
||||||
(void) fprintf(stderr, gettext("use share(1M) to "
|
(void) fprintf(stderr, gettext("use exports(5) or "
|
||||||
"share this filesystem, or set "
|
"smb.conf(5) to share this filesystem, or set "
|
||||||
"sharenfs property on\n"));
|
"the sharenfs or sharesmb property\n"));
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6594,7 +6613,7 @@ share_mount_one(zfs_handle_t *zhp, int op, int flags, char *protocol,
|
|||||||
|
|
||||||
(void) fprintf(stderr, gettext("cannot %s '%s': "
|
(void) fprintf(stderr, gettext("cannot %s '%s': "
|
||||||
"legacy mountpoint\n"), cmdname, zfs_get_name(zhp));
|
"legacy mountpoint\n"), cmdname, zfs_get_name(zhp));
|
||||||
(void) fprintf(stderr, gettext("use %s(1M) to "
|
(void) fprintf(stderr, gettext("use %s(8) to "
|
||||||
"%s this filesystem\n"), cmdname, cmdname);
|
"%s this filesystem\n"), cmdname, cmdname);
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
@@ -7397,8 +7416,8 @@ unshare_unmount(int op, int argc, char **argv)
|
|||||||
"unshare '%s': legacy share\n"),
|
"unshare '%s': legacy share\n"),
|
||||||
zfs_get_name(zhp));
|
zfs_get_name(zhp));
|
||||||
(void) fprintf(stderr, gettext("use "
|
(void) fprintf(stderr, gettext("use "
|
||||||
"unshare(1M) to unshare this "
|
"exports(5) or smb.conf(5) to unshare "
|
||||||
"filesystem\n"));
|
"this filesystem\n"));
|
||||||
ret = 1;
|
ret = 1;
|
||||||
} else if (!zfs_is_shared(zhp)) {
|
} else if (!zfs_is_shared(zhp)) {
|
||||||
(void) fprintf(stderr, gettext("cannot "
|
(void) fprintf(stderr, gettext("cannot "
|
||||||
@@ -7416,7 +7435,7 @@ unshare_unmount(int op, int argc, char **argv)
|
|||||||
"unmount '%s': legacy "
|
"unmount '%s': legacy "
|
||||||
"mountpoint\n"), zfs_get_name(zhp));
|
"mountpoint\n"), zfs_get_name(zhp));
|
||||||
(void) fprintf(stderr, gettext("use "
|
(void) fprintf(stderr, gettext("use "
|
||||||
"umount(1M) to unmount this "
|
"umount(8) to unmount this "
|
||||||
"filesystem\n"));
|
"filesystem\n"));
|
||||||
ret = 1;
|
ret = 1;
|
||||||
} else if (!zfs_is_mounted(zhp, NULL)) {
|
} else if (!zfs_is_mounted(zhp, NULL)) {
|
||||||
@@ -8451,6 +8470,7 @@ main(int argc, char **argv)
|
|||||||
char **newargv;
|
char **newargv;
|
||||||
|
|
||||||
(void) setlocale(LC_ALL, "");
|
(void) setlocale(LC_ALL, "");
|
||||||
|
(void) setlocale(LC_NUMERIC, "C");
|
||||||
(void) textdomain(TEXT_DOMAIN);
|
(void) textdomain(TEXT_DOMAIN);
|
||||||
|
|
||||||
opterr = 0;
|
opterr = 0;
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
/zgenhostid
|
||||||
@@ -1 +1,5 @@
|
|||||||
dist_bin_SCRIPTS = zgenhostid
|
include $(top_srcdir)/config/Rules.am
|
||||||
|
|
||||||
|
bin_PROGRAMS = zgenhostid
|
||||||
|
|
||||||
|
zgenhostid_SOURCES = zgenhostid.c
|
||||||
|
|||||||
@@ -1,61 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Emulate genhostid(1) available on RHEL/CENTOS, for use on distros
|
|
||||||
# which do not provide that utility.
|
|
||||||
#
|
|
||||||
# Usage:
|
|
||||||
# zgenhostid
|
|
||||||
# zgenhostid <value>
|
|
||||||
#
|
|
||||||
# If /etc/hostid already exists and is size > 0, the script exits immediately
|
|
||||||
# and changes nothing. Unlike genhostid, this generates an error message.
|
|
||||||
#
|
|
||||||
# The first form generates a random hostid and stores it in /etc/hostid.
|
|
||||||
# The second form checks that the provided value is between 0x1 and 0xFFFFFFFF
|
|
||||||
# and if so, stores it in /etc/hostid. This form is not supported by
|
|
||||||
# genhostid(1).
|
|
||||||
|
|
||||||
hostid_file=/etc/hostid
|
|
||||||
|
|
||||||
function usage {
|
|
||||||
echo "$0 [value]"
|
|
||||||
echo "If $hostid_file is not present, store a hostid in it." >&2
|
|
||||||
echo "The optional value must be an 8-digit hex number between" >&2
|
|
||||||
echo "1 and 2^32-1. If no value is provided, a random one will" >&2
|
|
||||||
echo "be generated. The value must be unique among your systems." >&2
|
|
||||||
}
|
|
||||||
|
|
||||||
# hostid(1) ignores contents of /etc/hostid if size < 4 bytes. It would
|
|
||||||
# be better if this checked size >= 4 bytes but it the method must be
|
|
||||||
# widely portable.
|
|
||||||
if [ -s $hostid_file ]; then
|
|
||||||
echo "$hostid_file already exists. No change made." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$1" ]; then
|
|
||||||
host_id=$1
|
|
||||||
else
|
|
||||||
# $RANDOM goes from 0..32k-1
|
|
||||||
number=$((((RANDOM % 4) * 32768 + RANDOM) * 32768 + RANDOM))
|
|
||||||
host_id=$(printf "%08x" $number)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if egrep -o '^0{8}$' <<< $host_id >/dev/null 2>&1; then
|
|
||||||
usage
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! egrep -o '^[a-fA-F0-9]{8}$' <<< $host_id >/dev/null 2>&1; then
|
|
||||||
usage
|
|
||||||
exit 3
|
|
||||||
fi
|
|
||||||
|
|
||||||
a=${host_id:6:2}
|
|
||||||
b=${host_id:4:2}
|
|
||||||
c=${host_id:2:2}
|
|
||||||
d=${host_id:0:2}
|
|
||||||
|
|
||||||
echo -ne \\x$a\\x$b\\x$c\\x$d > $hostid_file
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
@@ -0,0 +1,152 @@
|
|||||||
|
/*
|
||||||
|
* 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) 2020, Georgy Yakovlev. All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <getopt.h>
|
||||||
|
#include <inttypes.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
static void usage(void);
|
||||||
|
|
||||||
|
static void
|
||||||
|
usage(void)
|
||||||
|
{
|
||||||
|
(void) fprintf(stderr,
|
||||||
|
"usage: zgenhostid [-fh] [-o path] [value]\n\n"
|
||||||
|
" -f\t\t force hostid file write\n"
|
||||||
|
" -h\t\t print this usage and exit\n"
|
||||||
|
" -o <filename>\t write hostid to this file\n\n"
|
||||||
|
"If hostid file is not present, store a hostid in it.\n"
|
||||||
|
"The optional value should be an 8-digit hex number between"
|
||||||
|
" 1 and 2^32-1.\n"
|
||||||
|
"If the value is 0 or no value is provided, a random one"
|
||||||
|
" will be generated.\n"
|
||||||
|
"The value must be unique among your systems.\n");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
/* NOTREACHED */
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
/* default file path, can be optionally set by user */
|
||||||
|
char path[PATH_MAX] = "/etc/hostid";
|
||||||
|
/* holds converted user input or lrand48() generated value */
|
||||||
|
unsigned long input_i = 0;
|
||||||
|
|
||||||
|
int opt;
|
||||||
|
int pathlen;
|
||||||
|
int force_fwrite = 0;
|
||||||
|
while ((opt = getopt_long(argc, argv, "fo:h?", 0, 0)) != -1) {
|
||||||
|
switch (opt) {
|
||||||
|
case 'f':
|
||||||
|
force_fwrite = 1;
|
||||||
|
break;
|
||||||
|
case 'o':
|
||||||
|
pathlen = snprintf(path, sizeof (path), "%s", optarg);
|
||||||
|
if (pathlen >= sizeof (path)) {
|
||||||
|
fprintf(stderr, "%s\n", strerror(EOVERFLOW));
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
} else if (pathlen < 1) {
|
||||||
|
fprintf(stderr, "%s\n", strerror(EINVAL));
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'h':
|
||||||
|
case '?':
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
char *in_s = argv[optind];
|
||||||
|
if (in_s != NULL) {
|
||||||
|
/* increment pointer by 2 if string is 0x prefixed */
|
||||||
|
if (strncasecmp("0x", in_s, 2) == 0) {
|
||||||
|
in_s += 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* need to be exactly 8 characters */
|
||||||
|
const char *hex = "0123456789abcdefABCDEF";
|
||||||
|
if (strlen(in_s) != 8 || strspn(in_s, hex) != 8) {
|
||||||
|
fprintf(stderr, "%s\n", strerror(ERANGE));
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
|
||||||
|
input_i = strtoul(in_s, NULL, 16);
|
||||||
|
if (errno != 0) {
|
||||||
|
perror("strtoul");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (input_i > UINT32_MAX) {
|
||||||
|
fprintf(stderr, "%s\n", strerror(ERANGE));
|
||||||
|
usage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
struct stat fstat;
|
||||||
|
if (force_fwrite == 0 && stat(path, &fstat) == 0 &&
|
||||||
|
S_ISREG(fstat.st_mode)) {
|
||||||
|
fprintf(stderr, "%s: %s\n", path, strerror(EEXIST));
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* generate if not provided by user
|
||||||
|
* also handle unlikely zero return from lrand48()
|
||||||
|
*/
|
||||||
|
while (input_i == 0) {
|
||||||
|
srand48(getpid() ^ time(NULL));
|
||||||
|
input_i = lrand48();
|
||||||
|
}
|
||||||
|
|
||||||
|
FILE *fp = fopen(path, "wb");
|
||||||
|
if (!fp) {
|
||||||
|
perror("fopen");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* we need just 4 bytes in native endianess
|
||||||
|
* not using sethostid() because it may be missing or just a stub
|
||||||
|
*/
|
||||||
|
uint32_t hostid = input_i;
|
||||||
|
int written = fwrite(&hostid, 1, 4, fp);
|
||||||
|
if (written != 4) {
|
||||||
|
perror("fwrite");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose(fp);
|
||||||
|
exit(EXIT_SUCCESS);
|
||||||
|
}
|
||||||
+11
-5
@@ -56,6 +56,7 @@ typedef struct zpool_node {
|
|||||||
|
|
||||||
struct zpool_list {
|
struct zpool_list {
|
||||||
boolean_t zl_findall;
|
boolean_t zl_findall;
|
||||||
|
boolean_t zl_literal;
|
||||||
uu_avl_t *zl_avl;
|
uu_avl_t *zl_avl;
|
||||||
uu_avl_pool_t *zl_pool;
|
uu_avl_pool_t *zl_pool;
|
||||||
zprop_list_t **zl_proplist;
|
zprop_list_t **zl_proplist;
|
||||||
@@ -88,7 +89,9 @@ add_pool(zpool_handle_t *zhp, void *data)
|
|||||||
uu_avl_node_init(node, &node->zn_avlnode, zlp->zl_pool);
|
uu_avl_node_init(node, &node->zn_avlnode, zlp->zl_pool);
|
||||||
if (uu_avl_find(zlp->zl_avl, node, NULL, &idx) == NULL) {
|
if (uu_avl_find(zlp->zl_avl, node, NULL, &idx) == NULL) {
|
||||||
if (zlp->zl_proplist &&
|
if (zlp->zl_proplist &&
|
||||||
zpool_expand_proplist(zhp, zlp->zl_proplist) != 0) {
|
zpool_expand_proplist(zhp, zlp->zl_proplist,
|
||||||
|
zlp->zl_literal)
|
||||||
|
!= 0) {
|
||||||
zpool_close(zhp);
|
zpool_close(zhp);
|
||||||
free(node);
|
free(node);
|
||||||
return (-1);
|
return (-1);
|
||||||
@@ -110,7 +113,8 @@ add_pool(zpool_handle_t *zhp, void *data)
|
|||||||
* line.
|
* line.
|
||||||
*/
|
*/
|
||||||
zpool_list_t *
|
zpool_list_t *
|
||||||
pool_list_get(int argc, char **argv, zprop_list_t **proplist, int *err)
|
pool_list_get(int argc, char **argv, zprop_list_t **proplist,
|
||||||
|
boolean_t literal, int *err)
|
||||||
{
|
{
|
||||||
zpool_list_t *zlp;
|
zpool_list_t *zlp;
|
||||||
|
|
||||||
@@ -128,6 +132,8 @@ pool_list_get(int argc, char **argv, zprop_list_t **proplist, int *err)
|
|||||||
|
|
||||||
zlp->zl_proplist = proplist;
|
zlp->zl_proplist = proplist;
|
||||||
|
|
||||||
|
zlp->zl_literal = literal;
|
||||||
|
|
||||||
if (argc == 0) {
|
if (argc == 0) {
|
||||||
(void) zpool_iter(g_zfs, add_pool, zlp);
|
(void) zpool_iter(g_zfs, add_pool, zlp);
|
||||||
zlp->zl_findall = B_TRUE;
|
zlp->zl_findall = B_TRUE;
|
||||||
@@ -242,12 +248,12 @@ pool_list_count(zpool_list_t *zlp)
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
for_each_pool(int argc, char **argv, boolean_t unavail,
|
for_each_pool(int argc, char **argv, boolean_t unavail,
|
||||||
zprop_list_t **proplist, zpool_iter_f func, void *data)
|
zprop_list_t **proplist, boolean_t literal, zpool_iter_f func, void *data)
|
||||||
{
|
{
|
||||||
zpool_list_t *list;
|
zpool_list_t *list;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if ((list = pool_list_get(argc, argv, proplist, &ret)) == NULL)
|
if ((list = pool_list_get(argc, argv, proplist, literal, &ret)) == NULL)
|
||||||
return (1);
|
return (1);
|
||||||
|
|
||||||
if (pool_list_iter(list, unavail, func, data) != 0)
|
if (pool_list_iter(list, unavail, func, data) != 0)
|
||||||
@@ -711,7 +717,7 @@ all_pools_for_each_vdev_run(int argc, char **argv, char *cmd,
|
|||||||
vcdl->g_zfs = g_zfs;
|
vcdl->g_zfs = g_zfs;
|
||||||
|
|
||||||
/* Gather our list of all vdevs in all pools */
|
/* Gather our list of all vdevs in all pools */
|
||||||
for_each_pool(argc, argv, B_TRUE, NULL,
|
for_each_pool(argc, argv, B_TRUE, NULL, B_FALSE,
|
||||||
all_pools_for_each_vdev_gather_cb, vcdl);
|
all_pools_for_each_vdev_gather_cb, vcdl);
|
||||||
|
|
||||||
/* Run command on all vdevs in all pools */
|
/* Run command on all vdevs in all pools */
|
||||||
|
|||||||
+49
-20
@@ -1762,7 +1762,7 @@ zpool_do_export(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (for_each_pool(argc, argv, B_TRUE, NULL,
|
return (for_each_pool(argc, argv, B_TRUE, NULL,
|
||||||
zpool_export_one, &cb));
|
B_FALSE, zpool_export_one, &cb));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check arguments */
|
/* check arguments */
|
||||||
@@ -1771,7 +1771,8 @@ zpool_do_export(int argc, char **argv)
|
|||||||
usage(B_FALSE);
|
usage(B_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = for_each_pool(argc, argv, B_TRUE, NULL, zpool_export_one, &cb);
|
ret = for_each_pool(argc, argv, B_TRUE, NULL, B_FALSE, zpool_export_one,
|
||||||
|
&cb);
|
||||||
|
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
@@ -2254,6 +2255,13 @@ print_status_config(zpool_handle_t *zhp, status_cbdata_t *cb, const char *name,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
color_end();
|
color_end();
|
||||||
|
} else if (children == 0 && !isspare &&
|
||||||
|
getenv("ZPOOL_STATUS_NON_NATIVE_ASHIFT_IGNORE") == NULL &&
|
||||||
|
VDEV_STAT_VALID(vs_physical_ashift, vsc) &&
|
||||||
|
vs->vs_configured_ashift < vs->vs_physical_ashift) {
|
||||||
|
(void) printf(
|
||||||
|
gettext(" block size: %dB configured, %dB native"),
|
||||||
|
1 << vs->vs_configured_ashift, 1 << vs->vs_physical_ashift);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The root vdev has the scrub/resilver stats */
|
/* The root vdev has the scrub/resilver stats */
|
||||||
@@ -2654,6 +2662,13 @@ show_import(nvlist_t *config)
|
|||||||
errata);
|
errata);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ZPOOL_STATUS_NON_NATIVE_ASHIFT:
|
||||||
|
printf_color(ANSI_BOLD, gettext("status: "));
|
||||||
|
printf_color(ANSI_YELLOW, gettext("One or more devices are "
|
||||||
|
"configured to use a non-native block size.\n"
|
||||||
|
"\tExpect reduced performance.\n"));
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/*
|
/*
|
||||||
* No other status can be seen when importing pools.
|
* No other status can be seen when importing pools.
|
||||||
@@ -2816,7 +2831,8 @@ show_import(nvlist_t *config)
|
|||||||
|
|
||||||
if (msgid != NULL) {
|
if (msgid != NULL) {
|
||||||
(void) printf(gettext(
|
(void) printf(gettext(
|
||||||
" see: https://zfsonlinux.org/msg/%s\n"), msgid);
|
" see: https://openzfs.github.io/openzfs-docs/msg/%s\n"),
|
||||||
|
msgid);
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) printf(gettext(" config:\n\n"));
|
(void) printf(gettext(" config:\n\n"));
|
||||||
@@ -3598,7 +3614,8 @@ zpool_do_sync(int argc, char **argv)
|
|||||||
argv += optind;
|
argv += optind;
|
||||||
|
|
||||||
/* if argc == 0 we will execute zpool_sync_one on all pools */
|
/* if argc == 0 we will execute zpool_sync_one on all pools */
|
||||||
ret = for_each_pool(argc, argv, B_FALSE, NULL, zpool_sync_one, &force);
|
ret = for_each_pool(argc, argv, B_FALSE, NULL, B_FALSE, zpool_sync_one,
|
||||||
|
&force);
|
||||||
|
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
@@ -4943,7 +4960,7 @@ are_vdevs_in_pool(int argc, char **argv, char *pool_name,
|
|||||||
|
|
||||||
/* Is this name a vdev in our pools? */
|
/* Is this name a vdev in our pools? */
|
||||||
ret = for_each_pool(pool_count, &pool_name, B_TRUE, NULL,
|
ret = for_each_pool(pool_count, &pool_name, B_TRUE, NULL,
|
||||||
is_vdev, cb);
|
B_FALSE, is_vdev, cb);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
/* No match */
|
/* No match */
|
||||||
break;
|
break;
|
||||||
@@ -4971,7 +4988,8 @@ is_pool_cb(zpool_handle_t *zhp, void *data)
|
|||||||
static int
|
static int
|
||||||
is_pool(char *name)
|
is_pool(char *name)
|
||||||
{
|
{
|
||||||
return (for_each_pool(0, NULL, B_TRUE, NULL, is_pool_cb, name));
|
return (for_each_pool(0, NULL, B_TRUE, NULL, B_FALSE, is_pool_cb,
|
||||||
|
name));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Are all our argv[] strings pool names? If so return 1, 0 otherwise. */
|
/* Are all our argv[] strings pool names? If so return 1, 0 otherwise. */
|
||||||
@@ -5423,7 +5441,7 @@ zpool_do_iostat(int argc, char **argv)
|
|||||||
* Construct the list of all interesting pools.
|
* Construct the list of all interesting pools.
|
||||||
*/
|
*/
|
||||||
ret = 0;
|
ret = 0;
|
||||||
if ((list = pool_list_get(argc, argv, NULL, &ret)) == NULL)
|
if ((list = pool_list_get(argc, argv, NULL, parsable, &ret)) == NULL)
|
||||||
return (1);
|
return (1);
|
||||||
|
|
||||||
if (pool_list_count(list) == 0 && argc != 0) {
|
if (pool_list_count(list) == 0 && argc != 0) {
|
||||||
@@ -6097,7 +6115,7 @@ zpool_do_list(int argc, char **argv)
|
|||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if ((list = pool_list_get(argc, argv, &cb.cb_proplist,
|
if ((list = pool_list_get(argc, argv, &cb.cb_proplist,
|
||||||
&ret)) == NULL)
|
cb.cb_literal, &ret)) == NULL)
|
||||||
return (1);
|
return (1);
|
||||||
|
|
||||||
if (pool_list_count(list) == 0)
|
if (pool_list_count(list) == 0)
|
||||||
@@ -6849,7 +6867,7 @@ zpool_do_reopen(int argc, char **argv)
|
|||||||
argv += optind;
|
argv += optind;
|
||||||
|
|
||||||
/* if argc == 0 we will execute zpool_reopen_one on all pools */
|
/* if argc == 0 we will execute zpool_reopen_one on all pools */
|
||||||
ret = for_each_pool(argc, argv, B_TRUE, NULL, zpool_reopen_one,
|
ret = for_each_pool(argc, argv, B_TRUE, NULL, B_FALSE, zpool_reopen_one,
|
||||||
&scrub_restart);
|
&scrub_restart);
|
||||||
|
|
||||||
return (ret);
|
return (ret);
|
||||||
@@ -6979,12 +6997,13 @@ zpool_do_scrub(int argc, char **argv)
|
|||||||
usage(B_FALSE);
|
usage(B_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
error = for_each_pool(argc, argv, B_TRUE, NULL, scrub_callback, &cb);
|
error = for_each_pool(argc, argv, B_TRUE, NULL, B_FALSE,
|
||||||
|
scrub_callback, &cb);
|
||||||
|
|
||||||
if (wait && !error) {
|
if (wait && !error) {
|
||||||
zpool_wait_activity_t act = ZPOOL_WAIT_SCRUB;
|
zpool_wait_activity_t act = ZPOOL_WAIT_SCRUB;
|
||||||
error = for_each_pool(argc, argv, B_TRUE, NULL, wait_callback,
|
error = for_each_pool(argc, argv, B_TRUE, NULL, B_FALSE,
|
||||||
&act);
|
wait_callback, &act);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (error);
|
return (error);
|
||||||
@@ -7022,7 +7041,8 @@ zpool_do_resilver(int argc, char **argv)
|
|||||||
usage(B_FALSE);
|
usage(B_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (for_each_pool(argc, argv, B_TRUE, NULL, scrub_callback, &cb));
|
return (for_each_pool(argc, argv, B_TRUE, NULL, B_FALSE,
|
||||||
|
scrub_callback, &cb));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -7804,7 +7824,7 @@ print_dedup_stats(nvlist_t *config)
|
|||||||
* pool: tank
|
* pool: tank
|
||||||
* status: DEGRADED
|
* status: DEGRADED
|
||||||
* reason: One or more devices ...
|
* reason: One or more devices ...
|
||||||
* see: https://zfsonlinux.org/msg/ZFS-xxxx-01
|
* see: https://openzfs.github.io/openzfs-docs/msg/ZFS-xxxx-01
|
||||||
* config:
|
* config:
|
||||||
* mirror DEGRADED
|
* mirror DEGRADED
|
||||||
* c1t0d0 OK
|
* c1t0d0 OK
|
||||||
@@ -8193,7 +8213,9 @@ status_callback(zpool_handle_t *zhp, void *data)
|
|||||||
if (msgid != NULL) {
|
if (msgid != NULL) {
|
||||||
printf(" ");
|
printf(" ");
|
||||||
printf_color(ANSI_BOLD, gettext("see:"));
|
printf_color(ANSI_BOLD, gettext("see:"));
|
||||||
printf(gettext(" https://zfsonlinux.org/msg/%s\n"), msgid);
|
printf(gettext(
|
||||||
|
" https://openzfs.github.io/openzfs-docs/msg/%s\n"),
|
||||||
|
msgid);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config != NULL) {
|
if (config != NULL) {
|
||||||
@@ -8414,7 +8436,7 @@ zpool_do_status(int argc, char **argv)
|
|||||||
cb.vcdl = all_pools_for_each_vdev_run(argc, argv, cmd,
|
cb.vcdl = all_pools_for_each_vdev_run(argc, argv, cmd,
|
||||||
NULL, NULL, 0, 0);
|
NULL, NULL, 0, 0);
|
||||||
|
|
||||||
ret = for_each_pool(argc, argv, B_TRUE, NULL,
|
ret = for_each_pool(argc, argv, B_TRUE, NULL, cb.cb_literal,
|
||||||
status_callback, &cb);
|
status_callback, &cb);
|
||||||
|
|
||||||
if (cb.vcdl != NULL)
|
if (cb.vcdl != NULL)
|
||||||
@@ -8933,7 +8955,7 @@ zpool_do_upgrade(int argc, char **argv)
|
|||||||
(void) printf(gettext("\n"));
|
(void) printf(gettext("\n"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ret = for_each_pool(argc, argv, B_FALSE, NULL,
|
ret = for_each_pool(argc, argv, B_FALSE, NULL, B_FALSE,
|
||||||
upgrade_one, &cb);
|
upgrade_one, &cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9019,6 +9041,12 @@ print_history_records(nvlist_t *nvhis, hist_cbdata_t *cb)
|
|||||||
dump_nvlist(fnvlist_lookup_nvlist(rec,
|
dump_nvlist(fnvlist_lookup_nvlist(rec,
|
||||||
ZPOOL_HIST_OUTPUT_NVL), 8);
|
ZPOOL_HIST_OUTPUT_NVL), 8);
|
||||||
}
|
}
|
||||||
|
if (nvlist_exists(rec, ZPOOL_HIST_OUTPUT_SIZE)) {
|
||||||
|
(void) printf(" output nvlist omitted; "
|
||||||
|
"original size: %lldKB\n",
|
||||||
|
(longlong_t)fnvlist_lookup_int64(rec,
|
||||||
|
ZPOOL_HIST_OUTPUT_SIZE) / 1024);
|
||||||
|
}
|
||||||
if (nvlist_exists(rec, ZPOOL_HIST_ERRNO)) {
|
if (nvlist_exists(rec, ZPOOL_HIST_ERRNO)) {
|
||||||
(void) printf(" errno: %lld\n",
|
(void) printf(" errno: %lld\n",
|
||||||
(longlong_t)fnvlist_lookup_int64(rec,
|
(longlong_t)fnvlist_lookup_int64(rec,
|
||||||
@@ -9116,7 +9144,7 @@ zpool_do_history(int argc, char **argv)
|
|||||||
argc -= optind;
|
argc -= optind;
|
||||||
argv += optind;
|
argv += optind;
|
||||||
|
|
||||||
ret = for_each_pool(argc, argv, B_FALSE, NULL, get_history_one,
|
ret = for_each_pool(argc, argv, B_FALSE, NULL, B_FALSE, get_history_one,
|
||||||
&cbdata);
|
&cbdata);
|
||||||
|
|
||||||
if (argc == 0 && cbdata.first == B_TRUE) {
|
if (argc == 0 && cbdata.first == B_TRUE) {
|
||||||
@@ -9679,7 +9707,7 @@ zpool_do_get(int argc, char **argv)
|
|||||||
cb.cb_proplist = &fake_name;
|
cb.cb_proplist = &fake_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = for_each_pool(argc, argv, B_TRUE, &cb.cb_proplist,
|
ret = for_each_pool(argc, argv, B_TRUE, &cb.cb_proplist, cb.cb_literal,
|
||||||
get_callback, &cb);
|
get_callback, &cb);
|
||||||
|
|
||||||
if (cb.cb_proplist == &fake_name)
|
if (cb.cb_proplist == &fake_name)
|
||||||
@@ -9749,7 +9777,7 @@ zpool_do_set(int argc, char **argv)
|
|||||||
*(cb.cb_value) = '\0';
|
*(cb.cb_value) = '\0';
|
||||||
cb.cb_value++;
|
cb.cb_value++;
|
||||||
|
|
||||||
error = for_each_pool(argc - 2, argv + 2, B_TRUE, NULL,
|
error = for_each_pool(argc - 2, argv + 2, B_TRUE, NULL, B_FALSE,
|
||||||
set_callback, &cb);
|
set_callback, &cb);
|
||||||
|
|
||||||
return (error);
|
return (error);
|
||||||
@@ -10226,6 +10254,7 @@ main(int argc, char **argv)
|
|||||||
char **newargv;
|
char **newargv;
|
||||||
|
|
||||||
(void) setlocale(LC_ALL, "");
|
(void) setlocale(LC_ALL, "");
|
||||||
|
(void) setlocale(LC_NUMERIC, "C");
|
||||||
(void) textdomain(TEXT_DOMAIN);
|
(void) textdomain(TEXT_DOMAIN);
|
||||||
srand(time(NULL));
|
srand(time(NULL));
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ nvlist_t *split_mirror_vdev(zpool_handle_t *zhp, char *newname,
|
|||||||
* Pool list functions
|
* Pool list functions
|
||||||
*/
|
*/
|
||||||
int for_each_pool(int, char **, boolean_t unavail, zprop_list_t **,
|
int for_each_pool(int, char **, boolean_t unavail, zprop_list_t **,
|
||||||
zpool_iter_f, void *);
|
boolean_t, zpool_iter_f, void *);
|
||||||
|
|
||||||
/* Vdev list functions */
|
/* Vdev list functions */
|
||||||
typedef int (*pool_vdev_iter_f)(zpool_handle_t *, nvlist_t *, void *);
|
typedef int (*pool_vdev_iter_f)(zpool_handle_t *, nvlist_t *, void *);
|
||||||
@@ -72,7 +72,7 @@ int for_each_vdev(zpool_handle_t *zhp, pool_vdev_iter_f func, void *data);
|
|||||||
|
|
||||||
typedef struct zpool_list zpool_list_t;
|
typedef struct zpool_list zpool_list_t;
|
||||||
|
|
||||||
zpool_list_t *pool_list_get(int, char **, zprop_list_t **, int *);
|
zpool_list_t *pool_list_get(int, char **, zprop_list_t **, boolean_t, int *);
|
||||||
void pool_list_update(zpool_list_t *);
|
void pool_list_update(zpool_list_t *);
|
||||||
int pool_list_iter(zpool_list_t *, int unavail, zpool_iter_f, void *);
|
int pool_list_iter(zpool_list_t *, int unavail, zpool_iter_f, void *);
|
||||||
void pool_list_free(zpool_list_t *);
|
void pool_list_free(zpool_list_t *);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
include $(top_srcdir)/config/Rules.am
|
include $(top_srcdir)/config/Rules.am
|
||||||
|
|
||||||
# Disable GCC stack protection for zvol_id. This is a kludge and should be
|
# Disable GCC stack protection for zvol_id. This is a kludge and should be
|
||||||
# removed once https://github.com/zfsonlinux/zfs/issues/569 is resolved.
|
# removed once https://github.com/openzfs/zfs/issues/569 is resolved.
|
||||||
AM_CFLAGS += -fno-stack-protector
|
AM_CFLAGS += -fno-stack-protector
|
||||||
|
|
||||||
udev_PROGRAMS = zvol_id
|
udev_PROGRAMS = zvol_id
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
#
|
||||||
|
# When performing an ABI check the following options are applied:
|
||||||
|
#
|
||||||
|
# --no-unreferenced-symbols: Exclude symbols which are not referenced by
|
||||||
|
# any debug information. Without this _init() and _fini() are incorrectly
|
||||||
|
# reported on CentOS7 for libuutil.so.
|
||||||
|
#
|
||||||
|
# --headers-dir1: Limit ABI checks to public OpenZFS headers, otherwise
|
||||||
|
# changes in public system headers are also reported.
|
||||||
|
#
|
||||||
|
# --suppressions: Honor a suppressions file for each library to provide
|
||||||
|
# a mechanism for suppressing harmless warnings.
|
||||||
|
#
|
||||||
|
|
||||||
|
PHONY += checkabi storeabi
|
||||||
|
|
||||||
|
checkabi:
|
||||||
|
for lib in $(lib_LTLIBRARIES) ; do \
|
||||||
|
abidiff --no-unreferenced-symbols \
|
||||||
|
--headers-dir1 ../../include \
|
||||||
|
--suppressions $${lib%.la}.suppr \
|
||||||
|
$${lib%.la}.abi .libs/$${lib%.la}.so ; \
|
||||||
|
done
|
||||||
|
|
||||||
|
storeabi:
|
||||||
|
cd .libs ; \
|
||||||
|
for lib in $(lib_LTLIBRARIES) ; do \
|
||||||
|
abidw $${lib%.la}.so > ../$${lib%.la}.abi ; \
|
||||||
|
done
|
||||||
+7
-7
@@ -35,17 +35,17 @@ deb-dkms: deb-local rpm-dkms
|
|||||||
fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1 || exit 1; \
|
fakeroot $(ALIEN) --bump=0 --scripts --to-deb --target=$$debarch $$pkg1 || exit 1; \
|
||||||
$(RM) $$pkg1
|
$(RM) $$pkg1
|
||||||
|
|
||||||
deb-utils: deb-local rpm-utils
|
deb-utils: deb-local rpm-utils-initramfs
|
||||||
name=${PACKAGE}; \
|
name=${PACKAGE}; \
|
||||||
version=${VERSION}-${RELEASE}; \
|
version=${VERSION}-${RELEASE}; \
|
||||||
arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
|
arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
|
||||||
debarch=`$(DPKG) --print-architecture`; \
|
debarch=`$(DPKG) --print-architecture`; \
|
||||||
pkg1=$${name}-$${version}.$${arch}.rpm; \
|
pkg1=$${name}-$${version}.$${arch}.rpm; \
|
||||||
pkg2=libnvpair1-$${version}.$${arch}.rpm; \
|
pkg2=libnvpair3-$${version}.$${arch}.rpm; \
|
||||||
pkg3=libuutil1-$${version}.$${arch}.rpm; \
|
pkg3=libuutil3-$${version}.$${arch}.rpm; \
|
||||||
pkg4=libzfs2-$${version}.$${arch}.rpm; \
|
pkg4=libzfs4-$${version}.$${arch}.rpm; \
|
||||||
pkg5=libzpool2-$${version}.$${arch}.rpm; \
|
pkg5=libzpool4-$${version}.$${arch}.rpm; \
|
||||||
pkg6=libzfs2-devel-$${version}.$${arch}.rpm; \
|
pkg6=libzfs4-devel-$${version}.$${arch}.rpm; \
|
||||||
pkg7=$${name}-test-$${version}.$${arch}.rpm; \
|
pkg7=$${name}-test-$${version}.$${arch}.rpm; \
|
||||||
pkg8=$${name}-dracut-$${version}.noarch.rpm; \
|
pkg8=$${name}-dracut-$${version}.noarch.rpm; \
|
||||||
pkg9=$${name}-initramfs-$${version}.$${arch}.rpm; \
|
pkg9=$${name}-initramfs-$${version}.$${arch}.rpm; \
|
||||||
@@ -56,7 +56,7 @@ deb-utils: deb-local rpm-utils
|
|||||||
path_prepend=`mktemp -d /tmp/intercept.XXX`; \
|
path_prepend=`mktemp -d /tmp/intercept.XXX`; \
|
||||||
echo "#$(SHELL)" > $${path_prepend}/dh_shlibdeps; \
|
echo "#$(SHELL)" > $${path_prepend}/dh_shlibdeps; \
|
||||||
echo "`which dh_shlibdeps` -- \
|
echo "`which dh_shlibdeps` -- \
|
||||||
-xlibuutil1linux -xlibnvpair1linux -xlibzfs2linux -xlibzpool2linux" \
|
-xlibuutil3linux -xlibnvpair3linux -xlibzfs4linux -xlibzpool4linux" \
|
||||||
>> $${path_prepend}/dh_shlibdeps; \
|
>> $${path_prepend}/dh_shlibdeps; \
|
||||||
## These -x arguments are passed to dpkg-shlibdeps, which exclude the
|
## These -x arguments are passed to dpkg-shlibdeps, which exclude the
|
||||||
## Debianized packages from the auto-generated dependencies of the new debs,
|
## Debianized packages from the auto-generated dependencies of the new debs,
|
||||||
|
|||||||
@@ -11,10 +11,12 @@ AC_DEFUN([ZFS_AC_FIND_SYSTEM_LIBRARY], [
|
|||||||
|
|
||||||
_header_found=
|
_header_found=
|
||||||
_library_found=
|
_library_found=
|
||||||
|
_pc_found=
|
||||||
|
|
||||||
AS_IF([test -n "$2"], [PKG_CHECK_MODULES([$1], [$2], [
|
AS_IF([test -n "$2"], [PKG_CHECK_MODULES([$1], [$2], [
|
||||||
_header_found=1
|
_header_found=1
|
||||||
_library_found=1
|
_library_found=1
|
||||||
|
_pc_found=1
|
||||||
], [:])])
|
], [:])])
|
||||||
|
|
||||||
# set _header_found/_library_found if the user passed in CFLAGS/LIBS
|
# set _header_found/_library_found if the user passed in CFLAGS/LIBS
|
||||||
@@ -82,6 +84,9 @@ AC_DEFUN([ZFS_AC_FIND_SYSTEM_LIBRARY], [
|
|||||||
AS_IF([test "x$_header_found" = "x1" && test "x$_library_found" = "x1"], [
|
AS_IF([test "x$_header_found" = "x1" && test "x$_library_found" = "x1"], [
|
||||||
AC_SUBST([$1]_CFLAGS)
|
AC_SUBST([$1]_CFLAGS)
|
||||||
AC_SUBST([$1]_LIBS)
|
AC_SUBST([$1]_LIBS)
|
||||||
|
AS_IF([test "x$_pc_found" = "x1"], [
|
||||||
|
AC_SUBST([$1]_PC, [$2])
|
||||||
|
])
|
||||||
AC_DEFINE([HAVE_][$1], [1], [Define if you have [$5]])
|
AC_DEFINE([HAVE_][$1], [1], [Define if you have [$5]])
|
||||||
$7
|
$7
|
||||||
],[dnl ELSE
|
],[dnl ELSE
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKG_TRYGET], [
|
|||||||
#include <linux/bio.h>
|
#include <linux/bio.h>
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
],[
|
],[
|
||||||
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])
|
||||||
|
|||||||
@@ -77,6 +77,59 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_REREAD_PART], [
|
|||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # check_disk_change() was removed in 5.10
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_CHECK_DISK_CHANGE], [
|
||||||
|
ZFS_LINUX_TEST_SRC([check_disk_change], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/blkdev.h>
|
||||||
|
], [
|
||||||
|
struct block_device *bdev = NULL;
|
||||||
|
bool error;
|
||||||
|
|
||||||
|
error = check_disk_change(bdev);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_CHECK_DISK_CHANGE], [
|
||||||
|
AC_MSG_CHECKING([whether check_disk_change() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([check_disk_change], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_CHECK_DISK_CHANGE, 1,
|
||||||
|
[check_disk_change() exists])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 5.10 API, check_disk_change() is removed, in favor of
|
||||||
|
dnl # bdev_check_media_change(), which doesn't force revalidation
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_CHECK_MEDIA_CHANGE], [
|
||||||
|
ZFS_LINUX_TEST_SRC([bdev_check_media_change], [
|
||||||
|
#include <linux/fs.h>
|
||||||
|
#include <linux/blkdev.h>
|
||||||
|
], [
|
||||||
|
struct block_device *bdev = NULL;
|
||||||
|
int error;
|
||||||
|
|
||||||
|
error = bdev_check_media_change(bdev);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV_BDEV_CHECK_MEDIA_CHANGE], [
|
||||||
|
AC_MSG_CHECKING([whether bdev_disk_changed() exists])
|
||||||
|
ZFS_LINUX_TEST_RESULT([bdev_check_media_change], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_BDEV_CHECK_MEDIA_CHANGE, 1,
|
||||||
|
[bdev_check_media_change() exists])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # 2.6.22 API change
|
dnl # 2.6.22 API change
|
||||||
dnl # Single argument invalidate_bdev()
|
dnl # Single argument invalidate_bdev()
|
||||||
@@ -199,6 +252,8 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BLKDEV], [
|
|||||||
ZFS_AC_KERNEL_SRC_BLKDEV_LOOKUP_BDEV
|
ZFS_AC_KERNEL_SRC_BLKDEV_LOOKUP_BDEV
|
||||||
ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_LOGICAL_BLOCK_SIZE
|
ZFS_AC_KERNEL_SRC_BLKDEV_BDEV_LOGICAL_BLOCK_SIZE
|
||||||
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_BDEV_CHECK_MEDIA_CHANGE
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV], [
|
AC_DEFUN([ZFS_AC_KERNEL_BLKDEV], [
|
||||||
@@ -209,4 +264,6 @@ AC_DEFUN([ZFS_AC_KERNEL_BLKDEV], [
|
|||||||
ZFS_AC_KERNEL_BLKDEV_LOOKUP_BDEV
|
ZFS_AC_KERNEL_BLKDEV_LOOKUP_BDEV
|
||||||
ZFS_AC_KERNEL_BLKDEV_BDEV_LOGICAL_BLOCK_SIZE
|
ZFS_AC_KERNEL_BLKDEV_BDEV_LOGICAL_BLOCK_SIZE
|
||||||
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_BDEV_CHECK_MEDIA_CHANGE
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_CONFIG_DEBUG_LOCK_ALLOC], [
|
|||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_CONFIG_DEBUG_LOCK_ALLOC], [
|
AC_DEFUN([ZFS_AC_KERNEL_CONFIG_DEBUG_LOCK_ALLOC], [
|
||||||
AC_MSG_CHECKING([whether mutex_lock() is GPL-only])
|
AC_MSG_CHECKING([whether mutex_lock() is GPL-only])
|
||||||
ZFS_LINUX_TEST_RESULT([config_debug_lock_alloc], [
|
ZFS_LINUX_TEST_RESULT([config_debug_lock_alloc_license], [
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
],[
|
],[
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
|
|||||||
@@ -94,9 +94,6 @@ AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE_SANITY], [
|
|||||||
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_FILE_PAGES])
|
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_FILE_PAGES])
|
||||||
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_INACTIVE_ANON])
|
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_INACTIVE_ANON])
|
||||||
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_INACTIVE_FILE])
|
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_INACTIVE_FILE])
|
||||||
AS_IF([test -z "$ZFS_ENUM_NODE_STAT_ITEM_NR_SLAB_RECLAIMABLE_B"],[
|
|
||||||
ZFS_AC_KERNEL_GLOBAL_PAGE_STATE_ENUM_CHECK([NR_SLAB_RECLAIMABLE])
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
])
|
])
|
||||||
@@ -119,10 +116,6 @@ AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_PAGE_STATE], [
|
|||||||
[node_stat_item], [$LINUX/include/linux/mmzone.h])
|
[node_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_FILE],
|
ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_FILE],
|
||||||
[node_stat_item], [$LINUX/include/linux/mmzone.h])
|
[node_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_SLAB_RECLAIMABLE],
|
|
||||||
[node_stat_item], [$LINUX/include/linux/mmzone.h])
|
|
||||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_SLAB_RECLAIMABLE_B],
|
|
||||||
[node_stat_item], [$LINUX/include/linux/mmzone.h])
|
|
||||||
|
|
||||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_FILE_PAGES],
|
ZFS_AC_KERNEL_ENUM_MEMBER([NR_FILE_PAGES],
|
||||||
[zone_stat_item], [$LINUX/include/linux/mmzone.h])
|
[zone_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||||
@@ -130,8 +123,6 @@ AC_DEFUN([ZFS_AC_KERNEL_GLOBAL_PAGE_STATE], [
|
|||||||
[zone_stat_item], [$LINUX/include/linux/mmzone.h])
|
[zone_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_FILE],
|
ZFS_AC_KERNEL_ENUM_MEMBER([NR_INACTIVE_FILE],
|
||||||
[zone_stat_item], [$LINUX/include/linux/mmzone.h])
|
[zone_stat_item], [$LINUX/include/linux/mmzone.h])
|
||||||
ZFS_AC_KERNEL_ENUM_MEMBER([NR_SLAB_RECLAIMABLE],
|
|
||||||
[zone_stat_item], [$LINUX/include/linux/mmzone.h])
|
|
||||||
|
|
||||||
ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE_SANITY
|
ZFS_AC_KERNEL_GLOBAL_ZONE_PAGE_STATE_SANITY
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # Detect objtool functionality.
|
||||||
|
dnl #
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # Kernel 5.10: linux/frame.h was renamed linux/objtool.h
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_OBJTOOL_HEADER], [
|
||||||
|
AC_MSG_CHECKING([whether objtool header is available])
|
||||||
|
ZFS_LINUX_TRY_COMPILE([
|
||||||
|
#include <linux/objtool.h>
|
||||||
|
],[
|
||||||
|
],[
|
||||||
|
AC_DEFINE(HAVE_KERNEL_OBJTOOL_HEADER, 1,
|
||||||
|
[kernel has linux/objtool.h])
|
||||||
|
AC_MSG_RESULT(linux/objtool.h)
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(linux/frame.h)
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
dnl # Check for objtool support.
|
dnl # Check for objtool support.
|
||||||
dnl #
|
dnl #
|
||||||
@@ -6,19 +27,24 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_OBJTOOL], [
|
|||||||
dnl # 4.6 API for compile-time stack validation
|
dnl # 4.6 API for compile-time stack validation
|
||||||
ZFS_LINUX_TEST_SRC([objtool], [
|
ZFS_LINUX_TEST_SRC([objtool], [
|
||||||
#undef __ASSEMBLY__
|
#undef __ASSEMBLY__
|
||||||
|
#include <asm/ptrace.h>
|
||||||
#include <asm/frame.h>
|
#include <asm/frame.h>
|
||||||
],[
|
],[
|
||||||
#if !defined(FRAME_BEGIN)
|
#if !defined(FRAME_BEGIN)
|
||||||
CTASSERT(1);
|
#error "FRAME_BEGIN is not defined"
|
||||||
#endif
|
#endif
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl # 4.6 API added STACK_FRAME_NON_STANDARD macro
|
dnl # 4.6 API added STACK_FRAME_NON_STANDARD macro
|
||||||
ZFS_LINUX_TEST_SRC([stack_frame_non_standard], [
|
ZFS_LINUX_TEST_SRC([stack_frame_non_standard], [
|
||||||
|
#ifdef HAVE_KERNEL_OBJTOOL_HEADER
|
||||||
|
#include <linux/objtool.h>
|
||||||
|
#else
|
||||||
#include <linux/frame.h>
|
#include <linux/frame.h>
|
||||||
|
#endif
|
||||||
],[
|
],[
|
||||||
#if !defined(STACK_FRAME_NON_STANDARD)
|
#if !defined(STACK_FRAME_NON_STANDARD)
|
||||||
CTASSERT(1);
|
#error "STACK_FRAME_NON_STANDARD is not defined."
|
||||||
#endif
|
#endif
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -25,10 +25,36 @@ AC_DEFUN([ZFS_AC_KERNEL_PERCPU_COUNTER_INIT], [
|
|||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl #
|
||||||
|
dnl # 5.10 API change,
|
||||||
|
dnl # The "count" was moved into ref->data, from ref
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_PERCPU_REF_COUNT_IN_DATA], [
|
||||||
|
ZFS_LINUX_TEST_SRC([percpu_ref_count_in_data], [
|
||||||
|
#include <linux/percpu-refcount.h>
|
||||||
|
],[
|
||||||
|
struct percpu_ref_data d;
|
||||||
|
|
||||||
|
atomic_long_set(&d.count, 1L);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_PERCPU_REF_COUNT_IN_DATA], [
|
||||||
|
AC_MSG_CHECKING([whether is inside percpu_ref.data])
|
||||||
|
ZFS_LINUX_TEST_RESULT([percpu_ref_count_in_data], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(ZFS_PERCPU_REF_COUNT_IN_DATA, 1,
|
||||||
|
[count is located in percpu_ref.data])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_PERCPU], [
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_PERCPU], [
|
||||||
ZFS_AC_KERNEL_SRC_PERCPU_COUNTER_INIT
|
ZFS_AC_KERNEL_SRC_PERCPU_COUNTER_INIT
|
||||||
|
ZFS_AC_KERNEL_SRC_PERCPU_REF_COUNT_IN_DATA
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_DEFUN([ZFS_AC_KERNEL_PERCPU], [
|
AC_DEFUN([ZFS_AC_KERNEL_PERCPU], [
|
||||||
ZFS_AC_KERNEL_PERCPU_COUNTER_INIT
|
ZFS_AC_KERNEL_PERCPU_COUNTER_INIT
|
||||||
|
ZFS_AC_KERNEL_PERCPU_REF_COUNT_IN_DATA
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
dnl #
|
||||||
|
dnl # 5.10 API change
|
||||||
|
dnl # revalidate_disk() was replaced by revalidate_disk_size()
|
||||||
|
dnl #
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_SRC_REVALIDATE_DISK_SIZE], [
|
||||||
|
ZFS_LINUX_TEST_SRC([revalidate_disk_size], [
|
||||||
|
#include <linux/genhd.h>
|
||||||
|
], [
|
||||||
|
struct gendisk *disk = NULL;
|
||||||
|
(void) revalidate_disk_size(disk, false);
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
AC_DEFUN([ZFS_AC_KERNEL_REVALIDATE_DISK_SIZE], [
|
||||||
|
AC_MSG_CHECKING([whether revalidate_disk_size() is available])
|
||||||
|
ZFS_LINUX_TEST_RESULT_SYMBOL([revalidate_disk_size],
|
||||||
|
[revalidate_disk_size], [block/genhd.c], [
|
||||||
|
AC_MSG_RESULT(yes)
|
||||||
|
AC_DEFINE(HAVE_REVALIDATE_DISK_SIZE, 1,
|
||||||
|
[revalidate_disk_size() is available])
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT(no)
|
||||||
|
])
|
||||||
|
])
|
||||||
@@ -13,6 +13,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
|
|||||||
|
|
||||||
dnl # Sequential ZFS_LINUX_TRY_COMPILE tests
|
dnl # Sequential ZFS_LINUX_TRY_COMPILE tests
|
||||||
ZFS_AC_KERNEL_FPU_HEADER
|
ZFS_AC_KERNEL_FPU_HEADER
|
||||||
|
ZFS_AC_KERNEL_OBJTOOL_HEADER
|
||||||
ZFS_AC_KERNEL_WAIT_QUEUE_ENTRY_T
|
ZFS_AC_KERNEL_WAIT_QUEUE_ENTRY_T
|
||||||
ZFS_AC_KERNEL_MISC_MINOR
|
ZFS_AC_KERNEL_MISC_MINOR
|
||||||
ZFS_AC_KERNEL_DECLARE_EVENT_CLASS
|
ZFS_AC_KERNEL_DECLARE_EVENT_CLASS
|
||||||
@@ -61,6 +62,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
|
|||||||
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_GET_DISK_AND_MODULE
|
||||||
|
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
|
||||||
@@ -157,6 +159,7 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
|
|||||||
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_GET_DISK_AND_MODULE
|
||||||
|
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
|
||||||
|
|||||||
+13
-1
@@ -7,7 +7,7 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
PHONY += srpm srpms srpm-kmod srpm-dkms srpm-utils
|
PHONY += srpm srpms srpm-kmod srpm-dkms srpm-utils
|
||||||
PHONY += rpm rpms rpm-kmod rpm-dkms rpm-utils
|
PHONY += rpm rpms rpm-kmod rpm-dkms rpm-utils rpm-utils-initramfs
|
||||||
PHONY += srpm-common rpm-common rpm-local
|
PHONY += srpm-common rpm-common rpm-local
|
||||||
|
|
||||||
srpm-kmod srpm-dkms srpm-utils: dist
|
srpm-kmod srpm-dkms srpm-utils: dist
|
||||||
@@ -35,10 +35,22 @@ rpm-dkms: srpm-dkms
|
|||||||
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-dkms" \
|
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-dkms" \
|
||||||
def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_DKMS}' rpm-common
|
def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_DKMS}' rpm-common
|
||||||
|
|
||||||
|
# The rpm-utils and rpm-utils-initramfs targets are identical except for the
|
||||||
|
# zfs-initramfs package: rpm-utils never includes it, rpm-utils-initramfs
|
||||||
|
# includes it if detected at configure time. The zfs-initramfs package does
|
||||||
|
# not work on any known RPM-based distribution and the resulting RPM is only
|
||||||
|
# used to create a Debian package. The rpm-utils-initramfs target is not
|
||||||
|
# intended to be specified by the user directly, it is provided as a
|
||||||
|
# dependency of the deb-utils target.
|
||||||
|
|
||||||
rpm-utils: srpm-utils
|
rpm-utils: srpm-utils
|
||||||
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \
|
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \
|
||||||
def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_UTIL}' rpm-common
|
def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_UTIL}' rpm-common
|
||||||
|
|
||||||
|
rpm-utils-initramfs: srpm-utils
|
||||||
|
$(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \
|
||||||
|
def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_UTIL} ${RPM_DEFINE_INITRAMFS}' rpm-common
|
||||||
|
|
||||||
rpm: rpm-kmod rpm-dkms rpm-utils
|
rpm: rpm-kmod rpm-dkms rpm-utils
|
||||||
rpms: rpm-kmod rpm-dkms rpm-utils
|
rpms: rpm-kmod rpm-dkms rpm-utils
|
||||||
|
|
||||||
|
|||||||
+40
-31
@@ -282,7 +282,6 @@ AC_DEFUN([ZFS_AC_RPM], [
|
|||||||
AS_IF([test -n "$udevruledir" ], [
|
AS_IF([test -n "$udevruledir" ], [
|
||||||
RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' --define "_udevruledir $(udevruledir)"'
|
RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' --define "_udevruledir $(udevruledir)"'
|
||||||
])
|
])
|
||||||
RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_INITRAMFS)'
|
|
||||||
RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_SYSTEMD)'
|
RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_SYSTEMD)'
|
||||||
RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PYZFS)'
|
RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PYZFS)'
|
||||||
RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PAM)'
|
RPM_DEFINE_UTIL=${RPM_DEFINE_UTIL}' $(DEFINE_PAM)'
|
||||||
@@ -418,33 +417,43 @@ dnl # package type for 'make pkg': (rpm | deb | tgz)
|
|||||||
dnl #
|
dnl #
|
||||||
AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
|
AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
|
||||||
AC_MSG_CHECKING([os distribution])
|
AC_MSG_CHECKING([os distribution])
|
||||||
if test -f /etc/toss-release ; then
|
AC_ARG_WITH([vendor],
|
||||||
VENDOR=toss ;
|
[AS_HELP_STRING([--with-vendor],
|
||||||
elif test -f /etc/fedora-release ; then
|
[Distribution vendor @<:@default=check@:>@])],
|
||||||
VENDOR=fedora ;
|
[with_vendor=$withval],
|
||||||
elif test -f /etc/redhat-release ; then
|
[with_vendor=check])
|
||||||
VENDOR=redhat ;
|
AS_IF([test "x$with_vendor" = "xcheck"],[
|
||||||
elif test -f /etc/gentoo-release ; then
|
if test -f /etc/toss-release ; then
|
||||||
VENDOR=gentoo ;
|
VENDOR=toss ;
|
||||||
elif test -f /etc/arch-release ; then
|
elif test -f /etc/fedora-release ; then
|
||||||
VENDOR=arch ;
|
VENDOR=fedora ;
|
||||||
elif test -f /etc/SuSE-release ; then
|
elif test -f /etc/redhat-release ; then
|
||||||
VENDOR=sles ;
|
VENDOR=redhat ;
|
||||||
elif test -f /etc/slackware-version ; then
|
elif test -f /etc/gentoo-release ; then
|
||||||
VENDOR=slackware ;
|
VENDOR=gentoo ;
|
||||||
elif test -f /etc/lunar.release ; then
|
elif test -f /etc/arch-release ; then
|
||||||
VENDOR=lunar ;
|
VENDOR=arch ;
|
||||||
elif test -f /etc/lsb-release ; then
|
elif test -f /etc/SuSE-release ; then
|
||||||
VENDOR=ubuntu ;
|
VENDOR=sles ;
|
||||||
elif test -f /etc/debian_version ; then
|
elif test -f /etc/slackware-version ; then
|
||||||
VENDOR=debian ;
|
VENDOR=slackware ;
|
||||||
elif test -f /etc/alpine-release ; then
|
elif test -f /etc/lunar.release ; then
|
||||||
VENDOR=alpine ;
|
VENDOR=lunar ;
|
||||||
elif test -f /bin/freebsd-version ; then
|
elif test -f /etc/lsb-release ; then
|
||||||
VENDOR=freebsd ;
|
VENDOR=ubuntu ;
|
||||||
else
|
elif test -f /etc/debian_version ; then
|
||||||
VENDOR= ;
|
VENDOR=debian ;
|
||||||
fi
|
elif test -f /etc/alpine-release ; then
|
||||||
|
VENDOR=alpine ;
|
||||||
|
elif test -f /bin/freebsd-version ; then
|
||||||
|
VENDOR=freebsd ;
|
||||||
|
else
|
||||||
|
VENDOR= ;
|
||||||
|
fi],
|
||||||
|
[ test "x${with_vendor}" != x],[
|
||||||
|
VENDOR="$with_vendor" ],
|
||||||
|
[ VENDOR= ; ]
|
||||||
|
)
|
||||||
AC_MSG_RESULT([$VENDOR])
|
AC_MSG_RESULT([$VENDOR])
|
||||||
AC_SUBST(VENDOR)
|
AC_SUBST(VENDOR)
|
||||||
|
|
||||||
@@ -532,13 +541,13 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
|
|||||||
|
|
||||||
AC_MSG_CHECKING([whether initramfs-tools is available])
|
AC_MSG_CHECKING([whether initramfs-tools is available])
|
||||||
if test -d /usr/share/initramfs-tools ; then
|
if test -d /usr/share/initramfs-tools ; then
|
||||||
DEFINE_INITRAMFS='--define "_initramfs 1"'
|
RPM_DEFINE_INITRAMFS='--define "_initramfs 1"'
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
else
|
else
|
||||||
DEFINE_INITRAMFS=''
|
RPM_DEFINE_INITRAMFS=''
|
||||||
AC_MSG_RESULT([no])
|
AC_MSG_RESULT([no])
|
||||||
fi
|
fi
|
||||||
AC_SUBST(DEFINE_INITRAMFS)
|
AC_SUBST(RPM_DEFINE_INITRAMFS)
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl #
|
dnl #
|
||||||
|
|||||||
@@ -161,6 +161,8 @@ AC_CONFIG_FILES([
|
|||||||
lib/libuutil/Makefile
|
lib/libuutil/Makefile
|
||||||
lib/libzfs/Makefile
|
lib/libzfs/Makefile
|
||||||
lib/libzfs/libzfs.pc
|
lib/libzfs/libzfs.pc
|
||||||
|
lib/libzfsbootenv/Makefile
|
||||||
|
lib/libzfsbootenv/libzfsbootenv.pc
|
||||||
lib/libzfs_core/Makefile
|
lib/libzfs_core/Makefile
|
||||||
lib/libzfs_core/libzfs_core.pc
|
lib/libzfs_core/libzfs_core.pc
|
||||||
lib/libzpool/Makefile
|
lib/libzpool/Makefile
|
||||||
@@ -202,6 +204,7 @@ AC_CONFIG_FILES([
|
|||||||
tests/zfs-tests/Makefile
|
tests/zfs-tests/Makefile
|
||||||
tests/zfs-tests/callbacks/Makefile
|
tests/zfs-tests/callbacks/Makefile
|
||||||
tests/zfs-tests/cmd/Makefile
|
tests/zfs-tests/cmd/Makefile
|
||||||
|
tests/zfs-tests/cmd/badsend/Makefile
|
||||||
tests/zfs-tests/cmd/btree_test/Makefile
|
tests/zfs-tests/cmd/btree_test/Makefile
|
||||||
tests/zfs-tests/cmd/chg_usr_exec/Makefile
|
tests/zfs-tests/cmd/chg_usr_exec/Makefile
|
||||||
tests/zfs-tests/cmd/devname2devid/Makefile
|
tests/zfs-tests/cmd/devname2devid/Makefile
|
||||||
@@ -234,6 +237,7 @@ AC_CONFIG_FILES([
|
|||||||
tests/zfs-tests/tests/functional/Makefile
|
tests/zfs-tests/tests/functional/Makefile
|
||||||
tests/zfs-tests/tests/functional/acl/Makefile
|
tests/zfs-tests/tests/functional/acl/Makefile
|
||||||
tests/zfs-tests/tests/functional/acl/posix/Makefile
|
tests/zfs-tests/tests/functional/acl/posix/Makefile
|
||||||
|
tests/zfs-tests/tests/functional/acl/posix-sa/Makefile
|
||||||
tests/zfs-tests/tests/functional/alloc_class/Makefile
|
tests/zfs-tests/tests/functional/alloc_class/Makefile
|
||||||
tests/zfs-tests/tests/functional/arc/Makefile
|
tests/zfs-tests/tests/functional/arc/Makefile
|
||||||
tests/zfs-tests/tests/functional/atime/Makefile
|
tests/zfs-tests/tests/functional/atime/Makefile
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
. /lib/dracut-zfs-lib.sh
|
. /lib/dracut-zfs-lib.sh
|
||||||
|
|
||||||
|
|||||||
@@ -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 "@sbindir@/zpool" "@sbindir@/zfs" "@mounthelperdir@/mount.zfs" ; do
|
for tool in "@bindir@/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,9 +38,11 @@ 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@/zfs
|
dracut_install @sbindir@/zfs
|
||||||
dracut_install @sbindir@/zpool
|
dracut_install @sbindir@/zpool
|
||||||
# Workaround for zfsonlinux/zfs#4749 by ensuring libgcc_s.so(.1) is included
|
# Workaround for https://github.com/openzfs/zfs/issues/4749 by
|
||||||
|
# ensuring libgcc_s.so(.1) is included
|
||||||
if [[ -n "$(ldd @sbindir@/zpool | grep -F 'libgcc_s.so')" ]]; then
|
if [[ -n "$(ldd @sbindir@/zpool | grep -F 'libgcc_s.so')" ]]; then
|
||||||
# Dracut will have already tracked and included it
|
# Dracut will have already tracked and included it
|
||||||
:;
|
:;
|
||||||
@@ -83,11 +85,13 @@ install() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Synchronize initramfs and system hostid
|
# Synchronize initramfs and system hostid
|
||||||
AA=`hostid | cut -b 1,2`
|
if [ -f @sysconfdir@/hostid ]; then
|
||||||
BB=`hostid | cut -b 3,4`
|
inst @sysconfdir@/hostid
|
||||||
CC=`hostid | cut -b 5,6`
|
type mark_hostonly >/dev/null 2>&1 && mark_hostonly @sysconfdir@/hostid
|
||||||
DD=`hostid | cut -b 7,8`
|
elif HOSTID="$(hostid 2>/dev/null)" && [ "${HOSTID}" != "00000000" ]; then
|
||||||
echo -ne "\\x${DD}\\x${CC}\\x${BB}\\x${AA}" > "${initdir}/etc/hostid"
|
zgenhostid -o "${initdir}@sysconfdir@/hostid" "${HOSTID}"
|
||||||
|
type mark_hostonly >/dev/null 2>&1 && mark_hostonly @sysconfdir@/hostid
|
||||||
|
fi
|
||||||
|
|
||||||
if dracut_module_included "systemd"; then
|
if dracut_module_included "systemd"; then
|
||||||
mkdir -p "${initdir}/$systemdsystemunitdir/zfs-import.target.wants"
|
mkdir -p "${initdir}/$systemdsystemunitdir/zfs-import.target.wants"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
. /lib/dracut-zfs-lib.sh
|
. /lib/dracut-zfs-lib.sh
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
. /lib/dracut-lib.sh
|
. /lib/dracut-lib.sh
|
||||||
|
|
||||||
@@ -6,11 +6,7 @@
|
|||||||
spl_hostid=$(getarg spl_hostid=)
|
spl_hostid=$(getarg spl_hostid=)
|
||||||
if [ -n "${spl_hostid}" ] ; then
|
if [ -n "${spl_hostid}" ] ; then
|
||||||
info "ZFS: Using hostid from command line: ${spl_hostid}"
|
info "ZFS: Using hostid from command line: ${spl_hostid}"
|
||||||
AA=$(echo "${spl_hostid}" | cut -b 1,2)
|
zgenhostid -f "${spl_hostid}"
|
||||||
BB=$(echo "${spl_hostid}" | cut -b 3,4)
|
|
||||||
CC=$(echo "${spl_hostid}" | cut -b 5,6)
|
|
||||||
DD=$(echo "${spl_hostid}" | cut -b 7,8)
|
|
||||||
echo -ne "\\x${DD}\\x${CC}\\x${BB}\\x${AA}" >/etc/hostid
|
|
||||||
elif [ -f "/etc/hostid" ] ; then
|
elif [ -f "/etc/hostid" ] ; then
|
||||||
info "ZFS: Using hostid from /etc/hostid: $(hostid)"
|
info "ZFS: Using hostid from /etc/hostid: $(hostid)"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/bin/sh
|
||||||
|
|
||||||
echo "zfs-generator: starting" >> /dev/kmsg
|
echo "zfs-generator: starting" >> /dev/kmsg
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@ GENERATOR_DIR="$1"
|
|||||||
[ -f /lib/dracut-lib.sh ] && dracutlib=/lib/dracut-lib.sh
|
[ -f /lib/dracut-lib.sh ] && dracutlib=/lib/dracut-lib.sh
|
||||||
[ -f /usr/lib/dracut/modules.d/99base/dracut-lib.sh ] && dracutlib=/usr/lib/dracut/modules.d/99base/dracut-lib.sh
|
[ -f /usr/lib/dracut/modules.d/99base/dracut-lib.sh ] && dracutlib=/usr/lib/dracut/modules.d/99base/dracut-lib.sh
|
||||||
|
|
||||||
type getarg >/dev/null 2>&1 || {
|
command -v getarg >/dev/null 2>&1 || {
|
||||||
echo "zfs-generator: loading Dracut library from $dracutlib" >> /dev/kmsg
|
echo "zfs-generator: loading Dracut library from $dracutlib" >> /dev/kmsg
|
||||||
. "$dracutlib"
|
. "$dracutlib"
|
||||||
}
|
}
|
||||||
@@ -22,16 +22,17 @@ type getarg >/dev/null 2>&1 || {
|
|||||||
|
|
||||||
# If root is not ZFS= or zfs: or rootfstype is not zfs
|
# If root is not ZFS= or zfs: or rootfstype is not zfs
|
||||||
# then we are not supposed to handle it.
|
# then we are not supposed to handle it.
|
||||||
[ "${root##zfs:}" = "${root}" -a "${root##ZFS=}" = "${root}" -a "$rootfstype" != "zfs" ] && exit 0
|
[ "${root##zfs:}" = "${root}" ] &&
|
||||||
|
[ "${root##ZFS=}" = "${root}" ] &&
|
||||||
|
[ "$rootfstype" != "zfs" ] &&
|
||||||
|
exit 0
|
||||||
|
|
||||||
rootfstype=zfs
|
rootfstype=zfs
|
||||||
if echo "${rootflags}" | grep -Eq '^zfsutil$|^zfsutil,|,zfsutil$|,zfsutil,' ; then
|
case ",${rootflags}," in
|
||||||
true
|
*,zfsutil,*) ;;
|
||||||
elif test -n "${rootflags}" ; then
|
,,) rootflags=zfsutil ;;
|
||||||
rootflags="zfsutil,${rootflags}"
|
*) rootflags="zfsutil,${rootflags}" ;;
|
||||||
else
|
esac
|
||||||
rootflags=zfsutil
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "zfs-generator: writing extension for sysroot.mount to $GENERATOR_DIR"/sysroot.mount.d/zfs-enhancement.conf >> /dev/kmsg
|
echo "zfs-generator: writing extension for sysroot.mount to $GENERATOR_DIR"/sysroot.mount.d/zfs-enhancement.conf >> /dev/kmsg
|
||||||
|
|
||||||
@@ -58,4 +59,4 @@ 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
|
||||||
|
|
||||||
echo "zfs-generator: finished" >> /dev/kmsg
|
echo "zfs-generator: finished" >> /dev/kmsg
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
command -v getarg >/dev/null || . /lib/dracut-lib.sh
|
command -v getarg >/dev/null || . /lib/dracut-lib.sh
|
||||||
command -v getargbool >/dev/null || {
|
command -v getargbool >/dev/null || {
|
||||||
@@ -144,7 +144,7 @@ ask_for_password() {
|
|||||||
|
|
||||||
{ flock -s 9;
|
{ flock -s 9;
|
||||||
# Prompt for password with plymouth, if installed and running.
|
# Prompt for password with plymouth, if installed and running.
|
||||||
if type plymouth >/dev/null 2>&1 && plymouth --ping 2>/dev/null; then
|
if plymouth --ping 2>/dev/null; then
|
||||||
plymouth ask-for-password \
|
plymouth ask-for-password \
|
||||||
--prompt "$ply_prompt" --number-of-tries="$ply_tries" \
|
--prompt "$ply_prompt" --number-of-tries="$ply_tries" \
|
||||||
--command="$ply_cmd"
|
--command="$ply_cmd"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/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 ] || return 0
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
command -v getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||||
|
|
||||||
if zpool list 2>&1 | grep -q 'no pools available' ; then
|
if zpool list 2>&1 | grep -q 'no pools available' ; then
|
||||||
info "ZFS: No active pools, no need to export anything."
|
info "ZFS: No active pools, no need to export anything."
|
||||||
|
|||||||
@@ -15,4 +15,4 @@ esac
|
|||||||
|
|
||||||
. /usr/share/initramfs-tools/hook-functions
|
. /usr/share/initramfs-tools/hook-functions
|
||||||
|
|
||||||
copy_exec /usr/share/initramfs-tools/zfsunlock /usr/bin
|
copy_exec /usr/share/initramfs-tools/zfsunlock /usr/bin/zfsunlock
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
# See "4.5 Disable root prompt on the initramfs" of Securing Debian Manual:
|
# See "4.5 Disable root prompt on the initramfs" of Securing Debian Manual:
|
||||||
# https://www.debian.org/doc/manuals/securing-debian-howto/ch4.en.html
|
# https://www.debian.org/doc/manuals/securing-debian-howto/ch4.en.html
|
||||||
shell() {
|
shell() {
|
||||||
if type panic > /dev/null 2>&1; then
|
if command -v panic > /dev/null 2>&1; then
|
||||||
panic $@
|
panic
|
||||||
else
|
else
|
||||||
/bin/sh
|
/bin/sh
|
||||||
fi
|
fi
|
||||||
@@ -26,22 +26,23 @@ shell() {
|
|||||||
# pools and mounting any filesystems.
|
# pools and mounting any filesystems.
|
||||||
pre_mountroot()
|
pre_mountroot()
|
||||||
{
|
{
|
||||||
if type run_scripts > /dev/null 2>&1 && \
|
if command -v run_scripts > /dev/null 2>&1
|
||||||
[ -f "/scripts/local-top" -o -d "/scripts/local-top" ]
|
|
||||||
then
|
then
|
||||||
[ "$quiet" != "y" ] && \
|
if [ -f "/scripts/local-top" ] || [ -d "/scripts/local-top" ]
|
||||||
zfs_log_begin_msg "Running /scripts/local-top"
|
then
|
||||||
run_scripts /scripts/local-top
|
[ "$quiet" != "y" ] && \
|
||||||
[ "$quiet" != "y" ] && zfs_log_end_msg
|
zfs_log_begin_msg "Running /scripts/local-top"
|
||||||
fi
|
run_scripts /scripts/local-top
|
||||||
|
[ "$quiet" != "y" ] && zfs_log_end_msg
|
||||||
|
fi
|
||||||
|
|
||||||
if type run_scripts > /dev/null 2>&1 && \
|
if [ -f "/scripts/local-premount" ] || [ -d "/scripts/local-premount" ]
|
||||||
[ -f "/scripts/local-premount" -o -d "/scripts/local-premount" ]
|
then
|
||||||
then
|
[ "$quiet" != "y" ] && \
|
||||||
[ "$quiet" != "y" ] && \
|
zfs_log_begin_msg "Running /scripts/local-premount"
|
||||||
zfs_log_begin_msg "Running /scripts/local-premount"
|
run_scripts /scripts/local-premount
|
||||||
run_scripts /scripts/local-premount
|
[ "$quiet" != "y" ] && zfs_log_end_msg
|
||||||
[ "$quiet" != "y" ] && zfs_log_end_msg
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,10 +58,10 @@ disable_plymouth()
|
|||||||
# Get a ZFS filesystem property value.
|
# Get a ZFS filesystem property value.
|
||||||
get_fs_value()
|
get_fs_value()
|
||||||
{
|
{
|
||||||
local fs="$1"
|
fs="$1"
|
||||||
local value=$2
|
value=$2
|
||||||
|
|
||||||
"${ZFS}" get -H -ovalue $value "$fs" 2> /dev/null
|
"${ZFS}" get -H -ovalue "$value" "$fs" 2> /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
# Find the 'bootfs' property on pool $1.
|
# Find the 'bootfs' property on pool $1.
|
||||||
@@ -68,7 +69,7 @@ get_fs_value()
|
|||||||
# pool by exporting it again.
|
# pool by exporting it again.
|
||||||
find_rootfs()
|
find_rootfs()
|
||||||
{
|
{
|
||||||
local pool="$1"
|
pool="$1"
|
||||||
|
|
||||||
# If 'POOL_IMPORTED' isn't set, no pool imported and therefore
|
# If 'POOL_IMPORTED' isn't set, no pool imported and therefore
|
||||||
# we won't be able to find a root fs.
|
# we won't be able to find a root fs.
|
||||||
@@ -84,7 +85,7 @@ find_rootfs()
|
|||||||
|
|
||||||
# Make sure it's not '-' and that it starts with /.
|
# Make sure it's not '-' and that it starts with /.
|
||||||
if [ "${ZFS_BOOTFS}" != "-" ] && \
|
if [ "${ZFS_BOOTFS}" != "-" ] && \
|
||||||
$(get_fs_value "${ZFS_BOOTFS}" mountpoint | grep -q '^/$')
|
get_fs_value "${ZFS_BOOTFS}" mountpoint | grep -q '^/$'
|
||||||
then
|
then
|
||||||
# Keep it mounted
|
# Keep it mounted
|
||||||
POOL_IMPORTED=1
|
POOL_IMPORTED=1
|
||||||
@@ -101,14 +102,13 @@ find_rootfs()
|
|||||||
# Support function to get a list of all pools, separated with ';'
|
# Support function to get a list of all pools, separated with ';'
|
||||||
find_pools()
|
find_pools()
|
||||||
{
|
{
|
||||||
local CMD="$*"
|
CMD="$*"
|
||||||
local pools pool
|
|
||||||
|
|
||||||
pools=$($CMD 2> /dev/null | \
|
pools=$($CMD 2> /dev/null | \
|
||||||
grep -E "pool:|^[a-zA-Z0-9]" | \
|
grep -E "pool:|^[a-zA-Z0-9]" | \
|
||||||
sed 's@.*: @@' | \
|
sed 's@.*: @@' | \
|
||||||
while read pool; do \
|
while read -r pool; do \
|
||||||
echo -n "$pool;"
|
printf "%s" "$pool;"
|
||||||
done)
|
done)
|
||||||
|
|
||||||
echo "${pools%%;}" # Return without the last ';'.
|
echo "${pools%%;}" # Return without the last ';'.
|
||||||
@@ -117,8 +117,6 @@ find_pools()
|
|||||||
# Get a list of all available pools
|
# Get a list of all available pools
|
||||||
get_pools()
|
get_pools()
|
||||||
{
|
{
|
||||||
local available_pools npools
|
|
||||||
|
|
||||||
if [ -n "${ZFS_POOL_IMPORT}" ]; then
|
if [ -n "${ZFS_POOL_IMPORT}" ]; then
|
||||||
echo "$ZFS_POOL_IMPORT"
|
echo "$ZFS_POOL_IMPORT"
|
||||||
return 0
|
return 0
|
||||||
@@ -159,9 +157,8 @@ get_pools()
|
|||||||
# Filter out any exceptions...
|
# Filter out any exceptions...
|
||||||
if [ -n "$ZFS_POOL_EXCEPTIONS" ]
|
if [ -n "$ZFS_POOL_EXCEPTIONS" ]
|
||||||
then
|
then
|
||||||
local found=""
|
found=""
|
||||||
local apools=""
|
apools=""
|
||||||
local pool exception
|
|
||||||
OLD_IFS="$IFS" ; IFS=";"
|
OLD_IFS="$IFS" ; IFS=";"
|
||||||
|
|
||||||
for pool in $available_pools
|
for pool in $available_pools
|
||||||
@@ -194,8 +191,7 @@ get_pools()
|
|||||||
# Import given pool $1
|
# Import given pool $1
|
||||||
import_pool()
|
import_pool()
|
||||||
{
|
{
|
||||||
local pool="$1"
|
pool="$1"
|
||||||
local dirs dir
|
|
||||||
|
|
||||||
# Verify that the pool isn't already imported
|
# Verify that the pool isn't already imported
|
||||||
# Make as sure as we can to not require '-f' to import.
|
# Make as sure as we can to not require '-f' to import.
|
||||||
@@ -205,7 +201,7 @@ import_pool()
|
|||||||
# to something we can use later with the real import(s). We want to
|
# to something we can use later with the real import(s). We want to
|
||||||
# make sure we find all by* dirs, BUT by-vdev should be first (if it
|
# make sure we find all by* dirs, BUT by-vdev should be first (if it
|
||||||
# exists).
|
# exists).
|
||||||
if [ -n "$USE_DISK_BY_ID" -a -z "$ZPOOL_IMPORT_PATH" ]
|
if [ -n "$USE_DISK_BY_ID" ] && [ -z "$ZPOOL_IMPORT_PATH" ]
|
||||||
then
|
then
|
||||||
dirs="$(for dir in $(echo /dev/disk/by-*)
|
dirs="$(for dir in $(echo /dev/disk/by-*)
|
||||||
do
|
do
|
||||||
@@ -213,7 +209,7 @@ import_pool()
|
|||||||
echo "$dir" | grep -q /by-vdev && continue
|
echo "$dir" | grep -q /by-vdev && continue
|
||||||
[ ! -d "$dir" ] && continue
|
[ ! -d "$dir" ] && continue
|
||||||
|
|
||||||
echo -n "$dir:"
|
printf "%s" "$dir:"
|
||||||
done | sed 's,:$,,g')"
|
done | sed 's,:$,,g')"
|
||||||
|
|
||||||
if [ -d "/dev/disk/by-vdev" ]
|
if [ -d "/dev/disk/by-vdev" ]
|
||||||
@@ -277,7 +273,7 @@ import_pool()
|
|||||||
# with more logging etc.
|
# with more logging etc.
|
||||||
load_module_initrd()
|
load_module_initrd()
|
||||||
{
|
{
|
||||||
if [ "$ZFS_INITRD_PRE_MOUNTROOT_SLEEP" > 0 ]
|
if [ "$ZFS_INITRD_PRE_MOUNTROOT_SLEEP" -gt 0 ] 2>/dev/null
|
||||||
then
|
then
|
||||||
if [ "$quiet" != "y" ]; then
|
if [ "$quiet" != "y" ]; then
|
||||||
zfs_log_begin_msg "Sleeping for" \
|
zfs_log_begin_msg "Sleeping for" \
|
||||||
@@ -288,9 +284,9 @@ load_module_initrd()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Wait for all of the /dev/{hd,sd}[a-z] device nodes to appear.
|
# Wait for all of the /dev/{hd,sd}[a-z] device nodes to appear.
|
||||||
if type wait_for_udev > /dev/null 2>&1 ; then
|
if command -v wait_for_udev > /dev/null 2>&1 ; then
|
||||||
wait_for_udev 10
|
wait_for_udev 10
|
||||||
elif type wait_for_dev > /dev/null 2>&1 ; then
|
elif command -v wait_for_dev > /dev/null 2>&1 ; then
|
||||||
wait_for_dev
|
wait_for_dev
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -300,7 +296,7 @@ load_module_initrd()
|
|||||||
# Load the module
|
# Load the module
|
||||||
load_module "zfs" || return 1
|
load_module "zfs" || return 1
|
||||||
|
|
||||||
if [ "$ZFS_INITRD_POST_MODPROBE_SLEEP" > 0 ]
|
if [ "$ZFS_INITRD_POST_MODPROBE_SLEEP" -gt 0 ] 2>/dev/null
|
||||||
then
|
then
|
||||||
if [ "$quiet" != "y" ]; then
|
if [ "$quiet" != "y" ]; then
|
||||||
zfs_log_begin_msg "Sleeping for" \
|
zfs_log_begin_msg "Sleeping for" \
|
||||||
@@ -316,12 +312,10 @@ load_module_initrd()
|
|||||||
# Mount a given filesystem
|
# Mount a given filesystem
|
||||||
mount_fs()
|
mount_fs()
|
||||||
{
|
{
|
||||||
local fs="$1"
|
fs="$1"
|
||||||
local mountpoint
|
|
||||||
|
|
||||||
# Check that the filesystem exists
|
# Check that the filesystem exists
|
||||||
"${ZFS}" list -oname -tfilesystem -H "${fs}" > /dev/null 2>&1
|
"${ZFS}" list -oname -tfilesystem -H "${fs}" > /dev/null 2>&1 || return 1
|
||||||
[ "$?" -ne 0 ] && return 1
|
|
||||||
|
|
||||||
# Skip filesystems with canmount=off. The root fs should not have
|
# Skip filesystems with canmount=off. The root fs should not have
|
||||||
# canmount=off, but ignore it for backwards compatibility just in case.
|
# canmount=off, but ignore it for backwards compatibility just in case.
|
||||||
@@ -333,14 +327,14 @@ mount_fs()
|
|||||||
|
|
||||||
# Need the _original_ datasets mountpoint!
|
# Need the _original_ datasets mountpoint!
|
||||||
mountpoint=$(get_fs_value "$fs" mountpoint)
|
mountpoint=$(get_fs_value "$fs" mountpoint)
|
||||||
if [ "$mountpoint" = "legacy" -o "$mountpoint" = "none" ]; then
|
if [ "$mountpoint" = "legacy" ] || [ "$mountpoint" = "none" ]; then
|
||||||
# Can't use the mountpoint property. Might be one of our
|
# Can't use the mountpoint property. Might be one of our
|
||||||
# clones. Check the 'org.zol:mountpoint' property set in
|
# clones. Check the 'org.zol:mountpoint' property set in
|
||||||
# clone_snap() if that's usable.
|
# clone_snap() if that's usable.
|
||||||
mountpoint=$(get_fs_value "$fs" org.zol:mountpoint)
|
mountpoint=$(get_fs_value "$fs" org.zol:mountpoint)
|
||||||
if [ "$mountpoint" = "legacy" -o \
|
if [ "$mountpoint" = "legacy" ] ||
|
||||||
"$mountpoint" = "none" -o \
|
[ "$mountpoint" = "none" ] ||
|
||||||
"$mountpoint" = "-" ]
|
[ "$mountpoint" = "-" ]
|
||||||
then
|
then
|
||||||
if [ "$fs" != "${ZFS_BOOTFS}" ]; then
|
if [ "$fs" != "${ZFS_BOOTFS}" ]; then
|
||||||
# We don't have a proper mountpoint and this
|
# We don't have a proper mountpoint and this
|
||||||
@@ -396,10 +390,10 @@ mount_fs()
|
|||||||
# Unlock a ZFS native encrypted filesystem.
|
# Unlock a ZFS native encrypted filesystem.
|
||||||
decrypt_fs()
|
decrypt_fs()
|
||||||
{
|
{
|
||||||
local fs="$1"
|
fs="$1"
|
||||||
|
|
||||||
# If pool encryption is active and the zfs command understands '-o encryption'
|
# If pool encryption is active and the zfs command understands '-o encryption'
|
||||||
if [ "$(zpool list -H -o feature@encryption $(echo "${fs}" | awk -F\/ '{print $1}'))" = 'active' ]; then
|
if [ "$(zpool list -H -o feature@encryption "$(echo "${fs}" | awk -F/ '{print $1}')")" = 'active' ]; then
|
||||||
|
|
||||||
# Determine dataset that holds key for root dataset
|
# Determine dataset that holds key for root dataset
|
||||||
ENCRYPTIONROOT="$(get_fs_value "${fs}" encryptionroot)"
|
ENCRYPTIONROOT="$(get_fs_value "${fs}" encryptionroot)"
|
||||||
@@ -427,7 +421,7 @@ decrypt_fs()
|
|||||||
TRY_COUNT=$((TRY_COUNT - 1))
|
TRY_COUNT=$((TRY_COUNT - 1))
|
||||||
done
|
done
|
||||||
|
|
||||||
# Prompt with systemd, if active
|
# Prompt with systemd, if active
|
||||||
elif [ -e /run/systemd/system ]; then
|
elif [ -e /run/systemd/system ]; then
|
||||||
echo "systemd-ask-password" > /run/zfs_console_askpwd_cmd
|
echo "systemd-ask-password" > /run/zfs_console_askpwd_cmd
|
||||||
while [ $TRY_COUNT -gt 0 ]; do
|
while [ $TRY_COUNT -gt 0 ]; do
|
||||||
@@ -454,7 +448,7 @@ decrypt_fs()
|
|||||||
# Destroy a given filesystem.
|
# Destroy a given filesystem.
|
||||||
destroy_fs()
|
destroy_fs()
|
||||||
{
|
{
|
||||||
local fs="$1"
|
fs="$1"
|
||||||
|
|
||||||
[ "$quiet" != "y" ] && \
|
[ "$quiet" != "y" ] && \
|
||||||
zfs_log_begin_msg "Destroying '$fs'"
|
zfs_log_begin_msg "Destroying '$fs'"
|
||||||
@@ -489,9 +483,9 @@ destroy_fs()
|
|||||||
# mounted with a 'zfs mount -a' in the init/systemd scripts).
|
# mounted with a 'zfs mount -a' in the init/systemd scripts).
|
||||||
clone_snap()
|
clone_snap()
|
||||||
{
|
{
|
||||||
local snap="$1"
|
snap="$1"
|
||||||
local destfs="$2"
|
destfs="$2"
|
||||||
local mountpoint="$3"
|
mountpoint="$3"
|
||||||
|
|
||||||
[ "$quiet" != "y" ] && zfs_log_begin_msg "Cloning '$snap' to '$destfs'"
|
[ "$quiet" != "y" ] && zfs_log_begin_msg "Cloning '$snap' to '$destfs'"
|
||||||
|
|
||||||
@@ -529,7 +523,7 @@ clone_snap()
|
|||||||
# Rollback a given snapshot.
|
# Rollback a given snapshot.
|
||||||
rollback_snap()
|
rollback_snap()
|
||||||
{
|
{
|
||||||
local snap="$1"
|
snap="$1"
|
||||||
|
|
||||||
[ "$quiet" != "y" ] && zfs_log_begin_msg "Rollback $snap"
|
[ "$quiet" != "y" ] && zfs_log_begin_msg "Rollback $snap"
|
||||||
|
|
||||||
@@ -559,9 +553,8 @@ rollback_snap()
|
|||||||
# to the user to choose from.
|
# to the user to choose from.
|
||||||
ask_user_snap()
|
ask_user_snap()
|
||||||
{
|
{
|
||||||
local fs="$1"
|
fs="$1"
|
||||||
local i=1
|
i=1
|
||||||
local SNAP snapnr snap debug
|
|
||||||
|
|
||||||
# We need to temporarily disable debugging. Set 'debug' so we
|
# We need to temporarily disable debugging. Set 'debug' so we
|
||||||
# remember to enabled it again.
|
# remember to enabled it again.
|
||||||
@@ -574,16 +567,16 @@ ask_user_snap()
|
|||||||
# Because we need the resulting snapshot, which is sent on
|
# Because we need the resulting snapshot, which is sent on
|
||||||
# stdout to the caller, we use stderr for our questions.
|
# stdout to the caller, we use stderr for our questions.
|
||||||
echo "What snapshot do you want to boot from?" > /dev/stderr
|
echo "What snapshot do you want to boot from?" > /dev/stderr
|
||||||
while read snap; do
|
while read -r snap; do
|
||||||
echo " $i: ${snap}" > /dev/stderr
|
echo " $i: ${snap}" > /dev/stderr
|
||||||
eval `echo SNAP_$i=$snap`
|
eval "$(echo SNAP_$i=$snap)"
|
||||||
i=$((i + 1))
|
i=$((i + 1))
|
||||||
done <<EOT
|
done <<EOT
|
||||||
$("${ZFS}" list -H -oname -tsnapshot -r "${fs}")
|
$("${ZFS}" list -H -oname -tsnapshot -r "${fs}")
|
||||||
EOT
|
EOT
|
||||||
|
|
||||||
echo -n " Snap nr [1-$((i-1))]? " > /dev/stderr
|
echo "%s" " Snap nr [1-$((i-1))]? " > /dev/stderr
|
||||||
read snapnr
|
read -r snapnr
|
||||||
|
|
||||||
# Re-enable debugging.
|
# Re-enable debugging.
|
||||||
if [ -n "${debug}" ]; then
|
if [ -n "${debug}" ]; then
|
||||||
@@ -591,16 +584,16 @@ EOT
|
|||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$(eval echo "$"SNAP_$snapnr)"
|
echo "$(eval echo '$SNAP_'$snapnr)"
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_snapshot_booting()
|
setup_snapshot_booting()
|
||||||
{
|
{
|
||||||
local snap="$1"
|
snap="$1"
|
||||||
local s destfs subfs mountpoint retval=0 filesystems fs
|
retval=0
|
||||||
|
|
||||||
# Make sure that the snapshot specified actually exist.
|
# Make sure that the snapshot specified actually exists.
|
||||||
if [ ! $(get_fs_value "${snap}" type) ]
|
if [ ! "$(get_fs_value "${snap}" type)" ]
|
||||||
then
|
then
|
||||||
# Snapshot does not exist (...@<null> ?)
|
# Snapshot does not exist (...@<null> ?)
|
||||||
# ask the user for a snapshot to use.
|
# ask the user for a snapshot to use.
|
||||||
@@ -617,7 +610,7 @@ setup_snapshot_booting()
|
|||||||
then
|
then
|
||||||
# If the destination dataset for the clone
|
# If the destination dataset for the clone
|
||||||
# already exists, destroy it. Recursively
|
# already exists, destroy it. Recursively
|
||||||
if [ $(get_fs_value "${rootfs}_${snapname}" type) ]; then
|
if [ "$(get_fs_value "${rootfs}_${snapname}" type)" ]; then
|
||||||
filesystems=$("${ZFS}" list -oname -tfilesystem -H \
|
filesystems=$("${ZFS}" list -oname -tfilesystem -H \
|
||||||
-r -Sname "${ZFS_BOOTFS}")
|
-r -Sname "${ZFS_BOOTFS}")
|
||||||
for fs in $filesystems; do
|
for fs in $filesystems; do
|
||||||
@@ -652,8 +645,8 @@ setup_snapshot_booting()
|
|||||||
# with clone_snap(). If legacy or none, then use
|
# with clone_snap(). If legacy or none, then use
|
||||||
# the sub fs value.
|
# the sub fs value.
|
||||||
mountpoint=$(get_fs_value "${s%%@*}" mountpoint)
|
mountpoint=$(get_fs_value "${s%%@*}" mountpoint)
|
||||||
if [ "$mountpoint" = "legacy" -o \
|
if [ "$mountpoint" = "legacy" ] || \
|
||||||
"$mountpoint" = "none" ]
|
[ "$mountpoint" = "none" ]
|
||||||
then
|
then
|
||||||
if [ -n "${subfs}" ]; then
|
if [ -n "${subfs}" ]; then
|
||||||
mountpoint="${subfs}"
|
mountpoint="${subfs}"
|
||||||
@@ -678,8 +671,6 @@ setup_snapshot_booting()
|
|||||||
# This is the main function.
|
# This is the main function.
|
||||||
mountroot()
|
mountroot()
|
||||||
{
|
{
|
||||||
local snaporig snapsub destfs pool POOLS
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
# I N I T I A L S E T U P
|
# I N I T I A L S E T U P
|
||||||
|
|
||||||
@@ -742,7 +733,7 @@ mountroot()
|
|||||||
# No longer set in the defaults file, but it could have been set in
|
# No longer set in the defaults file, but it could have been set in
|
||||||
# get_pools() in some circumstances. If it's something, but not 'yes',
|
# get_pools() in some circumstances. If it's something, but not 'yes',
|
||||||
# it's no good to us.
|
# it's no good to us.
|
||||||
[ -n "$USE_DISK_BY_ID" -a "$USE_DISK_BY_ID" != 'yes' ] && \
|
[ -n "$USE_DISK_BY_ID" ] && [ "$USE_DISK_BY_ID" != 'yes' ] && \
|
||||||
unset USE_DISK_BY_ID
|
unset USE_DISK_BY_ID
|
||||||
|
|
||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
@@ -788,12 +779,12 @@ mountroot()
|
|||||||
# ------------
|
# ------------
|
||||||
# If we have 'ROOT' (see above), but not 'ZFS_BOOTFS', then use
|
# If we have 'ROOT' (see above), but not 'ZFS_BOOTFS', then use
|
||||||
# 'ROOT'
|
# 'ROOT'
|
||||||
[ -n "$ROOT" -a -z "${ZFS_BOOTFS}" ] && ZFS_BOOTFS="$ROOT"
|
[ -n "$ROOT" ] && [ -z "${ZFS_BOOTFS}" ] && ZFS_BOOTFS="$ROOT"
|
||||||
|
|
||||||
# ------------
|
# ------------
|
||||||
# Check for the `-B zfs-bootfs=%s/%u,...` kind of parameter.
|
# Check for the `-B zfs-bootfs=%s/%u,...` kind of parameter.
|
||||||
# NOTE: Only use the pool name and dataset. The rest is not
|
# NOTE: Only use the pool name and dataset. The rest is not
|
||||||
# supported by ZoL (whatever it's for).
|
# supported by OpenZFS (whatever it's for).
|
||||||
if [ -z "$ZFS_RPOOL" ]
|
if [ -z "$ZFS_RPOOL" ]
|
||||||
then
|
then
|
||||||
# The ${zfs-bootfs} variable is set at the kernel command
|
# The ${zfs-bootfs} variable is set at the kernel command
|
||||||
@@ -809,11 +800,11 @@ mountroot()
|
|||||||
|
|
||||||
# ------------
|
# ------------
|
||||||
# No root fs or pool specified - do auto detect.
|
# No root fs or pool specified - do auto detect.
|
||||||
if [ -z "$ZFS_RPOOL" -a -z "${ZFS_BOOTFS}" ]
|
if [ -z "$ZFS_RPOOL" ] && [ -z "${ZFS_BOOTFS}" ]
|
||||||
then
|
then
|
||||||
# Do auto detect. Do this by 'cheating' - set 'root=zfs:AUTO'
|
# Do auto detect. Do this by 'cheating' - set 'root=zfs:AUTO'
|
||||||
# which will be caught later
|
# which will be caught later
|
||||||
ROOT=zfs:AUTO
|
ROOT='zfs:AUTO'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ----------------------------------------------------------------
|
# ----------------------------------------------------------------
|
||||||
@@ -858,7 +849,7 @@ mountroot()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Import the pool (if not already done so in the AUTO check above).
|
# Import the pool (if not already done so in the AUTO check above).
|
||||||
if [ -n "$ZFS_RPOOL" -a -z "${POOL_IMPORTED}" ]
|
if [ -n "$ZFS_RPOOL" ] && [ -z "${POOL_IMPORTED}" ]
|
||||||
then
|
then
|
||||||
[ "$quiet" != "y" ] && \
|
[ "$quiet" != "y" ] && \
|
||||||
zfs_log_begin_msg "Importing ZFS root pool '$ZFS_RPOOL'"
|
zfs_log_begin_msg "Importing ZFS root pool '$ZFS_RPOOL'"
|
||||||
@@ -971,7 +962,7 @@ mountroot()
|
|||||||
|
|
||||||
touch /run/zfs_unlock_complete
|
touch /run/zfs_unlock_complete
|
||||||
if [ -e /run/zfs_unlock_complete_notify ]; then
|
if [ -e /run/zfs_unlock_complete_notify ]; then
|
||||||
read zfs_unlock_complete_notify < /run/zfs_unlock_complete_notify
|
read -r zfs_unlock_complete_notify < /run/zfs_unlock_complete_notify
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ------------
|
# ------------
|
||||||
@@ -989,8 +980,8 @@ mountroot()
|
|||||||
echo
|
echo
|
||||||
|
|
||||||
echo "=> waiting for ENTER before continuing because of 'zfsdebug=1'. "
|
echo "=> waiting for ENTER before continuing because of 'zfsdebug=1'. "
|
||||||
echo -n " 'c' for shell, 'r' for reboot, 'ENTER' to continue. "
|
printf "%s" " 'c' for shell, 'r' for reboot, 'ENTER' to continue. "
|
||||||
read b
|
read -r b
|
||||||
|
|
||||||
[ "$b" = "c" ] && /bin/sh
|
[ "$b" = "c" ] && /bin/sh
|
||||||
[ "$b" = "r" ] && reboot -f
|
[ "$b" = "r" ] && reboot -f
|
||||||
@@ -1000,12 +991,14 @@ mountroot()
|
|||||||
|
|
||||||
# ------------
|
# ------------
|
||||||
# Run local bottom script
|
# Run local bottom script
|
||||||
if type run_scripts > /dev/null 2>&1 && \
|
if command -v run_scripts > /dev/null 2>&1
|
||||||
[ -f "/scripts/local-bottom" -o -d "/scripts/local-bottom" ]
|
|
||||||
then
|
then
|
||||||
[ "$quiet" != "y" ] && \
|
if [ -f "/scripts/local-bottom" ] || [ -d "/scripts/local-bottom" ]
|
||||||
zfs_log_begin_msg "Running /scripts/local-bottom"
|
then
|
||||||
run_scripts /scripts/local-bottom
|
[ "$quiet" != "y" ] && \
|
||||||
[ "$quiet" != "y" ] && zfs_log_end_msg
|
zfs_log_begin_msg "Running /scripts/local-bottom"
|
||||||
|
run_scripts /scripts/local-bottom
|
||||||
|
[ "$quiet" != "y" ] && zfs_log_end_msg
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
cryptohash.h was dropped and merged with crypto/sha.sh in 5.8 kernel. Details in:
|
||||||
|
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=228c4f265c6eb60eaa4ed0edb3bf7c113173576c
|
||||||
|
|
||||||
|
---
|
||||||
|
diff --git a/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c b/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c
|
||||||
|
index 4c389da..e602377 100644
|
||||||
|
--- a/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c
|
||||||
|
+++ b/quickassist/utilities/osal/src/linux/kernel_space/OsalCryptoInterface.c
|
||||||
|
@@ -66,7 +66,7 @@
|
||||||
|
|
||||||
|
#include "Osal.h"
|
||||||
|
#include <linux/crypto.h>
|
||||||
|
-#include <linux/cryptohash.h>
|
||||||
|
+#include <crypto/sha.h>
|
||||||
|
#include <linux/version.h>
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29))
|
||||||
|
#include <crypto/internal/hash.h>
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
In kernel 5.7 the pci_cleanup_aer_uncorrect_error_status() function was
|
||||||
|
renamed with the following commit:
|
||||||
|
|
||||||
|
git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=894020fdd88c1e9a74c60b67c0f19f1c7696ba2f
|
||||||
|
|
||||||
|
This simply updates the function call with the proper name (pci_aer_clear_nonfatal_status()).
|
||||||
|
|
||||||
|
---
|
||||||
|
diff --git a/quickassist/qat/drivers/crypto/qat/qat_common/adf_aer.c b/quickassist/qat/drivers/crypto/qat/qat_common/adf_aer.c
|
||||||
|
index a6ce6df..545bb79 100644
|
||||||
|
--- a/quickassist/qat/drivers/crypto/qat/qat_common/adf_aer.c
|
||||||
|
+++ b/quickassist/qat/drivers/crypto/qat/qat_common/adf_aer.c
|
||||||
|
@@ -304,7 +304,7 @@ static pci_ers_result_t adf_slot_reset(struct pci_dev *pdev)
|
||||||
|
pr_err("QAT: Can't find acceleration device\n");
|
||||||
|
return PCI_ERS_RESULT_DISCONNECT;
|
||||||
|
}
|
||||||
|
- pci_cleanup_aer_uncorrect_error_status(pdev);
|
||||||
|
+ pci_aer_clear_nonfatal_status(pdev);
|
||||||
|
if (adf_dev_aer_schedule_reset(accel_dev, ADF_DEV_RESET_SYNC))
|
||||||
|
return PCI_ERS_RESULT_DISCONNECT;
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
This patch attempts to expose timespec and getnstimeofday which were
|
||||||
|
explicitly hidden in the 5.6 kernel with the introduction of the
|
||||||
|
following commits:
|
||||||
|
|
||||||
|
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c766d1472c70d25ad475cf56042af1652e792b23
|
||||||
|
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=412c53a680a97cb1ae2c0ab60230e193bee86387
|
||||||
|
|
||||||
|
Code received from users@dpdk.org, issue tracked under QATE-59888.
|
||||||
|
|
||||||
|
---
|
||||||
|
diff --git a/quickassist/lookaside/access_layer/src/sample_code/performance/framework/linux/kernel_space/cpa_sample_code_utils.c b/quickassist/lookaside/access_layer/src/sample_code/performance/framework/linux/kernel_space/cpa_sample_code_utils.c
|
||||||
|
index 4639834..523e376 100644
|
||||||
|
--- a/quickassist/lookaside/access_layer/src/sample_code/performance/framework/linux/kernel_space/cpa_sample_code_utils.c
|
||||||
|
+++ b/quickassist/lookaside/access_layer/src/sample_code/performance/framework/linux/kernel_space/cpa_sample_code_utils.c
|
||||||
|
@@ -107,6 +107,8 @@ atomic_t arrived;
|
||||||
|
extern struct device perf_device;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#define timespec timespec64
|
||||||
|
+#define getnstimeofday ktime_get_real_ts64
|
||||||
|
|
||||||
|
/* Define a number for timeout */
|
||||||
|
#define SAMPLE_CODE_MAX_LONG (0x7FFFFFFF)
|
||||||
|
diff --git a/quickassist/qat/compat/qat_compat.h b/quickassist/qat/compat/qat_compat.h
|
||||||
|
index 2a02eaf..3515092 100644
|
||||||
|
--- a/quickassist/qat/compat/qat_compat.h
|
||||||
|
+++ b/quickassist/qat/compat/qat_compat.h
|
||||||
|
@@ -466,4 +466,7 @@ static inline void pci_ignore_hotplug(struct pci_dev *dev)
|
||||||
|
#if (RHEL_RELEASE_CODE && RHEL_RELEASE_VERSION(7, 3) <= RHEL_RELEASE_CODE)
|
||||||
|
#define QAT_KPT_CAP_DISCOVERY
|
||||||
|
#endif
|
||||||
|
+
|
||||||
|
+#define timespec timespec64
|
||||||
|
+#define getnstimeofday ktime_get_real_ts64
|
||||||
|
#endif /* _QAT_COMPAT_H_ */
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
BSD LICENSE
|
||||||
|
|
||||||
|
Copyright (c) Intel Corporation.
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions
|
||||||
|
are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer.
|
||||||
|
* 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.
|
||||||
|
* Neither the name of Intel Corporation nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived
|
||||||
|
from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
|
||||||
|
OWNER 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.
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
# Intel_QAT easy install script
|
||||||
|
|
||||||
|
This contrib contains community compatibility patches to get Intel QAT working on the following kernel versions:
|
||||||
|
- 5.6
|
||||||
|
- 5.7
|
||||||
|
- 5.8
|
||||||
|
|
||||||
|
These patches are based on the following Intel QAT version:
|
||||||
|
[1.7.l.4.10.0-00014](https://01.org/sites/default/files/downloads/qat1.7.l.4.10.0-00014.tar.gz)
|
||||||
|
|
||||||
|
When using QAT with above kernels versions, the following patches needs to be applied using:
|
||||||
|
patch -p1 < _$PATCH_
|
||||||
|
_Where $PATCH refers to the path of the patch in question_
|
||||||
|
|
||||||
|
### 5.6
|
||||||
|
/patch/0001-timespec.diff
|
||||||
|
|
||||||
|
### 5.7
|
||||||
|
/patch/0001-pci_aer.diff
|
||||||
|
|
||||||
|
### 5.8
|
||||||
|
/patch/0001-cryptohash.diff
|
||||||
|
|
||||||
|
|
||||||
|
_Patches are supplied by [Storage Performance Development Kit (SPDK)](https://github.com/spdk/spdk)_
|
||||||
|
|
||||||
|
|
||||||
@@ -386,6 +386,8 @@ unmount_unload(pam_handle_t *pamh, const char *ds_name)
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
char *homes_prefix;
|
char *homes_prefix;
|
||||||
char *runstatedir;
|
char *runstatedir;
|
||||||
|
char *homedir;
|
||||||
|
char *dsname;
|
||||||
uid_t uid;
|
uid_t uid;
|
||||||
const char *username;
|
const char *username;
|
||||||
int unmount_and_unload;
|
int unmount_and_unload;
|
||||||
@@ -423,6 +425,8 @@ zfs_key_config_load(pam_handle_t *pamh, zfs_key_config_t *config,
|
|||||||
config->uid = entry->pw_uid;
|
config->uid = entry->pw_uid;
|
||||||
config->username = name;
|
config->username = name;
|
||||||
config->unmount_and_unload = 1;
|
config->unmount_and_unload = 1;
|
||||||
|
config->dsname = NULL;
|
||||||
|
config->homedir = NULL;
|
||||||
for (int c = 0; c < argc; c++) {
|
for (int c = 0; c < argc; c++) {
|
||||||
if (strncmp(argv[c], "homes=", 6) == 0) {
|
if (strncmp(argv[c], "homes=", 6) == 0) {
|
||||||
free(config->homes_prefix);
|
free(config->homes_prefix);
|
||||||
@@ -432,6 +436,8 @@ zfs_key_config_load(pam_handle_t *pamh, zfs_key_config_t *config,
|
|||||||
config->runstatedir = strdup(argv[c] + 12);
|
config->runstatedir = strdup(argv[c] + 12);
|
||||||
} else if (strcmp(argv[c], "nounmount") == 0) {
|
} else if (strcmp(argv[c], "nounmount") == 0) {
|
||||||
config->unmount_and_unload = 0;
|
config->unmount_and_unload = 0;
|
||||||
|
} else if (strcmp(argv[c], "prop_mountpoint") == 0) {
|
||||||
|
config->homedir = strdup(entry->pw_dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
@@ -441,11 +447,59 @@ static void
|
|||||||
zfs_key_config_free(zfs_key_config_t *config)
|
zfs_key_config_free(zfs_key_config_t *config)
|
||||||
{
|
{
|
||||||
free(config->homes_prefix);
|
free(config->homes_prefix);
|
||||||
|
free(config->runstatedir);
|
||||||
|
free(config->homedir);
|
||||||
|
free(config->dsname);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
find_dsname_by_prop_value(zfs_handle_t *zhp, void *data)
|
||||||
|
{
|
||||||
|
zfs_type_t type = zfs_get_type(zhp);
|
||||||
|
zfs_key_config_t *target = data;
|
||||||
|
char mountpoint[ZFS_MAXPROPLEN];
|
||||||
|
|
||||||
|
/* Skip any datasets whose type does not match */
|
||||||
|
if ((type & ZFS_TYPE_FILESYSTEM) == 0) {
|
||||||
|
zfs_close(zhp);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Skip any datasets whose mountpoint does not match */
|
||||||
|
(void) zfs_prop_get(zhp, ZFS_PROP_MOUNTPOINT, mountpoint,
|
||||||
|
sizeof (mountpoint), NULL, NULL, 0, B_FALSE);
|
||||||
|
if (strcmp(target->homedir, mountpoint) != 0) {
|
||||||
|
zfs_close(zhp);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
target->dsname = strdup(zfs_get_name(zhp));
|
||||||
|
zfs_close(zhp);
|
||||||
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
zfs_key_config_get_dataset(zfs_key_config_t *config)
|
zfs_key_config_get_dataset(zfs_key_config_t *config)
|
||||||
{
|
{
|
||||||
|
if (config->homedir != NULL &&
|
||||||
|
config->homes_prefix != NULL) {
|
||||||
|
zfs_handle_t *zhp = zfs_open(g_zfs, config->homes_prefix,
|
||||||
|
ZFS_TYPE_FILESYSTEM);
|
||||||
|
if (zhp == NULL) {
|
||||||
|
pam_syslog(NULL, LOG_ERR, "dataset %s not found",
|
||||||
|
config->homes_prefix);
|
||||||
|
zfs_close(zhp);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
(void) zfs_iter_filesystems(zhp, find_dsname_by_prop_value,
|
||||||
|
config);
|
||||||
|
zfs_close(zhp);
|
||||||
|
char *dsname = config->dsname;
|
||||||
|
config->dsname = NULL;
|
||||||
|
return (dsname);
|
||||||
|
}
|
||||||
|
|
||||||
size_t len = ZFS_MAX_DATASET_NAME_LEN;
|
size_t len = ZFS_MAX_DATASET_NAME_LEN;
|
||||||
size_t total_len = strlen(config->homes_prefix) + 1
|
size_t total_len = strlen(config->homes_prefix) + 1
|
||||||
+ strlen(config->username);
|
+ strlen(config->username);
|
||||||
|
|||||||
@@ -25,4 +25,4 @@ a temporary directory specified by, for instance, TMP environment
|
|||||||
variable on a memory backed filesystem.
|
variable on a memory backed filesystem.
|
||||||
|
|
||||||
Package documentation: http://pyzfs.readthedocs.org
|
Package documentation: http://pyzfs.readthedocs.org
|
||||||
Package development: https://github.com/zfsonlinux/zfs
|
Package development: https://github.com/openzfs/zfs
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ of the error codes to the exceptions by interpreting a context
|
|||||||
in which the error code is produced.
|
in which the error code is produced.
|
||||||
|
|
||||||
To submit an issue or contribute to development of this package
|
To submit an issue or contribute to development of this package
|
||||||
please visit its `GitHub repository <https://github.com/zfsonlinux/zfs>`_.
|
please visit its `GitHub repository <https://github.com/openzfs/zfs>`_.
|
||||||
|
|
||||||
.. data:: MAXNAMELEN
|
.. data:: MAXNAMELEN
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -35,9 +35,9 @@ config ZFS
|
|||||||
select ZLIB_INFLATE
|
select ZLIB_INFLATE
|
||||||
select ZLIB_DEFLATE
|
select ZLIB_DEFLATE
|
||||||
help
|
help
|
||||||
This is the ZFS filesystem from the ZFS On Linux project.
|
This is the ZFS filesystem from the OpenZFS project.
|
||||||
|
|
||||||
See https://zfsonlinux.org/
|
See https://github.com/openzfs/zfs
|
||||||
|
|
||||||
To compile this file system support as a module, choose M here.
|
To compile this file system support as a module, choose M here.
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ DESCRIPTION
|
|||||||
|
|
||||||
SUPPORT
|
SUPPORT
|
||||||
If you find that they don't work for your platform, please report this
|
If you find that they don't work for your platform, please report this
|
||||||
at the ZFS On Linux issue tracker at https://github.com/zfsonlinux/zfs/issues.
|
at the OpenZFS issue tracker at https://github.com/openzfs/zfs/issues.
|
||||||
|
|
||||||
Please include:
|
Please include:
|
||||||
|
|
||||||
|
|||||||
@@ -38,8 +38,6 @@ do_fail() {
|
|||||||
is_known() {
|
is_known() {
|
||||||
query="$1"
|
query="$1"
|
||||||
IFS=' '
|
IFS=' '
|
||||||
# protect against special characters
|
|
||||||
set -f
|
|
||||||
for element in $2 ; do
|
for element in $2 ; do
|
||||||
if [ "$query" = "$element" ] ; then
|
if [ "$query" = "$element" ] ; then
|
||||||
return 0
|
return 0
|
||||||
@@ -54,8 +52,7 @@ is_known() {
|
|||||||
create_dependencies() {
|
create_dependencies() {
|
||||||
unitfile="$1"
|
unitfile="$1"
|
||||||
suffix="$2"
|
suffix="$2"
|
||||||
# protect against special characters
|
IFS=' '
|
||||||
set -f
|
|
||||||
for target in $3 ; do
|
for target in $3 ; do
|
||||||
target_dir="${dest_norm}/${target}.${suffix}/"
|
target_dir="${dest_norm}/${target}.${suffix}/"
|
||||||
mkdir -p "${target_dir}"
|
mkdir -p "${target_dir}"
|
||||||
@@ -72,6 +69,7 @@ else
|
|||||||
do_fail "zero or three arguments required"
|
do_fail "zero or three arguments required"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
pools=$(zpool list -H -o name || true)
|
||||||
|
|
||||||
# All needed information about each ZFS is available from
|
# All needed information about each ZFS is available from
|
||||||
# zfs list -H -t filesystem -o <properties>
|
# zfs list -H -t filesystem -o <properties>
|
||||||
@@ -83,11 +81,11 @@ process_line() {
|
|||||||
# zfs list -H -o name,...
|
# zfs list -H -o name,...
|
||||||
# fields are tab separated
|
# fields are tab separated
|
||||||
IFS="$(printf '\t')"
|
IFS="$(printf '\t')"
|
||||||
# protect against special characters in, e.g., mountpoints
|
|
||||||
set -f
|
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
set -- $1
|
set -- $1
|
||||||
|
|
||||||
dataset="${1}"
|
dataset="${1}"
|
||||||
|
pool="${dataset%%/*}"
|
||||||
p_mountpoint="${2}"
|
p_mountpoint="${2}"
|
||||||
p_canmount="${3}"
|
p_canmount="${3}"
|
||||||
p_atime="${4}"
|
p_atime="${4}"
|
||||||
@@ -120,6 +118,25 @@ process_line() {
|
|||||||
requiredby=""
|
requiredby=""
|
||||||
noauto="off"
|
noauto="off"
|
||||||
|
|
||||||
|
# If the pool is already imported, zfs-import.target is not needed. This
|
||||||
|
# avoids a dependency loop on root-on-ZFS systems:
|
||||||
|
# systemd-random-seed.service After (via RequiresMountsFor) var-lib.mount
|
||||||
|
# After zfs-import.target After zfs-import-{cache,scan}.service After
|
||||||
|
# cryptsetup.service After systemd-random-seed.service.
|
||||||
|
#
|
||||||
|
# Pools are newline-separated and may contain spaces in their names.
|
||||||
|
# There is no better portable way to set IFS to just a newline. Using
|
||||||
|
# $(printf '\n') doesn't work because $(...) strips trailing newlines.
|
||||||
|
IFS="
|
||||||
|
"
|
||||||
|
for p in $pools ; do
|
||||||
|
if [ "$p" = "$pool" ] ; then
|
||||||
|
after=""
|
||||||
|
wants=""
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
if [ -n "${p_systemd_after}" ] && \
|
if [ -n "${p_systemd_after}" ] && \
|
||||||
[ "${p_systemd_after}" != "-" ] ; then
|
[ "${p_systemd_after}" != "-" ] ; then
|
||||||
after="${p_systemd_after} ${after}"
|
after="${p_systemd_after} ${after}"
|
||||||
@@ -204,6 +221,10 @@ ${keymountdep}
|
|||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
|
# This avoids a dependency loop involving systemd-journald.socket if this
|
||||||
|
# dataset is a parent of the root filesystem.
|
||||||
|
StandardOutput=null
|
||||||
|
StandardError=null
|
||||||
ExecStart=${keyloadcmd}
|
ExecStart=${keyloadcmd}
|
||||||
ExecStop=${keyunloadcmd}" > "${dest_norm}/${keyloadunit}"
|
ExecStop=${keyunloadcmd}" > "${dest_norm}/${keyloadunit}"
|
||||||
fi
|
fi
|
||||||
@@ -438,6 +459,8 @@ Options=defaults${opts},zfsutil" > "${dest_norm}/${mountfile}"
|
|||||||
}
|
}
|
||||||
|
|
||||||
for cachefile in "${FSLIST}/"* ; do
|
for cachefile in "${FSLIST}/"* ; do
|
||||||
|
# Disable glob expansion to protect against special characters when parsing.
|
||||||
|
set -f
|
||||||
# Sort cachefile's lines by canmount, "on" before "noauto"
|
# Sort cachefile's lines by canmount, "on" before "noauto"
|
||||||
# and feed each line into process_line
|
# and feed each line into process_line
|
||||||
sort -t "$(printf '\t')" -k 3 -r "${cachefile}" | \
|
sort -t "$(printf '\t')" -k 3 -r "${cachefile}" | \
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ After=systemd-udev-settle.service
|
|||||||
After=zfs-import.target
|
After=zfs-import.target
|
||||||
After=systemd-remount-fs.service
|
After=systemd-remount-fs.service
|
||||||
Before=local-fs.target
|
Before=local-fs.target
|
||||||
Before=systemd-random-seed.service
|
|
||||||
ConditionPathIsDirectory=/sys/module/zfs
|
ConditionPathIsDirectory=/sys/module/zfs
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ Wants=zfs-mount.service
|
|||||||
After=zfs-mount.service
|
After=zfs-mount.service
|
||||||
PartOf=nfs-server.service nfs-kernel-server.service
|
PartOf=nfs-server.service nfs-kernel-server.service
|
||||||
PartOf=smb.service
|
PartOf=smb.service
|
||||||
|
ConditionPathIsDirectory=/sys/module/zfs
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ Description=Wait for ZFS Volume (zvol) links in /dev
|
|||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
After=systemd-udev-settle.service
|
After=systemd-udev-settle.service
|
||||||
After=zfs-import.target
|
After=zfs-import.target
|
||||||
|
ConditionPathIsDirectory=/sys/module/zfs
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=ZFS Event Daemon (zed)
|
Description=ZFS Event Daemon (zed)
|
||||||
Documentation=man:zed(8)
|
Documentation=man:zed(8)
|
||||||
|
ConditionPathIsDirectory=/sys/module/zfs
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=@sbindir@/zed -F
|
ExecStart=@sbindir@/zed -F
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ USER_H = \
|
|||||||
libuutil.h \
|
libuutil.h \
|
||||||
libuutil_impl.h \
|
libuutil_impl.h \
|
||||||
libzfs.h \
|
libzfs.h \
|
||||||
|
libzfsbootenv.h \
|
||||||
libzfs_core.h \
|
libzfs_core.h \
|
||||||
libzfs_impl.h \
|
libzfs_impl.h \
|
||||||
libzutil.h \
|
libzutil.h \
|
||||||
|
|||||||
+18
-6
@@ -88,8 +88,8 @@ typedef enum zfs_error {
|
|||||||
EZFS_ZONED, /* used improperly in local zone */
|
EZFS_ZONED, /* used improperly in local zone */
|
||||||
EZFS_MOUNTFAILED, /* failed to mount dataset */
|
EZFS_MOUNTFAILED, /* failed to mount dataset */
|
||||||
EZFS_UMOUNTFAILED, /* failed to unmount dataset */
|
EZFS_UMOUNTFAILED, /* failed to unmount dataset */
|
||||||
EZFS_UNSHARENFSFAILED, /* unshare(1M) failed */
|
EZFS_UNSHARENFSFAILED, /* failed to unshare over nfs */
|
||||||
EZFS_SHARENFSFAILED, /* share(1M) failed */
|
EZFS_SHARENFSFAILED, /* failed to share over nfs */
|
||||||
EZFS_PERM, /* permission denied */
|
EZFS_PERM, /* permission denied */
|
||||||
EZFS_NOSPC, /* out of space */
|
EZFS_NOSPC, /* out of space */
|
||||||
EZFS_FAULT, /* bad address */
|
EZFS_FAULT, /* bad address */
|
||||||
@@ -556,7 +556,7 @@ extern void zfs_prune_proplist(zfs_handle_t *, uint8_t *);
|
|||||||
/*
|
/*
|
||||||
* zpool property management
|
* zpool property management
|
||||||
*/
|
*/
|
||||||
extern int zpool_expand_proplist(zpool_handle_t *, zprop_list_t **);
|
extern int zpool_expand_proplist(zpool_handle_t *, zprop_list_t **, boolean_t);
|
||||||
extern int zpool_prop_get_feature(zpool_handle_t *, const char *, char *,
|
extern int zpool_prop_get_feature(zpool_handle_t *, const char *, char *,
|
||||||
size_t);
|
size_t);
|
||||||
extern const char *zpool_prop_default_string(zpool_prop_t);
|
extern const char *zpool_prop_default_string(zpool_prop_t);
|
||||||
@@ -642,7 +642,19 @@ extern int zfs_snapshot(libzfs_handle_t *, const char *, boolean_t, nvlist_t *);
|
|||||||
extern int zfs_snapshot_nvl(libzfs_handle_t *hdl, nvlist_t *snaps,
|
extern int zfs_snapshot_nvl(libzfs_handle_t *hdl, nvlist_t *snaps,
|
||||||
nvlist_t *props);
|
nvlist_t *props);
|
||||||
extern int zfs_rollback(zfs_handle_t *, zfs_handle_t *, boolean_t);
|
extern int zfs_rollback(zfs_handle_t *, zfs_handle_t *, boolean_t);
|
||||||
extern int zfs_rename(zfs_handle_t *, const char *, boolean_t, boolean_t);
|
|
||||||
|
typedef struct renameflags {
|
||||||
|
/* recursive rename */
|
||||||
|
int recursive : 1;
|
||||||
|
|
||||||
|
/* don't unmount file systems */
|
||||||
|
int nounmount : 1;
|
||||||
|
|
||||||
|
/* force unmount file systems */
|
||||||
|
int forceunmount : 1;
|
||||||
|
} renameflags_t;
|
||||||
|
|
||||||
|
extern int zfs_rename(zfs_handle_t *, const char *, renameflags_t);
|
||||||
|
|
||||||
typedef struct sendflags {
|
typedef struct sendflags {
|
||||||
/* Amount of extra information to print. */
|
/* Amount of extra information to print. */
|
||||||
@@ -880,8 +892,8 @@ extern int zpool_in_use(libzfs_handle_t *, int, pool_state_t *, char **,
|
|||||||
* Label manipulation.
|
* Label manipulation.
|
||||||
*/
|
*/
|
||||||
extern int zpool_clear_label(int);
|
extern int zpool_clear_label(int);
|
||||||
extern int zpool_set_bootenv(zpool_handle_t *, const char *);
|
extern int zpool_set_bootenv(zpool_handle_t *, const nvlist_t *);
|
||||||
extern int zpool_get_bootenv(zpool_handle_t *, char *, size_t, off_t);
|
extern int zpool_get_bootenv(zpool_handle_t *, nvlist_t **);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Management interfaces for SMB ACL files
|
* Management interfaces for SMB ACL files
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ int lzc_wait(const char *, zpool_wait_activity_t, boolean_t *);
|
|||||||
int lzc_wait_tag(const char *, zpool_wait_activity_t, uint64_t, boolean_t *);
|
int lzc_wait_tag(const char *, zpool_wait_activity_t, uint64_t, boolean_t *);
|
||||||
int lzc_wait_fs(const char *, zfs_wait_activity_t, boolean_t *);
|
int lzc_wait_fs(const char *, zfs_wait_activity_t, boolean_t *);
|
||||||
|
|
||||||
int lzc_set_bootenv(const char *, const char *);
|
int lzc_set_bootenv(const char *, const nvlist_t *);
|
||||||
int lzc_get_bootenv(const char *, nvlist_t **);
|
int lzc_get_bootenv(const char *, nvlist_t **);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,6 +166,10 @@ int zprop_expand_list(libzfs_handle_t *hdl, zprop_list_t **plp,
|
|||||||
* changelist_gather() flag to force it to iterate on mounted datasets only
|
* changelist_gather() flag to force it to iterate on mounted datasets only
|
||||||
*/
|
*/
|
||||||
#define CL_GATHER_ITER_MOUNTED 2
|
#define CL_GATHER_ITER_MOUNTED 2
|
||||||
|
/*
|
||||||
|
* Use this changelist_gather() flag to prevent unmounting of file systems.
|
||||||
|
*/
|
||||||
|
#define CL_GATHER_DONT_UNMOUNT 4
|
||||||
|
|
||||||
typedef struct prop_changelist prop_changelist_t;
|
typedef struct prop_changelist prop_changelist_t;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
* This file and its contents are supplied under the terms of the
|
||||||
|
* Common Development and Distribution License ("CDDL"), version 1.0.
|
||||||
|
* You may only use this file in accordance with the terms of version
|
||||||
|
* 1.0 of the CDDL.
|
||||||
|
*
|
||||||
|
* A full copy of the text of the CDDL should have accompanied this
|
||||||
|
* source. A copy of the CDDL is also available via the Internet at
|
||||||
|
* http://www.illumos.org/license/CDDL.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright 2020 Toomas Soome <tsoome@me.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _LIBZFSBOOTENV_H
|
||||||
|
#define _LIBZFSBOOTENV_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef enum lzbe_flags {
|
||||||
|
lzbe_add, /* add data to existing nvlist */
|
||||||
|
lzbe_replace /* replace current nvlist */
|
||||||
|
} lzbe_flags_t;
|
||||||
|
|
||||||
|
extern int lzbe_nvlist_get(const char *, const char *, void **);
|
||||||
|
extern int lzbe_nvlist_set(const char *, const char *, void *);
|
||||||
|
extern void lzbe_nvlist_free(void *);
|
||||||
|
extern int lzbe_add_pair(void *, const char *, const char *, void *, size_t);
|
||||||
|
extern int lzbe_remove_pair(void *, const char *);
|
||||||
|
extern int lzbe_set_boot_device(const char *, lzbe_flags_t, const char *);
|
||||||
|
extern int lzbe_get_boot_device(const char *, char **);
|
||||||
|
extern int lzbe_bootenv_print(const char *, const char *, FILE *);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* _LIBZFSBOOTENV_H */
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
#define noinline __noinline
|
#define noinline __noinline
|
||||||
#define ____cacheline_aligned __aligned(CACHE_LINE_SIZE)
|
#define ____cacheline_aligned __aligned(CACHE_LINE_SIZE)
|
||||||
|
|
||||||
#ifndef _KERNEL
|
#if !defined(_KERNEL) && !defined(_STANDALONE)
|
||||||
#define likely(x) __builtin_expect(!!(x), 1)
|
#define likely(x) __builtin_expect(!!(x), 1)
|
||||||
#define unlikely(x) __builtin_expect(!!(x), 0)
|
#define unlikely(x) __builtin_expect(!!(x), 0)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
#include <rpc/types.h>
|
#include <rpc/types.h>
|
||||||
#include_next <rpc/xdr.h>
|
#include_next <rpc/xdr.h>
|
||||||
|
|
||||||
#ifndef _KERNEL
|
#if !defined(_KERNEL) && !defined(_STANDALONE)
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
@@ -66,6 +66,6 @@ xdrmem_control(XDR *xdrs, int request, void *info)
|
|||||||
xdrmem_control((xdrs), (req), (op)) : \
|
xdrmem_control((xdrs), (req), (op)) : \
|
||||||
(*(xdrs)->x_ops->x_control)(xdrs, req, op))
|
(*(xdrs)->x_ops->x_control)(xdrs, req, op))
|
||||||
|
|
||||||
#endif /* !_KERNEL */
|
#endif /* !_KERNEL && !_STANDALONE */
|
||||||
|
|
||||||
#endif /* !_OPENSOLARIS_RPC_XDR_H_ */
|
#endif /* !_OPENSOLARIS_RPC_XDR_H_ */
|
||||||
|
|||||||
@@ -26,8 +26,6 @@
|
|||||||
#ifndef _SYS_ACL_IMPL_H
|
#ifndef _SYS_ACL_IMPL_H
|
||||||
#define _SYS_ACL_IMPL_H
|
#define _SYS_ACL_IMPL_H
|
||||||
|
|
||||||
#pragma ident "%Z%%M% %I% %E% SMI"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
#ifndef _OPENSOLARIS_SYS_ATOMIC_H_
|
#ifndef _OPENSOLARIS_SYS_ATOMIC_H_
|
||||||
#define _OPENSOLARIS_SYS_ATOMIC_H_
|
#define _OPENSOLARIS_SYS_ATOMIC_H_
|
||||||
|
|
||||||
|
#ifndef _STANDALONE
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <machine/atomic.h>
|
#include <machine/atomic.h>
|
||||||
|
|
||||||
@@ -179,4 +181,13 @@ atomic_cas_ptr(volatile void *target, void *cmp, void *newval)
|
|||||||
}
|
}
|
||||||
#endif /* !defined(COMPAT_32BIT) && defined(__LP64__) */
|
#endif /* !defined(COMPAT_32BIT) && defined(__LP64__) */
|
||||||
|
|
||||||
|
#else /* _STANDALONE */
|
||||||
|
/*
|
||||||
|
* sometimes atomic_add_64 is defined, sometimes not, but the
|
||||||
|
* following is always right for the boot loader.
|
||||||
|
*/
|
||||||
|
#undef atomic_add_64
|
||||||
|
#define atomic_add_64(ptr, val) *(ptr) += val
|
||||||
|
#endif /* !_STANDALONE */
|
||||||
|
|
||||||
#endif /* !_OPENSOLARIS_SYS_ATOMIC_H_ */
|
#endif /* !_OPENSOLARIS_SYS_ATOMIC_H_ */
|
||||||
|
|||||||
@@ -80,10 +80,11 @@
|
|||||||
#define BE_64(x) BSWAP_64(x)
|
#define BE_64(x) BSWAP_64(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(_STANDALONE)
|
||||||
#if BYTE_ORDER == _BIG_ENDIAN
|
#if BYTE_ORDER == _BIG_ENDIAN
|
||||||
#define htonll(x) BMASK_64(x)
|
#define htonll(x) BMASK_64(x)
|
||||||
#define ntohll(x) BMASK_64(x)
|
#define ntohll(x) BMASK_64(x)
|
||||||
#else
|
#else /* BYTE_ORDER == _LITTLE_ENDIAN */
|
||||||
#ifndef __LP64__
|
#ifndef __LP64__
|
||||||
static __inline__ uint64_t
|
static __inline__ uint64_t
|
||||||
htonll(uint64_t n)
|
htonll(uint64_t n)
|
||||||
@@ -96,11 +97,12 @@ ntohll(uint64_t n)
|
|||||||
{
|
{
|
||||||
return ((((uint64_t)ntohl(n)) << 32) + ntohl(n >> 32));
|
return ((((uint64_t)ntohl(n)) << 32) + ntohl(n >> 32));
|
||||||
}
|
}
|
||||||
#else
|
#else /* !__LP64__ */
|
||||||
#define htonll(x) BSWAP_64(x)
|
#define htonll(x) BSWAP_64(x)
|
||||||
#define ntohll(x) BSWAP_64(x)
|
#define ntohll(x) BSWAP_64(x)
|
||||||
#endif
|
#endif /* __LP64__ */
|
||||||
#endif
|
#endif /* BYTE_ORDER */
|
||||||
|
#endif /* _STANDALONE */
|
||||||
|
|
||||||
#define BE_IN32(xa) htonl(*((uint32_t *)(void *)(xa)))
|
#define BE_IN32(xa) htonl(*((uint32_t *)(void *)(xa)))
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ extern "C" {
|
|||||||
|
|
||||||
#if defined(__ATTRIBUTE_IMPLEMENTED) || defined(__GNUC__)
|
#if defined(__ATTRIBUTE_IMPLEMENTED) || defined(__GNUC__)
|
||||||
|
|
||||||
|
#if 0
|
||||||
/*
|
/*
|
||||||
* analogous to lint's PRINTFLIKEn
|
* analogous to lint's PRINTFLIKEn
|
||||||
*/
|
*/
|
||||||
@@ -56,20 +57,28 @@ extern "C" {
|
|||||||
#define __sun_attr___VPRINTFLIKE__(__n) \
|
#define __sun_attr___VPRINTFLIKE__(__n) \
|
||||||
__attribute__((__format__(printf, __n, 0)))
|
__attribute__((__format__(printf, __n, 0)))
|
||||||
|
|
||||||
/*
|
|
||||||
* Handle the kernel printf routines that can take '%b' too
|
|
||||||
*/
|
|
||||||
#if __GNUC_VERSION < 30402
|
|
||||||
/*
|
|
||||||
* XX64 at least this doesn't work correctly yet with 3.4.1 anyway!
|
|
||||||
*/
|
|
||||||
#define __sun_attr___KPRINTFLIKE__ __sun_attr___PRINTFLIKE__
|
#define __sun_attr___KPRINTFLIKE__ __sun_attr___PRINTFLIKE__
|
||||||
#define __sun_attr___KVPRINTFLIKE__ __sun_attr___VPRINTFLIKE__
|
#define __sun_attr___KVPRINTFLIKE__ __sun_attr___VPRINTFLIKE__
|
||||||
#else
|
#else
|
||||||
#define __sun_attr___KPRINTFLIKE__(__n) \
|
/*
|
||||||
__attribute__((__format__(cmn_err, __n, (__n)+1)))
|
* Currently the openzfs codebase has a lot of formatting errors
|
||||||
#define __sun_attr___KVPRINTFLIKE__(__n) \
|
* which are not picked up in the linux build because they're not
|
||||||
__attribute__((__format__(cmn_err, __n, 0)))
|
* doing formatting checks. LLVM's kprintf implementation doesn't
|
||||||
|
* actually do format checks!
|
||||||
|
*
|
||||||
|
* For FreeBSD these break under gcc! LLVM shim'ed cmn_err as a
|
||||||
|
* format attribute but also didn't check anything. If one
|
||||||
|
* replaces it with the above, all of the format issues
|
||||||
|
* in the codebase show up.
|
||||||
|
*
|
||||||
|
* Once those format string issues are addressed, the above
|
||||||
|
* should be flipped on once again.
|
||||||
|
*/
|
||||||
|
#define __sun_attr___PRINTFLIKE__(__n)
|
||||||
|
#define __sun_attr___VPRINTFLIKE__(__n)
|
||||||
|
#define __sun_attr___KPRINTFLIKE__(__n)
|
||||||
|
#define __sun_attr___KVPRINTFLIKE__(__n)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -77,7 +86,6 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
#define __sun_attr___noreturn__ __attribute__((__noreturn__))
|
#define __sun_attr___noreturn__ __attribute__((__noreturn__))
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is an appropriate label for functions that do not
|
* This is an appropriate label for functions that do not
|
||||||
* modify their arguments, e.g. strlen()
|
* modify their arguments, e.g. strlen()
|
||||||
@@ -113,9 +121,9 @@ extern "C" {
|
|||||||
#define __VPRINTFLIKE(__n) __sun_attr__((__VPRINTFLIKE__(__n)))
|
#define __VPRINTFLIKE(__n) __sun_attr__((__VPRINTFLIKE__(__n)))
|
||||||
#define __KPRINTFLIKE(__n) __sun_attr__((__KPRINTFLIKE__(__n)))
|
#define __KPRINTFLIKE(__n) __sun_attr__((__KPRINTFLIKE__(__n)))
|
||||||
#define __KVPRINTFLIKE(__n) __sun_attr__((__KVPRINTFLIKE__(__n)))
|
#define __KVPRINTFLIKE(__n) __sun_attr__((__KVPRINTFLIKE__(__n)))
|
||||||
#ifdef _KERNEL
|
#if defined(_KERNEL) || defined(_STANDALONE)
|
||||||
#define __NORETURN __sun_attr__((__noreturn__))
|
#define __NORETURN __sun_attr__((__noreturn__))
|
||||||
#endif
|
#endif /* _KERNEL || _STANDALONE */
|
||||||
#define __CONST __sun_attr__((__const__))
|
#define __CONST __sun_attr__((__const__))
|
||||||
#define __PURE __sun_attr__((__pure__))
|
#define __PURE __sun_attr__((__pure__))
|
||||||
|
|
||||||
@@ -174,7 +182,7 @@ typedef int enum_t;
|
|||||||
#define __exit
|
#define __exit
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _KERNEL
|
#if defined(_KERNEL) || defined(_STANDALONE)
|
||||||
#define param_set_charp(a, b) (0)
|
#define param_set_charp(a, b) (0)
|
||||||
#define ATTR_UID AT_UID
|
#define ATTR_UID AT_UID
|
||||||
#define ATTR_GID AT_GID
|
#define ATTR_GID AT_GID
|
||||||
@@ -183,9 +191,15 @@ typedef int enum_t;
|
|||||||
#define ATTR_CTIME AT_CTIME
|
#define ATTR_CTIME AT_CTIME
|
||||||
#define ATTR_MTIME AT_MTIME
|
#define ATTR_MTIME AT_MTIME
|
||||||
#define ATTR_ATIME AT_ATIME
|
#define ATTR_ATIME AT_ATIME
|
||||||
|
#if defined(_STANDALONE)
|
||||||
|
#define vmem_free kmem_free
|
||||||
|
#define vmem_zalloc kmem_zalloc
|
||||||
|
#define vmem_alloc kmem_zalloc
|
||||||
|
#else
|
||||||
#define vmem_free zfs_kmem_free
|
#define vmem_free zfs_kmem_free
|
||||||
#define vmem_zalloc(size, flags) zfs_kmem_alloc(size, flags | M_ZERO)
|
#define vmem_zalloc(size, flags) zfs_kmem_alloc(size, flags | M_ZERO)
|
||||||
#define vmem_alloc zfs_kmem_alloc
|
#define vmem_alloc zfs_kmem_alloc
|
||||||
|
#endif
|
||||||
#define MUTEX_NOLOCKDEP 0
|
#define MUTEX_NOLOCKDEP 0
|
||||||
#define RW_NOLOCKDEP 0
|
#define RW_NOLOCKDEP 0
|
||||||
|
|
||||||
@@ -206,8 +220,10 @@ typedef int enum_t;
|
|||||||
#define __XSI_VISIBLE 1000
|
#define __XSI_VISIBLE 1000
|
||||||
#endif
|
#endif
|
||||||
#define ARRAY_SIZE(a) (sizeof (a) / sizeof (a[0]))
|
#define ARRAY_SIZE(a) (sizeof (a) / sizeof (a[0]))
|
||||||
#define open64 open
|
|
||||||
#define mmap64 mmap
|
#define mmap64 mmap
|
||||||
|
/* Note: this file can be used on linux/macOS when bootstrapping tools. */
|
||||||
|
#if defined(__FreeBSD__)
|
||||||
|
#define open64 open
|
||||||
#define pwrite64 pwrite
|
#define pwrite64 pwrite
|
||||||
#define ftruncate64 ftruncate
|
#define ftruncate64 ftruncate
|
||||||
#define lseek64 lseek
|
#define lseek64 lseek
|
||||||
@@ -217,6 +233,7 @@ typedef int enum_t;
|
|||||||
#define statfs64 statfs
|
#define statfs64 statfs
|
||||||
#define readdir64 readdir
|
#define readdir64 readdir
|
||||||
#define dirent64 dirent
|
#define dirent64 dirent
|
||||||
|
#endif
|
||||||
#define P2ALIGN(x, align) ((x) & -(align))
|
#define P2ALIGN(x, align) ((x) & -(align))
|
||||||
#define P2CROSS(x, y, align) (((x) ^ (y)) > (align) - 1)
|
#define P2CROSS(x, y, align) (((x) ^ (y)) > (align) - 1)
|
||||||
#define P2ROUNDUP(x, align) ((((x) - 1) | ((align) - 1)) + 1)
|
#define P2ROUNDUP(x, align) ((((x) - 1) | ((align) - 1)) + 1)
|
||||||
|
|||||||
@@ -31,8 +31,6 @@
|
|||||||
#ifndef _SYS_CMN_ERR_H
|
#ifndef _SYS_CMN_ERR_H
|
||||||
#define _SYS_CMN_ERR_H
|
#define _SYS_CMN_ERR_H
|
||||||
|
|
||||||
#pragma ident "%Z%%M% %I% %E% SMI"
|
|
||||||
|
|
||||||
#if !defined(_ASM)
|
#if !defined(_ASM)
|
||||||
#include <sys/_stdarg.h>
|
#include <sys/_stdarg.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -54,42 +52,33 @@ extern "C" {
|
|||||||
/*PRINTFLIKE2*/
|
/*PRINTFLIKE2*/
|
||||||
extern void cmn_err(int, const char *, ...)
|
extern void cmn_err(int, const char *, ...)
|
||||||
__KPRINTFLIKE(2);
|
__KPRINTFLIKE(2);
|
||||||
#pragma rarely_called(cmn_err)
|
|
||||||
|
|
||||||
extern void vzcmn_err(zoneid_t, int, const char *, __va_list)
|
extern void vzcmn_err(zoneid_t, int, const char *, __va_list)
|
||||||
__KVPRINTFLIKE(3);
|
__KVPRINTFLIKE(3);
|
||||||
#pragma rarely_called(vzcmn_err)
|
|
||||||
|
|
||||||
extern void vcmn_err(int, const char *, __va_list)
|
extern void vcmn_err(int, const char *, __va_list)
|
||||||
__KVPRINTFLIKE(2);
|
__KVPRINTFLIKE(2);
|
||||||
#pragma rarely_called(vcmn_err)
|
|
||||||
|
|
||||||
/*PRINTFLIKE3*/
|
/*PRINTFLIKE3*/
|
||||||
extern void zcmn_err(zoneid_t, int, const char *, ...)
|
extern void zcmn_err(zoneid_t, int, const char *, ...)
|
||||||
__KPRINTFLIKE(3);
|
__KPRINTFLIKE(3);
|
||||||
#pragma rarely_called(zcmn_err)
|
|
||||||
|
|
||||||
extern void vzprintf(zoneid_t, const char *, __va_list)
|
extern void vzprintf(zoneid_t, const char *, __va_list)
|
||||||
__KVPRINTFLIKE(2);
|
__KVPRINTFLIKE(2);
|
||||||
#pragma rarely_called(vzprintf)
|
|
||||||
|
|
||||||
/*PRINTFLIKE2*/
|
/*PRINTFLIKE2*/
|
||||||
extern void zprintf(zoneid_t, const char *, ...)
|
extern void zprintf(zoneid_t, const char *, ...)
|
||||||
__KPRINTFLIKE(2);
|
__KPRINTFLIKE(2);
|
||||||
#pragma rarely_called(zprintf)
|
|
||||||
|
|
||||||
extern void vuprintf(const char *, __va_list)
|
extern void vuprintf(const char *, __va_list)
|
||||||
__KVPRINTFLIKE(1);
|
__KVPRINTFLIKE(1);
|
||||||
#pragma rarely_called(vuprintf)
|
|
||||||
|
|
||||||
/*PRINTFLIKE1*/
|
/*PRINTFLIKE1*/
|
||||||
extern void panic(const char *, ...)
|
extern void panic(const char *, ...)
|
||||||
__KPRINTFLIKE(1) __NORETURN;
|
__KPRINTFLIKE(1) __NORETURN;
|
||||||
#pragma rarely_called(panic)
|
|
||||||
|
|
||||||
extern void vpanic(const char *, __va_list)
|
extern void vpanic(const char *, __va_list)
|
||||||
__KVPRINTFLIKE(1) __NORETURN;
|
__KVPRINTFLIKE(1) __NORETURN;
|
||||||
#pragma rarely_called(vpanic)
|
|
||||||
|
|
||||||
#endif /* !_ASM */
|
#endif /* !_ASM */
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#include <sys/spl_condvar.h>
|
#include <sys/spl_condvar.h>
|
||||||
#include <sys/mutex.h>
|
#include <sys/mutex.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#include <sys/errno.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* cv_timedwait() is similar to cv_wait() except that it additionally expects
|
* cv_timedwait() is similar to cv_wait() except that it additionally expects
|
||||||
@@ -142,8 +143,14 @@ cv_timedwait_sig(kcondvar_t *cvp, kmutex_t *mp, clock_t timo)
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define cv_timedwait_io cv_timedwait
|
#define cv_timedwait_io cv_timedwait
|
||||||
#define cv_timedwait_sig_io cv_timedwait_sig
|
#define cv_timedwait_idle cv_timedwait
|
||||||
|
#define cv_timedwait_sig_io cv_timedwait_sig
|
||||||
|
#define cv_wait_io cv_wait
|
||||||
|
#define cv_wait_io_sig cv_wait_sig
|
||||||
|
#define cv_wait_idle cv_wait
|
||||||
|
#define cv_timedwait_io_hires cv_timedwait_hires
|
||||||
|
#define cv_timedwait_idle_hires cv_timedwait_hires
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim, hrtime_t res,
|
cv_timedwait_hires(kcondvar_t *cvp, kmutex_t *mp, hrtime_t tim, hrtime_t res,
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ extern cred_t *zone_kcred(void);
|
|||||||
extern gid_t crgetrgid(const cred_t *);
|
extern gid_t crgetrgid(const cred_t *);
|
||||||
extern gid_t crgetsgid(const cred_t *);
|
extern gid_t crgetsgid(const cred_t *);
|
||||||
|
|
||||||
#define crgetzoneid(x) (0)
|
#define crgetzoneid(cr) ((cr)->cr_prison->pr_id)
|
||||||
extern projid_t crgetprojid(const cred_t *);
|
extern projid_t crgetprojid(const cred_t *);
|
||||||
|
|
||||||
extern cred_t *crgetmapped(const cred_t *);
|
extern cred_t *crgetmapped(const cred_t *);
|
||||||
|
|||||||
@@ -26,8 +26,6 @@
|
|||||||
#ifndef _SYS_EXTDIRENT_H
|
#ifndef _SYS_EXTDIRENT_H
|
||||||
#define _SYS_EXTDIRENT_H
|
#define _SYS_EXTDIRENT_H
|
||||||
|
|
||||||
#pragma ident "%Z%%M% %I% %E% SMI"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
#ifndef _OPENSOLARIS_SYS_KMEM_H_
|
#ifndef _OPENSOLARIS_SYS_KMEM_H_
|
||||||
#define _OPENSOLARIS_SYS_KMEM_H_
|
#define _OPENSOLARIS_SYS_KMEM_H_
|
||||||
|
|
||||||
|
#ifdef _KERNEL
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/malloc.h>
|
#include <sys/malloc.h>
|
||||||
#include <sys/vmem.h>
|
#include <sys/vmem.h>
|
||||||
@@ -93,5 +94,14 @@ void *calloc(size_t n, size_t s);
|
|||||||
zfs_kmem_alloc((size), (kmflags) | M_ZERO)
|
zfs_kmem_alloc((size), (kmflags) | M_ZERO)
|
||||||
#define kmem_free(buf, size) zfs_kmem_free((buf), (size))
|
#define kmem_free(buf, size) zfs_kmem_free((buf), (size))
|
||||||
|
|
||||||
|
#endif /* _KERNEL */
|
||||||
|
|
||||||
|
#ifdef _STANDALONE
|
||||||
|
/*
|
||||||
|
* At the moment, we just need it for the type. We redirect the alloc/free
|
||||||
|
* routines to the usual Free and Malloc in that environment.
|
||||||
|
*/
|
||||||
|
typedef int kmem_cache_t;
|
||||||
|
#endif /* _STANDALONE */
|
||||||
|
|
||||||
#endif /* _OPENSOLARIS_SYS_KMEM_H_ */
|
#endif /* _OPENSOLARIS_SYS_KMEM_H_ */
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#ifndef _SPL_KMEM_CACHE_H
|
#ifndef _SPL_KMEM_CACHE_H
|
||||||
#define _SPL_KMEM_CACHE_H
|
#define _SPL_KMEM_CACHE_H
|
||||||
|
|
||||||
|
#ifdef _KERNEL
|
||||||
#include <sys/taskq.h>
|
#include <sys/taskq.h>
|
||||||
|
|
||||||
/* kmem move callback return values */
|
/* kmem move callback return values */
|
||||||
@@ -46,4 +47,6 @@ extern void spl_kmem_cache_set_move(kmem_cache_t *,
|
|||||||
|
|
||||||
#define kmem_cache_set_move(skc, move) spl_kmem_cache_set_move(skc, move)
|
#define kmem_cache_set_move(skc, move) spl_kmem_cache_set_move(skc, move)
|
||||||
|
|
||||||
|
#endif /* _KERNEL */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
* UCRL-CODE-235197
|
* UCRL-CODE-235197
|
||||||
*
|
*
|
||||||
* This file is part of the SPL, Solaris Porting Layer.
|
* This file is part of the SPL, Solaris Porting Layer.
|
||||||
* For details, see <http://zfsonlinux.org/>.
|
|
||||||
*
|
*
|
||||||
* The SPL is free software; you can redistribute it and/or modify it
|
* The SPL is free software; you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU General Public License as published by the
|
* under the terms of the GNU General Public License as published by the
|
||||||
@@ -24,8 +23,11 @@
|
|||||||
|
|
||||||
#ifndef _SPL_KSTAT_H
|
#ifndef _SPL_KSTAT_H
|
||||||
#define _SPL_KSTAT_H
|
#define _SPL_KSTAT_H
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#ifndef _STANDALONE
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
|
#endif
|
||||||
struct list_head {};
|
struct list_head {};
|
||||||
#include <sys/mutex.h>
|
#include <sys/mutex.h>
|
||||||
#include <sys/proc.h>
|
#include <sys/proc.h>
|
||||||
@@ -83,6 +85,14 @@ typedef struct kstat_s kstat_t;
|
|||||||
typedef int kid_t; /* unique kstat id */
|
typedef int kid_t; /* unique kstat id */
|
||||||
typedef int kstat_update_t(struct kstat_s *, int); /* dynamic update cb */
|
typedef int kstat_update_t(struct kstat_s *, int); /* dynamic update cb */
|
||||||
|
|
||||||
|
struct seq_file {
|
||||||
|
char *sf_buf;
|
||||||
|
size_t sf_size;
|
||||||
|
};
|
||||||
|
|
||||||
|
void seq_printf(struct seq_file *m, const char *fmt, ...);
|
||||||
|
|
||||||
|
|
||||||
typedef struct kstat_module {
|
typedef struct kstat_module {
|
||||||
char ksm_name[KSTAT_STRLEN+1]; /* module name */
|
char ksm_name[KSTAT_STRLEN+1]; /* module name */
|
||||||
struct list_head ksm_module_list; /* module linkage */
|
struct list_head ksm_module_list; /* module linkage */
|
||||||
@@ -92,6 +102,7 @@ typedef struct kstat_module {
|
|||||||
|
|
||||||
typedef struct kstat_raw_ops {
|
typedef struct kstat_raw_ops {
|
||||||
int (*headers)(char *buf, size_t size);
|
int (*headers)(char *buf, size_t size);
|
||||||
|
int (*seq_headers)(struct seq_file *);
|
||||||
int (*data)(char *buf, size_t size, void *data);
|
int (*data)(char *buf, size_t size, void *data);
|
||||||
void *(*addr)(kstat_t *ksp, loff_t index);
|
void *(*addr)(kstat_t *ksp, loff_t index);
|
||||||
} kstat_raw_ops_t;
|
} kstat_raw_ops_t;
|
||||||
@@ -112,6 +123,7 @@ struct kstat_s {
|
|||||||
size_t ks_data_size; /* size of kstat data section */
|
size_t ks_data_size; /* size of kstat data section */
|
||||||
kstat_update_t *ks_update; /* dynamic updates */
|
kstat_update_t *ks_update; /* dynamic updates */
|
||||||
void *ks_private; /* private data */
|
void *ks_private; /* private data */
|
||||||
|
void *ks_private1; /* private data */
|
||||||
kmutex_t ks_private_lock; /* kstat private data lock */
|
kmutex_t ks_private_lock; /* kstat private data lock */
|
||||||
kmutex_t *ks_lock; /* kstat data lock */
|
kmutex_t *ks_lock; /* kstat data lock */
|
||||||
struct list_head ks_list; /* kstat linkage */
|
struct list_head ks_list; /* kstat linkage */
|
||||||
@@ -119,9 +131,10 @@ struct kstat_s {
|
|||||||
kstat_raw_ops_t ks_raw_ops; /* ops table for raw type */
|
kstat_raw_ops_t ks_raw_ops; /* ops table for raw type */
|
||||||
char *ks_raw_buf; /* buf used for raw ops */
|
char *ks_raw_buf; /* buf used for raw ops */
|
||||||
size_t ks_raw_bufsize; /* size of raw ops buffer */
|
size_t ks_raw_bufsize; /* size of raw ops buffer */
|
||||||
|
#ifndef _STANDALONE
|
||||||
struct sysctl_ctx_list ks_sysctl_ctx;
|
struct sysctl_ctx_list ks_sysctl_ctx;
|
||||||
struct sysctl_oid *ks_sysctl_root;
|
struct sysctl_oid *ks_sysctl_root;
|
||||||
|
#endif /* _STANDALONE */
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct kstat_named_s {
|
typedef struct kstat_named_s {
|
||||||
@@ -185,6 +198,12 @@ extern void __kstat_set_raw_ops(kstat_t *ksp,
|
|||||||
int (*data)(char *buf, size_t size, void *data),
|
int (*data)(char *buf, size_t size, void *data),
|
||||||
void* (*addr)(kstat_t *ksp, loff_t index));
|
void* (*addr)(kstat_t *ksp, loff_t index));
|
||||||
|
|
||||||
|
extern void __kstat_set_seq_raw_ops(kstat_t *ksp,
|
||||||
|
int (*headers)(struct seq_file *),
|
||||||
|
int (*data)(char *buf, size_t size, void *data),
|
||||||
|
void* (*addr)(kstat_t *ksp, loff_t index));
|
||||||
|
|
||||||
|
|
||||||
extern kstat_t *__kstat_create(const char *ks_module, int ks_instance,
|
extern kstat_t *__kstat_create(const char *ks_module, int ks_instance,
|
||||||
const char *ks_name, const char *ks_class, uchar_t ks_type,
|
const char *ks_name, const char *ks_class, uchar_t ks_type,
|
||||||
uint_t ks_ndata, uchar_t ks_flags);
|
uint_t ks_ndata, uchar_t ks_flags);
|
||||||
@@ -196,12 +215,20 @@ extern void kstat_waitq_exit(kstat_io_t *);
|
|||||||
extern void kstat_runq_enter(kstat_io_t *);
|
extern void kstat_runq_enter(kstat_io_t *);
|
||||||
extern void kstat_runq_exit(kstat_io_t *);
|
extern void kstat_runq_exit(kstat_io_t *);
|
||||||
|
|
||||||
|
#define kstat_set_seq_raw_ops(k, h, d, a) \
|
||||||
|
__kstat_set_seq_raw_ops(k, h, d, a)
|
||||||
#define kstat_set_raw_ops(k, h, d, a) \
|
#define kstat_set_raw_ops(k, h, d, a) \
|
||||||
__kstat_set_raw_ops(k, h, d, a)
|
__kstat_set_raw_ops(k, h, d, a)
|
||||||
|
#ifndef _STANDALONE
|
||||||
#define kstat_create(m, i, n, c, t, s, f) \
|
#define kstat_create(m, i, n, c, t, s, f) \
|
||||||
__kstat_create(m, i, n, c, t, s, f)
|
__kstat_create(m, i, n, c, t, s, f)
|
||||||
|
|
||||||
#define kstat_install(k) __kstat_install(k)
|
#define kstat_install(k) __kstat_install(k)
|
||||||
#define kstat_delete(k) __kstat_delete(k)
|
#define kstat_delete(k) __kstat_delete(k)
|
||||||
|
#else
|
||||||
|
#define kstat_create(m, i, n, c, t, s, f) ((kstat_t *)0)
|
||||||
|
#define kstat_install(k)
|
||||||
|
#define kstat_delete(k)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* _SPL_KSTAT_H */
|
#endif /* _SPL_KSTAT_H */
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user