diff options
author | delphij <delphij@FreeBSD.org> | 2014-07-01 06:43:15 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2014-07-01 06:43:15 +0000 |
commit | f95fd16f8d88667bcf37bb162d3f8fcc9f888cc7 (patch) | |
tree | 9f7200d4f5181a0103b0d7eb1ea7c229e3750211 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c | |
parent | cd12aa0ab76d9d3638dc079c863eb0c93393a4d4 (diff) | |
parent | 3790348a90c72ae3b320ff6ce50ad718fd6ef61d (diff) | |
download | FreeBSD-src-f95fd16f8d88667bcf37bb162d3f8fcc9f888cc7.zip FreeBSD-src-f95fd16f8d88667bcf37bb162d3f8fcc9f888cc7.tar.gz |
MFV r267565:
4757 ZFS embedded-data block pointers ("zero block compression")
4913 zfs release should not be subject to space checks
MFC after: 2 weeks
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c index 6b5b86d..3d5cd4c 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c @@ -4353,6 +4353,7 @@ out: * zc_fromobj objsetid of incremental fromsnap (may be zero) * zc_guid if set, estimate size of stream only. zc_cookie is ignored. * output size in zc_objset_type. + * zc_flags if =1, WRITE_EMBEDDED records are permitted * * outputs: * zc_objset_type estimated size, if zc_guid is set @@ -4363,6 +4364,7 @@ zfs_ioc_send(zfs_cmd_t *zc) int error; offset_t off; boolean_t estimate = (zc->zc_guid != 0); + boolean_t embedok = (zc->zc_flags & 0x1); if (zc->zc_obj != 0) { dsl_pool_t *dp; @@ -4428,9 +4430,9 @@ zfs_ioc_send(zfs_cmd_t *zc) off = fp->f_offset; error = dmu_send_obj(zc->zc_name, zc->zc_sendobj, #ifdef illumos - zc->zc_fromobj, zc->zc_cookie, fp->f_vnode, &off); + zc->zc_fromobj, embedok, zc->zc_cookie, fp->f_vnode, &off); #else - zc->zc_fromobj, zc->zc_cookie, fp, &off); + zc->zc_fromobj, embedok, zc->zc_cookie, fp, &off); #endif if (off >= 0 && off <= MAXOFFSET_T) @@ -5368,6 +5370,8 @@ zfs_ioc_unjail(zfs_cmd_t *zc) * innvl: { * "fd" -> file descriptor to write stream to (int32) * (optional) "fromsnap" -> full snap name to send an incremental from + * (optional) "embedok" -> (value ignored) + * presence indicates DRR_WRITE_EMBEDDED records are permitted * } * * outnvl is unused @@ -5381,6 +5385,7 @@ zfs_ioc_send_new(const char *snapname, nvlist_t *innvl, nvlist_t *outnvl) offset_t off; char *fromname = NULL; int fd; + boolean_t embedok; error = nvlist_lookup_int32(innvl, "fd", &fd); if (error != 0) @@ -5388,15 +5393,17 @@ zfs_ioc_send_new(const char *snapname, nvlist_t *innvl, nvlist_t *outnvl) (void) nvlist_lookup_string(innvl, "fromsnap", &fromname); + embedok = nvlist_exists(innvl, "embedok"); + file_t *fp = getf(fd, cap_rights_init(&rights, CAP_READ)); if (fp == NULL) return (SET_ERROR(EBADF)); off = fp->f_offset; #ifdef illumos - error = dmu_send(snapname, fromname, fd, fp->f_vnode, &off); + error = dmu_send(snapname, fromname, embedok, fd, fp->f_vnode, &off); #else - error = dmu_send(snapname, fromname, fd, fp, &off); + error = dmu_send(snapname, fromname, embedok, fd, fp, &off); #endif #ifdef illumos @@ -6008,6 +6015,18 @@ zfsdev_ioctl(struct cdev *dev, u_long zcmd, caddr_t arg, int flag, error = SET_ERROR(EFAULT); goto out; } + if (zc_iocparm->zfs_ioctl_version != ZFS_IOCVER_CURRENT) { + compat = B_TRUE; + + switch (zc_iocparm->zfs_ioctl_version) { + case ZFS_IOCVER_ZCMD: + cflag = ZFS_CMD_COMPAT_ZCMD; + break; + default: + error = SET_ERROR(EINVAL); + goto out; + } + } } if (compat) { |