Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/vfs_aio.c
Show First 20 Lines • Show All 957 Lines • ▼ Show 20 Lines | while (!TAILQ_EMPTY(&ki->kaio_syncready)) { | ||||
AIO_LOCK(ki); | AIO_LOCK(ki); | ||||
} | } | ||||
AIO_UNLOCK(ki); | AIO_UNLOCK(ki); | ||||
} | } | ||||
bool | bool | ||||
aio_cancel_cleared(struct kaiocb *job) | aio_cancel_cleared(struct kaiocb *job) | ||||
{ | { | ||||
struct kaioinfo *ki; | |||||
/* | /* | ||||
* The caller should hold the same queue lock held when | * The caller should hold the same queue lock held when | ||||
* aio_clear_cancel_function() was called and set this flag | * aio_clear_cancel_function() was called and set this flag | ||||
* ensuring this check sees an up-to-date value. However, | * ensuring this check sees an up-to-date value. However, | ||||
* there is no way to assert that. | * there is no way to assert that. | ||||
*/ | */ | ||||
ki = job->userproc->p_aioinfo; | |||||
return ((job->jobflags & KAIOCB_CLEARED) != 0); | return ((job->jobflags & KAIOCB_CLEARED) != 0); | ||||
} | } | ||||
static bool | static bool | ||||
aio_clear_cancel_function_locked(struct kaiocb *job) | aio_clear_cancel_function_locked(struct kaiocb *job) | ||||
{ | { | ||||
AIO_LOCK_ASSERT(job->userproc->p_aioinfo, MA_OWNED); | AIO_LOCK_ASSERT(job->userproc->p_aioinfo, MA_OWNED); | ||||
▲ Show 20 Lines • Show All 704 Lines • ▼ Show 20 Lines | if (!aio_cancel_cleared(job)) | ||||
TAILQ_REMOVE(&ki->kaio_syncqueue, job, list); | TAILQ_REMOVE(&ki->kaio_syncqueue, job, list); | ||||
AIO_UNLOCK(ki); | AIO_UNLOCK(ki); | ||||
aio_cancel(job); | aio_cancel(job); | ||||
} | } | ||||
int | int | ||||
aio_queue_file(struct file *fp, struct kaiocb *job) | aio_queue_file(struct file *fp, struct kaiocb *job) | ||||
{ | { | ||||
struct aioliojob *lj; | |||||
struct kaioinfo *ki; | struct kaioinfo *ki; | ||||
struct kaiocb *job2; | struct kaiocb *job2; | ||||
struct vnode *vp; | struct vnode *vp; | ||||
struct mount *mp; | struct mount *mp; | ||||
int error, opcode; | int error, opcode; | ||||
bool safe; | bool safe; | ||||
lj = job->lio; | |||||
ki = job->userproc->p_aioinfo; | ki = job->userproc->p_aioinfo; | ||||
opcode = job->uaiocb.aio_lio_opcode; | opcode = job->uaiocb.aio_lio_opcode; | ||||
if (opcode == LIO_SYNC) | if (opcode == LIO_SYNC) | ||||
goto queueit; | goto queueit; | ||||
if ((error = aio_qphysio(job->userproc, job)) == 0) | if ((error = aio_qphysio(job->userproc, job)) == 0) | ||||
goto done; | goto done; | ||||
#if 0 | #if 0 | ||||
▲ Show 20 Lines • Show All 1,294 Lines • Show Last 20 Lines |