Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Apr 2012 07:59:59 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r233918 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201204050759.q357xxpn048653@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@ieee.org>
  Tested by:	Attila Nagy <bra@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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204050759.q357xxpn048653>