Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/vfs_aio.c
Show First 20 Lines • Show All 1,435 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
/* | /* | ||||
* Queue a new AIO request. Choosing either the threaded or direct physio VCHR | * Queue a new AIO request. Choosing either the threaded or direct physio VCHR | ||||
* technique is done in this code. | * technique is done in this code. | ||||
*/ | */ | ||||
int | int | ||||
aio_aqueue(struct thread *td, struct aiocb *ujob, struct aioliojob *lj, | aio_aqueue(struct thread *td, struct aiocb *ujob, struct aioliojob *lj, | ||||
int type, struct aiocb_ops *ops) | int type, struct aiocb_ops *ops) | ||||
{ | { | ||||
struct proc *p = td->td_proc; | struct proc *p = td->td_proc; | ||||
cap_rights_t rights; | cap_rights_t rights; | ||||
struct file *fp; | struct file *fp; | ||||
struct kaiocb *job; | struct kaiocb *job; | ||||
struct kaioinfo *ki; | struct kaioinfo *ki; | ||||
struct kevent kev; | struct kevent kev; | ||||
int opcode; | int opcode; | ||||
▲ Show 20 Lines • Show All 1,018 Lines • ▼ Show 20 Lines | sys_aio_waitcomplete(struct thread *td, struct aio_waitcomplete_args *uap) | ||||
return (kern_aio_waitcomplete(td, uap->aiocbp, tsp, &aiocb_ops)); | return (kern_aio_waitcomplete(td, uap->aiocbp, tsp, &aiocb_ops)); | ||||
} | } | ||||
static int | static int | ||||
kern_aio_fsync(struct thread *td, int op, struct aiocb *ujob, | kern_aio_fsync(struct thread *td, int op, struct aiocb *ujob, | ||||
struct aiocb_ops *ops) | struct aiocb_ops *ops) | ||||
{ | { | ||||
struct proc *p = td->td_proc; | |||||
struct kaioinfo *ki; | |||||
if (op != O_SYNC) /* XXX lack of O_DSYNC */ | if (op != O_SYNC) /* XXX lack of O_DSYNC */ | ||||
return (EINVAL); | return (EINVAL); | ||||
ki = p->p_aioinfo; | |||||
if (ki == NULL) | |||||
aio_init_aioinfo(p); | |||||
return (aio_aqueue(td, ujob, NULL, LIO_SYNC, ops)); | return (aio_aqueue(td, ujob, NULL, LIO_SYNC, ops)); | ||||
} | } | ||||
int | int | ||||
sys_aio_fsync(struct thread *td, struct aio_fsync_args *uap) | sys_aio_fsync(struct thread *td, struct aio_fsync_args *uap) | ||||
{ | { | ||||
return (kern_aio_fsync(td, uap->op, uap->aiocbp, &aiocb_ops)); | return (kern_aio_fsync(td, uap->op, uap->aiocbp, &aiocb_ops)); | ||||
▲ Show 20 Lines • Show All 503 Lines • Show Last 20 Lines |