clean up whitespace...
This commit is contained in:
parent
28f803f8fb
commit
bea28d4a04
@ -169,26 +169,26 @@ SYSCTL_INT(_vfs_aio, OID_AUTO, max_buf_aio, CTLFLAG_RW, &max_buf_aio, 0,
|
||||
"Maximum buf aio requests per process (stored in the process)");
|
||||
|
||||
struct aiocblist {
|
||||
TAILQ_ENTRY(aiocblist) list; /* List of jobs */
|
||||
TAILQ_ENTRY(aiocblist) plist; /* List of jobs for proc */
|
||||
int jobflags;
|
||||
int jobstate;
|
||||
TAILQ_ENTRY(aiocblist) list; /* List of jobs */
|
||||
TAILQ_ENTRY(aiocblist) plist; /* List of jobs for proc */
|
||||
int jobflags;
|
||||
int jobstate;
|
||||
int inputcharge;
|
||||
int outputcharge;
|
||||
struct callout_handle timeouthandle;
|
||||
struct buf *bp; /* Buffer pointer */
|
||||
struct proc *userproc; /* User process */ /* Not td! */
|
||||
struct buf *bp; /* Buffer pointer */
|
||||
struct proc *userproc; /* User process */ /* Not td! */
|
||||
struct ucred *cred; /* Active credential when created */
|
||||
struct file *fd_file; /* Pointer to file structure */
|
||||
struct aio_liojob *lio; /* Optional lio job */
|
||||
struct aiocb *uuaiocb; /* Pointer in userspace of aiocb */
|
||||
struct file *fd_file; /* Pointer to file structure */
|
||||
struct aio_liojob *lio; /* Optional lio job */
|
||||
struct aiocb *uuaiocb; /* Pointer in userspace of aiocb */
|
||||
struct klist klist; /* list of knotes */
|
||||
struct aiocb uaiocb; /* Kernel I/O control block */
|
||||
struct aiocb uaiocb; /* Kernel I/O control block */
|
||||
};
|
||||
|
||||
/* jobflags */
|
||||
#define AIOCBLIST_RUNDOWN 0x4
|
||||
#define AIOCBLIST_DONE 0x10
|
||||
#define AIOCBLIST_RUNDOWN 0x4
|
||||
#define AIOCBLIST_DONE 0x10
|
||||
|
||||
/*
|
||||
* AIO process info
|
||||
@ -416,7 +416,7 @@ aio_init_aioinfo(struct proc *p)
|
||||
TAILQ_INIT(&ki->kaio_liojoblist);
|
||||
TAILQ_INIT(&ki->kaio_sockqueue);
|
||||
}
|
||||
|
||||
|
||||
while (num_aio_procs < target_aio_procs)
|
||||
aio_newproc();
|
||||
}
|
||||
@ -453,7 +453,7 @@ aio_free_entry(struct aiocblist *aiocbe)
|
||||
panic("aio_free_entry: process queue size <= 0");
|
||||
if (num_queue_count <= 0)
|
||||
panic("aio_free_entry: system wide queue size <= 0");
|
||||
|
||||
|
||||
if (lj) {
|
||||
lj->lioj_queue_count--;
|
||||
if (aiocbe->jobflags & AIOCBLIST_DONE)
|
||||
@ -476,11 +476,11 @@ aio_free_entry(struct aiocblist *aiocbe)
|
||||
}
|
||||
|
||||
/* aiocbe is going away, we need to destroy any knotes */
|
||||
/* XXXKSE Note the thread here is used to eventually find the
|
||||
/* XXXKSE Note the thread here is used to eventually find the
|
||||
* owning process again, but it is also used to do a fo_close
|
||||
* and that requires the thread. (but does it require the
|
||||
* OWNING thread? (or maybe the running thread?)
|
||||
* There is a semantic problem here...
|
||||
* There is a semantic problem here...
|
||||
*/
|
||||
knote_remove(FIRST_THREAD_IN_PROC(p), &aiocbe->klist); /* XXXKSE */
|
||||
|
||||
@ -528,7 +528,7 @@ aio_free_entry(struct aiocblist *aiocbe)
|
||||
}
|
||||
|
||||
/*
|
||||
* Rundown the jobs for a given process.
|
||||
* Rundown the jobs for a given process.
|
||||
*/
|
||||
static void
|
||||
aio_proc_rundown(void *arg, struct proc *p)
|
||||
@ -620,11 +620,11 @@ restart4:
|
||||
}
|
||||
splx(s);
|
||||
|
||||
/*
|
||||
* If we've slept, jobs might have moved from one queue to another.
|
||||
* Retry rundown if we didn't manage to empty the queues.
|
||||
*/
|
||||
if (TAILQ_FIRST(&ki->kaio_jobdone) != NULL ||
|
||||
/*
|
||||
* If we've slept, jobs might have moved from one queue to another.
|
||||
* Retry rundown if we didn't manage to empty the queues.
|
||||
*/
|
||||
if (TAILQ_FIRST(&ki->kaio_jobdone) != NULL ||
|
||||
TAILQ_FIRST(&ki->kaio_jobqueue) != NULL ||
|
||||
TAILQ_FIRST(&ki->kaio_bufqueue) != NULL ||
|
||||
TAILQ_FIRST(&ki->kaio_bufdone) != NULL)
|
||||
@ -862,17 +862,17 @@ aio_daemon(void *uproc)
|
||||
* connected to.
|
||||
*/
|
||||
tmpvm = mycp->p_vmspace;
|
||||
|
||||
|
||||
/*
|
||||
* Point to the new user address space, and
|
||||
* refer to it.
|
||||
*/
|
||||
mycp->p_vmspace = userp->p_vmspace;
|
||||
atomic_add_int(&mycp->p_vmspace->vm_refcnt, 1);
|
||||
|
||||
|
||||
/* Activate the new mapping. */
|
||||
pmap_activate(FIRST_THREAD_IN_PROC(mycp));
|
||||
|
||||
|
||||
/*
|
||||
* If the old address space wasn't the daemons
|
||||
* own address space, then we need to remove the
|
||||
@ -953,10 +953,10 @@ aio_daemon(void *uproc)
|
||||
if (curcp != mycp) {
|
||||
/* Get the user address space to disconnect from. */
|
||||
tmpvm = mycp->p_vmspace;
|
||||
|
||||
|
||||
/* Get original address space for daemon. */
|
||||
mycp->p_vmspace = myvm;
|
||||
|
||||
|
||||
/* Activate the daemon's address space. */
|
||||
pmap_activate(FIRST_THREAD_IN_PROC(mycp));
|
||||
#ifdef DIAGNOSTIC
|
||||
@ -967,7 +967,7 @@ aio_daemon(void *uproc)
|
||||
#endif
|
||||
/* Remove our vmspace reference. */
|
||||
vmspace_free(tmpvm);
|
||||
|
||||
|
||||
curcp = mycp;
|
||||
}
|
||||
|
||||
@ -1023,7 +1023,7 @@ aio_newproc(void)
|
||||
struct proc *p;
|
||||
|
||||
error = kthread_create(aio_daemon, curproc, &p, RFNOWAIT, 0, "aiod%d",
|
||||
num_aio_procs);
|
||||
num_aio_procs);
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
@ -1041,11 +1041,11 @@ aio_newproc(void)
|
||||
/*
|
||||
* Try the high-performance, low-overhead physio method for eligible
|
||||
* VCHR devices. This method doesn't use an aio helper thread, and
|
||||
* thus has very low overhead.
|
||||
* thus has very low overhead.
|
||||
*
|
||||
* Assumes that the caller, _aio_aqueue(), has incremented the file
|
||||
* structure's reference count, preventing its deallocation for the
|
||||
* duration of this call.
|
||||
* duration of this call.
|
||||
*/
|
||||
static int
|
||||
aio_qphysio(struct proc *p, struct aiocblist *aiocbe)
|
||||
@ -1063,7 +1063,7 @@ aio_qphysio(struct proc *p, struct aiocblist *aiocbe)
|
||||
cb = &aiocbe->uaiocb;
|
||||
fp = aiocbe->fd_file;
|
||||
|
||||
if (fp->f_type != DTYPE_VNODE)
|
||||
if (fp->f_type != DTYPE_VNODE)
|
||||
return (-1);
|
||||
|
||||
vp = fp->f_vnode;
|
||||
@ -1088,7 +1088,7 @@ aio_qphysio(struct proc *p, struct aiocblist *aiocbe)
|
||||
return (-1);
|
||||
|
||||
ki = p->p_aioinfo;
|
||||
if (ki->kaio_buffer_count >= ki->kaio_ballowed_count)
|
||||
if (ki->kaio_buffer_count >= ki->kaio_ballowed_count)
|
||||
return (-1);
|
||||
|
||||
ki->kaio_buffer_count++;
|
||||
@ -1136,13 +1136,13 @@ aio_qphysio(struct proc *p, struct aiocblist *aiocbe)
|
||||
bp->b_error = 0;
|
||||
|
||||
splx(s);
|
||||
|
||||
|
||||
/* Perform transfer. */
|
||||
DEV_STRATEGY(bp);
|
||||
|
||||
notify = 0;
|
||||
s = splbio();
|
||||
|
||||
|
||||
/*
|
||||
* If we had an error invoking the request, or an error in processing
|
||||
* the request before we have returned, we process it as an error in
|
||||
@ -1212,7 +1212,7 @@ aio_fphysio(struct aiocblist *iocb)
|
||||
iocb->bp = 0;
|
||||
|
||||
error = 0;
|
||||
|
||||
|
||||
/* Check for an error. */
|
||||
if (bp->b_ioflags & BIO_ERROR)
|
||||
error = bp->b_error;
|
||||
@ -1366,7 +1366,7 @@ _aio_aqueue(struct thread *td, struct aiocb *job, struct aio_liojob *lj, int typ
|
||||
jobrefid = 1;
|
||||
else
|
||||
jobrefid++;
|
||||
|
||||
|
||||
if (opcode == LIO_NOP) {
|
||||
fdrop(fp, td);
|
||||
uma_zfree(aiocb_zone, aiocbe);
|
||||
@ -1620,7 +1620,7 @@ aio_suspend(struct thread *td, struct aio_suspend_args *uap)
|
||||
int error, s, timo;
|
||||
long *ijoblist;
|
||||
struct aiocb **ujoblist;
|
||||
|
||||
|
||||
if (uap->nent < 0 || uap->nent > AIO_LISTIO_MAX)
|
||||
return (EINVAL);
|
||||
|
||||
@ -1739,12 +1739,12 @@ aio_cancel(struct thread *td, struct aio_cancel_args *uap)
|
||||
(fp = fdp->fd_ofiles[uap->fd]) == NULL)
|
||||
return (EBADF);
|
||||
|
||||
if (fp->f_type == DTYPE_VNODE) {
|
||||
if (fp->f_type == DTYPE_VNODE) {
|
||||
vp = fp->f_vnode;
|
||||
|
||||
|
||||
if (vn_isdisk(vp,&error)) {
|
||||
td->td_retval[0] = AIO_NOTCANCELED;
|
||||
return (0);
|
||||
return (0);
|
||||
}
|
||||
} else if (fp->f_type == DTYPE_SOCKET) {
|
||||
so = fp->f_data;
|
||||
@ -1768,13 +1768,13 @@ aio_cancel(struct thread *td, struct aio_cancel_args *uap)
|
||||
cbe->uaiocb._aiocb_private.error=ECANCELED;
|
||||
cancelled++;
|
||||
/* XXX cancelled, knote? */
|
||||
if (cbe->uaiocb.aio_sigevent.sigev_notify ==
|
||||
if (cbe->uaiocb.aio_sigevent.sigev_notify ==
|
||||
SIGEV_SIGNAL) {
|
||||
PROC_LOCK(cbe->userproc);
|
||||
psignal(cbe->userproc, cbe->uaiocb.aio_sigevent.sigev_signo);
|
||||
PROC_UNLOCK(cbe->userproc);
|
||||
}
|
||||
if (uap->aiocbp)
|
||||
if (uap->aiocbp)
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1794,21 +1794,21 @@ aio_cancel(struct thread *td, struct aio_cancel_args *uap)
|
||||
cbn = TAILQ_NEXT(cbe, plist);
|
||||
|
||||
if ((uap->fd == cbe->uaiocb.aio_fildes) &&
|
||||
((uap->aiocbp == NULL ) ||
|
||||
((uap->aiocbp == NULL ) ||
|
||||
(uap->aiocbp == cbe->uuaiocb))) {
|
||||
|
||||
|
||||
if (cbe->jobstate == JOBST_JOBQGLOBAL) {
|
||||
TAILQ_REMOVE(&aio_jobs, cbe, list);
|
||||
TAILQ_REMOVE(&ki->kaio_jobqueue, cbe, plist);
|
||||
TAILQ_INSERT_TAIL(&ki->kaio_jobdone, cbe,
|
||||
plist);
|
||||
TAILQ_REMOVE(&ki->kaio_jobqueue, cbe, plist);
|
||||
TAILQ_INSERT_TAIL(&ki->kaio_jobdone, cbe,
|
||||
plist);
|
||||
cancelled++;
|
||||
ki->kaio_queue_finished_count++;
|
||||
cbe->jobstate = JOBST_JOBFINISHED;
|
||||
cbe->uaiocb._aiocb_private.status = -1;
|
||||
cbe->uaiocb._aiocb_private.error = ECANCELED;
|
||||
/* XXX cancelled, knote? */
|
||||
if (cbe->uaiocb.aio_sigevent.sigev_notify ==
|
||||
if (cbe->uaiocb.aio_sigevent.sigev_notify ==
|
||||
SIGEV_SIGNAL) {
|
||||
PROC_LOCK(cbe->userproc);
|
||||
psignal(cbe->userproc, cbe->uaiocb.aio_sigevent.sigev_signo);
|
||||
@ -1984,7 +1984,7 @@ lio_listio(struct thread *td, struct lio_listio_args *uap)
|
||||
*/
|
||||
if (uap->sig && (uap->mode == LIO_NOWAIT)) {
|
||||
error = copyin(uap->sig, &lj->lioj_signal,
|
||||
sizeof(lj->lioj_signal));
|
||||
sizeof(lj->lioj_signal));
|
||||
if (error) {
|
||||
uma_zfree(aiolio_zone, lj);
|
||||
return (error);
|
||||
@ -2028,7 +2028,7 @@ lio_listio(struct thread *td, struct lio_listio_args *uap)
|
||||
|
||||
if (uap->mode == LIO_WAIT) {
|
||||
int command, found, jobref;
|
||||
|
||||
|
||||
for (;;) {
|
||||
found = 0;
|
||||
for (i = 0; i < uap->nent; i++) {
|
||||
@ -2091,7 +2091,7 @@ lio_listio(struct thread *td, struct lio_listio_args *uap)
|
||||
*/
|
||||
if (found == nentqueued)
|
||||
return (runningcode);
|
||||
|
||||
|
||||
ki->kaio_flags |= KAIO_WAKEUP;
|
||||
error = tsleep(p, PRIBIO | PCATCH, "aiospn", 0);
|
||||
|
||||
@ -2160,7 +2160,7 @@ aio_physwakeup(struct buf *bp)
|
||||
lj = aiocbe->lio;
|
||||
if (lj) {
|
||||
lj->lioj_buffer_finished_count++;
|
||||
|
||||
|
||||
/*
|
||||
* wakeup/signal if all of the interrupt jobs are done.
|
||||
*/
|
||||
@ -2211,7 +2211,7 @@ aio_waitcomplete(struct thread *td, struct aio_waitcomplete_args *uap)
|
||||
struct kaioinfo *ki;
|
||||
struct aiocblist *cb = NULL;
|
||||
int error, s, timo;
|
||||
|
||||
|
||||
suword(uap->aiocbp, (int)NULL);
|
||||
|
||||
timo = 0;
|
||||
@ -2314,6 +2314,6 @@ filt_aio(struct knote *kn, long hint)
|
||||
if (aiocbe->jobstate != JOBST_JOBFINISHED &&
|
||||
aiocbe->jobstate != JOBST_JOBBFINISHED)
|
||||
return (0);
|
||||
kn->kn_flags |= EV_EOF;
|
||||
kn->kn_flags |= EV_EOF;
|
||||
return (1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user