From owner-svn-src-stable-10@FreeBSD.ORG Fri Jun 5 15:51:24 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35487A7E; Fri, 5 Jun 2015 15:51:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 081121216; Fri, 5 Jun 2015 15:51:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t55FpNGi081548; Fri, 5 Jun 2015 15:51:23 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t55FpNAh081547; Fri, 5 Jun 2015 15:51:23 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201506051551.t55FpNAh081547@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 5 Jun 2015 15:51:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r284026 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2015 15:51:24 -0000 Author: avg Date: Fri Jun 5 15:51:23 2015 New Revision: 284026 URL: https://svnweb.freebsd.org/changeset/base/284026 Log: MFC r282766: zfs ioctls: use fget_write / fget_read instead of getf wrapper for fget Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jun 5 15:32:04 2015 (r284025) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jun 5 15:51:23 2015 (r284026) @@ -4196,7 +4196,11 @@ zfs_ioc_recv(zfs_cmd_t *zc) return (error); fd = zc->zc_cookie; - fp = getf(fd, cap_rights_init(&rights, CAP_PREAD)); +#ifdef illumos + fp = getf(fd); +#else + fget_read(curthread, fd, cap_rights_init(&rights, CAP_PREAD), &fp); +#endif if (fp == NULL) { nvlist_free(props); return (SET_ERROR(EBADF)); @@ -4442,8 +4446,12 @@ zfs_ioc_send(zfs_cmd_t *zc) file_t *fp; cap_rights_t rights; - fp = getf(zc->zc_cookie, - cap_rights_init(&rights, CAP_WRITE)); +#ifdef illumos + fp = getf(zc->zc_cookie); +#else + fget_write(curthread, zc->zc_cookie, + cap_rights_init(&rights, CAP_WRITE), &fp); +#endif if (fp == NULL) return (SET_ERROR(EBADF)); @@ -5039,7 +5047,12 @@ zfs_ioc_diff(zfs_cmd_t *zc) offset_t off; int error; - fp = getf(zc->zc_cookie, cap_rights_init(&rights, CAP_WRITE)); +#ifdef illumos + fp = getf(zc->zc_cookie); +#else + fget_write(curthread, zc->zc_cookie, + cap_rights_init(&rights, CAP_WRITE), &fp); +#endif if (fp == NULL) return (SET_ERROR(EBADF)); @@ -5404,6 +5417,7 @@ static int zfs_ioc_send_new(const char *snapname, nvlist_t *innvl, nvlist_t *outnvl) { cap_rights_t rights; + file_t *fp; int error; offset_t off; char *fromname = NULL; @@ -5420,7 +5434,11 @@ zfs_ioc_send_new(const char *snapname, n largeblockok = nvlist_exists(innvl, "largeblockok"); embedok = nvlist_exists(innvl, "embedok"); - file_t *fp = getf(fd, cap_rights_init(&rights, CAP_READ)); +#ifdef illumos + file_t *fp = getf(fd); +#else + fget_write(curthread, fd, cap_rights_init(&rights, CAP_WRITE), &fp); +#endif if (fp == NULL) return (SET_ERROR(EBADF));