Date: Fri, 27 Jun 2014 22:28:14 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267986 - head/sys/cam/ctl Message-ID: <201406272228.s5RMSE1o046600@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201406272228.s5RMSE1o046600>