diff options
author | mav <mav@FreeBSD.org> | 2014-07-12 01:59:07 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2014-07-12 01:59:07 +0000 |
commit | 95c9d23391cc4fe1c6a515bcdf9abffece606809 (patch) | |
tree | 9c4943bde95b44926069eadb60f02fadbb63fc7b | |
parent | 8a7f026306398712509d208cdb921991cfc2469a (diff) | |
download | FreeBSD-src-95c9d23391cc4fe1c6a515bcdf9abffece606809.zip FreeBSD-src-95c9d23391cc4fe1c6a515bcdf9abffece606809.tar.gz |
MFC r267986:
Remove odd practice of inverting error codes.
-EPERM is equal to ERESTART, returning which from ioctl() handler causes
infinite syscall restart.
-rw-r--r-- | sys/cam/ctl/ctl.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index d92352f..bea8a01 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -2191,14 +2191,14 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, * 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; } @@ -2728,7 +2728,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, softc->flags |= CTL_FLAG_REAL_SYNC; break; default: - retval = -EINVAL; + retval = EINVAL; break; } mtx_unlock(&softc->ctl_lock); @@ -3199,7 +3199,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, 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); @@ -3364,7 +3364,7 @@ ctl_pool_create(struct ctl_softc *ctl_softc, ctl_pool_type pool_type, pool = (struct ctl_io_pool *)malloc(sizeof(*pool), M_CTL, M_NOWAIT | M_ZERO); if (pool == NULL) { - retval = -ENOMEM; + retval = ENOMEM; goto bailout; } @@ -3447,7 +3447,7 @@ ctl_pool_acquire(struct ctl_io_pool *pool) mtx_assert(&pool->ctl_softc->pool_lock, MA_OWNED); if (pool->flags & CTL_POOL_FLAG_INVALID) - return (-EINVAL); + return (EINVAL); pool->refcount++; @@ -9396,7 +9396,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; @@ -13417,7 +13417,7 @@ ctl_queue(union ctl_io *io) default: mtx_unlock(&ctl_softc->ctl_lock); printf("ctl_queue: unknown I/O type %d\n", io->io_hdr.io_type); - return (-EINVAL); + return (EINVAL); break; /* NOTREACHED */ } mtx_unlock(&ctl_softc->ctl_lock); |