o Add missing synchronization (splnet()/splx()) in aio_free_entry().

o Move the definition of struct aiocblist from sys/aio.h to kern/vfs_aio.c.
 o Make aio_swake_cb() static.
This commit is contained in:
alc 2002-01-06 21:03:39 +00:00
parent 1272bb9235
commit 72e3d4817f
2 changed files with 27 additions and 27 deletions

View File

@ -151,6 +151,29 @@ SYSCTL_INT(_vfs_aio, OID_AUTO, aiod_timeout,
SYSCTL_INT(_vfs_aio, OID_AUTO, unloadable, CTLFLAG_RW, &unloadable, 0,
"Allow unload of aio (not recommended)");
struct aiocblist {
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 file *fd_file; /* Pointer to file structure */
struct aiothreadlist *jobaiothread; /* AIO process descriptor */
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 */
};
/* jobflags */
#define AIOCBLIST_RUNDOWN 0x4
#define AIOCBLIST_ASYNCFREE 0x8
#define AIOCBLIST_DONE 0x10
/*
* AIO process info
*/
@ -220,6 +243,7 @@ static void aio_proc_rundown(struct proc *p);
static int aio_fphysio(struct proc *p, struct aiocblist *aiocbe);
static int aio_qphysio(struct proc *p, struct aiocblist *iocb);
static void aio_daemon(void *uproc);
static void aio_swake_cb(struct socket *, struct sockbuf *);
static int aio_unload(void);
static void process_signal(void *aioj);
static int filt_aioattach(struct knote *kn);
@ -436,8 +460,10 @@ aio_free_entry(struct aiocblist *aiocbe)
aiop = aiocbe->jobaiothread;
TAILQ_REMOVE(&aiop->jobtorun, aiocbe, list);
} else if (aiocbe->jobstate == JOBST_JOBQGLOBAL) {
s = splnet();
TAILQ_REMOVE(&aio_jobs, aiocbe, list);
TAILQ_REMOVE(&ki->kaio_jobqueue, aiocbe, plist);
splx(s);
} else if (aiocbe->jobstate == JOBST_JOBFINISHED)
TAILQ_REMOVE(&ki->kaio_jobdone, aiocbe, plist);
else if (aiocbe->jobstate == JOBST_JOBBFINISHED) {
@ -1223,7 +1249,7 @@ aio_fphysio(struct proc *p, struct aiocblist *iocb)
/*
* Wake up aio requests that may be serviceable now.
*/
void
static void
aio_swake_cb(struct socket *so, struct sockbuf *sb)
{
struct aiocblist *cb,*cbn;

View File

@ -123,37 +123,11 @@ int aio_waitcomplete(struct aiocb **, struct timespec *);
__END_DECLS
#else
/*
* Job queue item
*/
#define AIOCBLIST_CANCELLED 0x1
#define AIOCBLIST_RUNDOWN 0x4
#define AIOCBLIST_ASYNCFREE 0x8
#define AIOCBLIST_DONE 0x10
struct aiocblist {
TAILQ_ENTRY(aiocblist) list; /* List of jobs */
TAILQ_ENTRY(aiocblist) plist; /* List of jobs for proc */
int jobflags;
int jobstate;
int inputcharge, outputcharge;
struct callout_handle timeouthandle;
struct buf *bp; /* Buffer pointer */
struct proc *userproc; /* User process */ /* Not td! */
struct file *fd_file; /* Pointer to file structure */
struct aiothreadlist *jobaiothread; /* AIO process descriptor */
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 */
};
/* Forward declarations for prototypes below. */
struct socket;
struct sockbuf;
void aio_swake_cb(struct socket *, struct sockbuf *);
extern void (*aio_swake)(struct socket *, struct sockbuf *);
#endif