diff options
author | Chris Kirby <chris.kirby@sun.com> | 2009-08-01 15:09:50 -0600 |
---|---|---|
committer | Chris Kirby <chris.kirby@sun.com> | 2009-08-01 15:09:50 -0600 |
commit | 842727c2f41f01b380de4f5e787d905702870f23 (patch) | |
tree | c0143417f1cb9c4385e0191a0d90682a98e6d81e /usr/src/lib/pyzfs/common/ioctl.c | |
parent | 592106a23e99a1790d339bab84de7fa3474964a4 (diff) | |
download | illumos-joyent-842727c2f41f01b380de4f5e787d905702870f23.tar.gz |
PSARC/2009/297 zfs snapshot holds
6803121 want user-settable refcounts on snapshots
6851824 zfs_ioc_rename() can be called with a NULL zc_name
Diffstat (limited to 'usr/src/lib/pyzfs/common/ioctl.c')
-rw-r--r-- | usr/src/lib/pyzfs/common/ioctl.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/usr/src/lib/pyzfs/common/ioctl.c b/usr/src/lib/pyzfs/common/ioctl.c index ae3fa74dc2..0c838abcb4 100644 --- a/usr/src/lib/pyzfs/common/ioctl.c +++ b/usr/src/lib/pyzfs/common/ioctl.c @@ -350,6 +350,25 @@ py_set_fsacl(PyObject *self, PyObject *args) } static PyObject * +py_get_holds(PyObject *self, PyObject *args) +{ + zfs_cmd_t zc = { 0 }; + char *name; + PyObject *nvl; + + if (!PyArg_ParseTuple(args, "s", &name)) + return (NULL); + + (void) strlcpy(zc.zc_name, name, sizeof (zc.zc_name)); + + nvl = ioctl_with_dstnv(ZFS_IOC_GET_HOLDS, &zc); + if (nvl == NULL) + seterr(_("cannot get holds for %s"), name); + + return (nvl); +} + +static PyObject * py_userspace_many(PyObject *self, PyObject *args) { zfs_cmd_t zc = { 0 }; @@ -582,6 +601,7 @@ static PyMethodDef zfsmethods[] = { "Map SID to name@domain."}, {"isglobalzone", py_isglobalzone, METH_NOARGS, "Determine if this is the global zone."}, + {"get_holds", py_get_holds, METH_VARARGS, "Get user holds."}, {NULL, NULL, 0, NULL} }; |