Reduce the duplication of code for error handling in _aio_aqueue().

This commit is contained in:
Alan Cox 2002-04-07 07:17:59 +00:00
parent e3bcba7879
commit ae124fc4bd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=94035

View File

@ -1387,22 +1387,14 @@ _aio_aqueue(struct thread *td, struct aiocb *job, struct aio_liojob *lj, int typ
fhold(fp);
if (aiocbe->uaiocb.aio_offset == -1LL) {
fdrop(fp, td);
uma_zfree(aiocb_zone, aiocbe);
if (type == 0)
suword(&job->_aiocb_private.error, EINVAL);
return EINVAL;
error = EINVAL;
goto aqueue_fail;
}
error = suword(&job->_aiocb_private.kernelinfo, jobrefid);
if (error) {
fdrop(fp, td);
uma_zfree(aiocb_zone, aiocbe);
if (type == 0)
suword(&job->_aiocb_private.error, EINVAL);
return error;
error = EINVAL;
goto aqueue_fail;
}
aiocbe->uaiocb._aiocb_private.kernelinfo = (void *)(intptr_t)jobrefid;
if (jobrefid == LONG_MAX)
jobrefid = 1;
@ -1419,15 +1411,11 @@ _aio_aqueue(struct thread *td, struct aiocb *job, struct aio_liojob *lj, int typ
}
return 0;
}
if ((opcode != LIO_READ) && (opcode != LIO_WRITE)) {
fdrop(fp, td);
uma_zfree(aiocb_zone, aiocbe);
if (type == 0) {
if (type == 0)
suword(&job->_aiocb_private.status, 0);
suword(&job->_aiocb_private.error, EINVAL);
}
return EINVAL;
error = EINVAL;
goto aqueue_fail;
}
if (aiocbe->uaiocb.aio_sigevent.sigev_notify == SIGEV_KEVENT) {