/** * Clears the given property on this dataset, causing it to be inherited from its parent. */ public void inheritProperty(String key) { if (LIBZFS.zfs_prop_inherit(handle, key) != 0) throw new ZFSException(library); // libzfs doesn't show us a new value until we reopen the handle, so do it now dispose(); handle = LIBZFS.zfs_open(library.getHandle(), name, zfs_type_t.DATASET); }
/** * Clears the given property on this dataset, causing it to be inherited from its parent. */ public void inheritProperty(String key) { if (LIBZFS.zfs_prop_inherit(handle, key) != 0) throw new ZFSException(library); // libzfs doesn't show us a new value until we reopen the handle, so do it now dispose(); handle = LIBZFS.zfs_open(library.getHandle(), name, zfs_type_t.DATASET); }
/** * Take a snapshot of this ZFS dataset and recursively for all child * datasets. * * @param snapshotName * the name of the Snapshot to create, i.e. 'monday', * 'before-test'. * @param recursive * should snapshot recursively create snapshot for all descendant * datasets. Snapshots are taken atomically, so that all * recursive snapshots correspond to the same moment in time. * @return the created snapshot of this dataset. */ public ZFSSnapshot createSnapshot(final String snapshotName, final boolean recursive) { String fullName = name + '@' + snapshotName; /* * nv96 prototype: if(LIBZFS.zfs_snapshot(library.getHandle(), * fullName,recursive, null)!=0) pre-nv96 prototype: * if(LIBZFS.zfs_snapshot(library.getHandle(), fullName,recursive)!=0) */ if (LIBZFS.zfs_snapshot(library.getHandle(), fullName, recursive, null) != 0) { throw new ZFSException(library); } final ZFSSnapshot dataSet = (ZFSSnapshot) library.open(fullName, zfs_type_t.SNAPSHOT); return dataSet; }