forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
part3: cmd/* + tests/* Signed-off-by: Jorgen Lundman <[email protected]>
- Loading branch information
Showing
30 changed files
with
1,864 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
include $(srcdir)/%D%/macos/Makefile.am |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/sh | ||
# shellcheck disable=SC2154 | ||
# | ||
# Helper to mount and unmount snapshots when asked to by kernel. | ||
# | ||
# Mostly used in macOS. | ||
# | ||
set -ef | ||
|
||
[ -f "${ZED_ZEDLET_DIR}/zed.rc" ] && . "${ZED_ZEDLET_DIR}/zed.rc" | ||
. "${ZED_ZEDLET_DIR}/zed-functions.sh" | ||
|
||
[ -n "${ZEVENT_SNAPSHOT_NAME}" ] || exit 1 | ||
[ -n "${ZEVENT_SUBCLASS}" ] || exit 2 | ||
|
||
if [ "${ZEVENT_SUBCLASS}" = "snapshot_mount" ]; then | ||
action="mount" | ||
elif [ "${ZEVENT_SUBCLASS}" = "snapshot_unmount" ]; then | ||
action="unmount" | ||
else | ||
zed_log_err "unsupported event class \"${ZEVENT_SUBCLASS}\"" | ||
exit 3 | ||
fi | ||
|
||
zed_exit_if_ignoring_this_event | ||
zed_check_cmd "${ZFS}" || exit 4 | ||
|
||
"${ZFS}" "${action}" "${ZEVENT_SNAPSHOT_NAME}" | ||
|
||
finished |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
snapshot_mount.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh | ||
# shellcheck disable=SC2154 | ||
# | ||
# Log the zevent via syslog. | ||
# | ||
|
||
# Given POOL and DATASET name for ZVOL | ||
# DEVICE_NAME for /dev/disk* | ||
# RAW_DEVICE_NAME for /dev/rdisk* | ||
# Create symlink in | ||
# /var/run/zfs/zvol/dsk/POOL/DATASET -> /dev/disk* | ||
# /var/run/zfs/zvol/rdsk/POOL/DATASET -> /dev/rdisk* | ||
|
||
ZVOL_ROOT="/var/run/zfs/zvol" | ||
|
||
mkdir -p "$(dirname "${ZVOL_ROOT}/rdsk/${ZEVENT_POOL}/${ZEVENT_VOLUME}")" "$(dirname "${ZVOL_ROOT}/dsk/${ZEVENT_POOL}/${ZEVENT_VOLUME}")" | ||
|
||
# Remove them if they already exist. (ln -f is not portable) | ||
rm -f "${ZVOL_ROOT}/rdsk/${ZEVENT_POOL}/${ZEVENT_VOLUME}" "${ZVOL_ROOT}/dsk/${ZEVENT_POOL}/${ZEVENT_VOLUME}" | ||
|
||
ln -s "/dev/${ZEVENT_DEVICE_NAME}" "${ZVOL_ROOT}/dsk/${ZEVENT_POOL}/${ZEVENT_VOLUME}" | ||
ln -s "/dev/${ZEVENT_RAW_NAME}" "${ZVOL_ROOT}/rdsk/${ZEVENT_POOL}/${ZEVENT_VOLUME}" | ||
|
||
logger -t "${ZED_SYSLOG_TAG:=zed}" -p "${ZED_SYSLOG_PRIORITY:=daemon.notice}" \ | ||
eid="${ZEVENT_EID}" class="${ZEVENT_SUBCLASS}" \ | ||
"${ZEVENT_POOL:+pool=$ZEVENT_POOL}/${ZEVENT_VOLUME} symlinked ${ZEVENT_DEVICE_NAME}" | ||
|
||
echo 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
# shellcheck disable=SC2154 | ||
# | ||
# Log the zevent via syslog. | ||
# | ||
|
||
# Given POOL and DATASET name for ZVOL | ||
# DEVICE_NAME for /dev/disk* | ||
# RAW_DEVICE_NAME for /dev/rdisk* | ||
# Create symlink in | ||
# /var/run/zfs/zvol/dsk/POOL/DATASET -> /dev/disk* | ||
# /var/run/zfs/zvol/rdsk/POOL/DATASET -> /dev/rdisk* | ||
|
||
ZVOL_ROOT="/var/run/zfs/zvol" | ||
|
||
rm -f "${ZVOL_ROOT}/rdsk/${ZEVENT_POOL}/${ZEVENT_VOLUME}" "${ZVOL_ROOT}/dsk/${ZEVENT_POOL}/${ZEVENT_VOLUME}" | ||
rmdir "$(dirname "${ZVOL_ROOT}/rdsk/${ZEVENT_POOL}/${ZEVENT_VOLUME}")" "$(dirname "${ZVOL_ROOT}/dsk/${ZEVENT_POOL}/${ZEVENT_VOLUME}")" | ||
|
||
logger -t "${ZED_SYSLOG_TAG:=zed}" -p "${ZED_SYSLOG_PRIORITY:=daemon.notice}" \ | ||
eid="${ZEVENT_EID}" class="${ZEVENT_SUBCLASS}" \ | ||
"${ZEVENT_POOL:+pool=$ZEVENT_POOL}/${ZEVENT_VOLUME} removed symlink" | ||
|
||
echo 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.