Support inheriting properties in channel programs

This adds support in channel programs to inherit properties analogous
to `zfs inherit` by adding `zfs.sync.inherit` and `zfs.check.inherit`
functions to the ZFS LUA API.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jason King <jason.king@joyent.com>
Closes #9738
This commit is contained in:
Jason King
2020-01-22 19:03:17 -06:00
committed by Brian Behlendorf
parent 79add96766
commit e2ef1cbf04
7 changed files with 162 additions and 11 deletions
+23 -1
View File
@@ -9,8 +9,9 @@
.\"
.\"
.\" Copyright (c) 2016, 2019 by Delphix. All Rights Reserved.
.\" Copyright 2020 Joyent, Inc.
.\"
.Dd February 26, 2019
.Dd January 15, 2020
.Dt ZFS-PROGRAM 8
.Os
.Sh NAME
@@ -364,6 +365,27 @@ Valid only for destroying snapshots.
If set to true, and the snapshot has holds or clones, allows the snapshot to be
marked for deferred deletion rather than failing.
.Ed
.It Em zfs.sync.inherit(dataset, property)
Clears the specified property in the given dataset, causing it to be inherited
from an ancestor, or restored to the default if no ancestor property is set.
The
.Ql zfs inherit -S
option has not been implemented.
Returns 0 on success, or a nonzero error code if the property could not be
cleared.
.Pp
dataset (string)
.Bd -ragged -compact -offset "xxxx"
Filesystem or snapshot containing the property to clear.
.Ed
.Pp
property (string)
.Bd -ragged -compact -offset "xxxx"
The property to clear.
Allowed properties are the same as those for the
.Nm zfs Cm inherit
command.
.Ed
.It Em zfs.sync.promote(dataset)
Promote the given clone to a filesystem.
Returns 0 on successful promotion, or a nonzero error code otherwise.