From owner-svn-src-head@FreeBSD.ORG Fri Jun 27 22:28:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3AF79CE; Fri, 27 Jun 2014 22:28:14 +0000 (UTC) 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 970D42411; Fri, 27 Jun 2014 22:28:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5RMSEpq046601; Fri, 27 Jun 2014 22:28:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5RMSE1o046600; Fri, 27 Jun 2014 22:28:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406272228.s5RMSE1o046600@svn.freebsd.org> From: Alexander Motin Date: Fri, 27 Jun 2014 22:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267986 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jun 2014 22:28:14 -0000 Author: mav Date: Fri Jun 27 22:28:14 2014 New Revision: 267986 URL: http://svnweb.freebsd.org/changeset/base/267986 Log: Remove odd practice of inverting error codes. -EPERM is equal to ERESTART, returning which from ioctl() handler causes infinite syscall restart. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Fri Jun 27 22:05:21 2014 (r267985) +++ head/sys/cam/ctl/ctl.c Fri Jun 27 22:28:14 2014 (r267986) @@ -2147,14 +2147,14 @@ ctl_ioctl(struct cdev *dev, u_long cmd, * to this FETD. */ if ((softc->ioctl_info.flags & CTL_IOCTL_FLAG_ENABLED) == 0) { - retval = -EPERM; + retval = EPERM; break; } io = ctl_alloc_io(softc->ioctl_info.fe.ctl_pool_ref); if (io == NULL) { printf("ctl_ioctl: can't allocate ctl_io!\n"); - retval = -ENOSPC; + retval = ENOSPC; break; } @@ -2689,7 +2689,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, softc->flags |= CTL_FLAG_REAL_SYNC; break; default: - retval = -EINVAL; + retval = EINVAL; break; } mtx_unlock(&softc->ctl_lock); @@ -3168,7 +3168,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, if (found == 0) { printf("ctl: unknown ioctl command %#lx or backend " "%d\n", cmd, type); - retval = -EINVAL; + retval = EINVAL; break; } retval = backend->ioctl(dev, cmd, addr, flag, td); @@ -3333,7 +3333,7 @@ ctl_pool_create(struct ctl_softc *ctl_so pool = (struct ctl_io_pool *)malloc(sizeof(*pool), M_CTL, M_NOWAIT | M_ZERO); if (pool == NULL) { - retval = -ENOMEM; + retval = ENOMEM; goto bailout; } @@ -3416,7 +3416,7 @@ ctl_pool_acquire(struct ctl_io_pool *poo mtx_assert(&pool->ctl_softc->pool_lock, MA_OWNED); if (pool->flags & CTL_POOL_FLAG_INVALID) - return (-EINVAL); + return (EINVAL); pool->refcount++; @@ -9389,7 +9389,7 @@ ctl_tur(struct ctl_scsiio *ctsio) CTL_DEBUG_PRINT(("ctl_tur\n")); if (lun == NULL) - return (-EINVAL); + return (EINVAL); ctsio->scsi_status = SCSI_STATUS_OK; ctsio->io_hdr.status = CTL_SUCCESS; @@ -13183,7 +13183,7 @@ ctl_queue(union ctl_io *io) break; default: printf("ctl_queue: unknown I/O type %d\n", io->io_hdr.io_type); - return (-EINVAL); + return (EINVAL); } return (CTL_RETVAL_COMPLETE);