yuripv commented on this pull request.


> @@ -0,0 +1,480 @@
+.\"

Can we use new license text here?

> +stopped and an error will be returned. The default limit is 10 million
+instructions, and it can be set to a maximum of 100 million instructions.
+.It Fl m Ar memory-limit
+Memory limit, in bytes. If a channel program attempts to allocate more memory
+than the given limit, it will be stopped and an error returned. The default
+memory limit is 10 MB, and can be set to a maximum of 100 MB.
+.El
+.Pp
+All remaining argument strings will be passed directly to the Lua script as
+described in the
+.Sx LUA INTERFACE
+section below.
+.Sh LUA INTERFACE
+A channel program can be invoked either from the command line, or via a library
+call to
+.Em lzc_channel_program() .

.Fn lzc_channel_program

> +argv = args["argv"]
+-- argv == {1="arg1", 2="arg2", ...}
+.Ed
+.Pp
+If invoked from the libZFS interface, an arbitrary argument list can be
+passed to the channel program, which is accessible via the same
+"..." syntax in Lua:
+.Bd -literal -offset indent
+args = ...
+-- args == {"foo"="bar", "baz"={...}, ...}
+.Ed
+.Pp
+Note that because Lua arrays are 1-indexed, arrays passed to Lua from the
+libZFS interface will have their indices incremented by 1. That is, the element
+in
+.Em arr[0]

.Va

> +.Ed
+.Pp
+If invoked from the libZFS interface, an arbitrary argument list can be
+passed to the channel program, which is accessible via the same
+"..." syntax in Lua:
+.Bd -literal -offset indent
+args = ...
+-- args == {"foo"="bar", "baz"={...}, ...}
+.Ed
+.Pp
+Note that because Lua arrays are 1-indexed, arrays passed to Lua from the
+libZFS interface will have their indices incremented by 1. That is, the element
+in
+.Em arr[0]
+in a C array passed to a channel program will be stored in
+.Em arr[1]

.Va

> @@ -3393,6 +3399,42 @@ arrows.
 .It Fl t
 Display the path's inode change time as the first column of output.
 .El
+.It Xo
+.Nm
+.Cm program
+.Op Fl t Ar timeout
+.Op Fl m Ar memory_limit
+.Ar pool script
+.Op Ar arg1 No ...
+.Xc
+Executes
+.Ar script
+as a ZFS channel program on
+.Ar pool Ns .

No need for ```Ns``` here, just whitespace before ".".

> +.Op Ar arg1 No ...
+.Xc
+Executes
+.Ar script
+as a ZFS channel program on
+.Ar pool Ns .
+The ZFS channel
+program interface allows ZFS administrative operations to be run
+programmatically via a Lua script. The entire script is executed atomically,
+with no other administrative operations taking effect concurrently. A library
+of ZFS calls is made available to channel program scripts. Channel programs may
+only be run with root privileges.
+.sp
+For full documentation of the ZFS channel program interface, see the manual
+page for
+.Xr zfs-program(1m).

.Xr zfs-program 1M .

> +For full documentation of the ZFS channel program interface, see the manual
+page for
+.Xr zfs-program(1m).
+.Bl -tag -width ""
+.It Fl t Ar timeout
+Execution time limit, in milliseconds. If a channel program executes for longer
+than the provided timeout, it will be stopped and an error will be returned.
+The default timeout is 1000 ms, and can be set to a maximum of 10000 ms.
+.It Fl m Ar memory-limit
+Memory limit, in bytes. If a channel program attempts to allocate more memory
+than the given limit, it will be stopped and an error returned. The default
+memory limit is 10 MB, and can be set to a maximum of 100 MB.
+.sp
+All remaining argument strings are passed directly to the channel program as
+arguments. See
+.Xr zfs-program(1m) No for more information.

See
.Xr zfs-program 1M
for more information.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openzfs/openzfs/pull/397#pullrequestreview-43885862
------------------------------------------
openzfs-developer
Archives: 
https://openzfs.topicbox.com/groups/developer/discussions/Tffb276f83a8ecdd2-M875d3c171ffb1c30fa41b9ed
Powered by Topicbox: https://topicbox.com

Reply via email to