svn commit: r233918 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Andriy Gapon avg at FreeBSD.org
Thu Apr 5 08:00:00 UTC 2012


Author: avg
Date: Thu Apr  5 07:59:59 2012
New Revision: 233918
URL: http://svn.freebsd.org/changeset/base/233918

Log:
  zfs_ioctl: no need for ddi_copyin/out here because sys_ioctl handles that
  
  On FreeBSD the direct ioctl argument is automatically copied in/out
  as necesary by the kernel ioctl entry point.
  
  PR:		kern/164445
  Submitted by:	Luis Garces-Erice <lge at ieee.org>
  Tested by:	Attila Nagy <bra at fsn.hu>
  MFC after:	5 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Thu Apr  5 04:41:06 2012	(r233917)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Thu Apr  5 07:59:59 2012	(r233918)
@@ -293,9 +293,12 @@ zfs_ioctl(vnode_t *vp, u_long com, intpt
 
 	case _FIO_SEEK_DATA:
 	case _FIO_SEEK_HOLE:
+#ifdef sun
 		if (ddi_copyin((void *)data, &off, sizeof (off), flag))
 			return (EFAULT);
-
+#else
+		off = *(offset_t *)data;
+#endif
 		zp = VTOZ(vp);
 		zfsvfs = zp->z_zfsvfs;
 		ZFS_ENTER(zfsvfs);
@@ -306,8 +309,12 @@ zfs_ioctl(vnode_t *vp, u_long com, intpt
 		ZFS_EXIT(zfsvfs);
 		if (error)
 			return (error);
+#ifdef sun
 		if (ddi_copyout(&off, (void *)data, sizeof (off), flag))
 			return (EFAULT);
+#else
+		*(offset_t *)data = off;
+#endif
 		return (0);
 	}
 	return (ENOTTY);


More information about the svn-src-head mailing list