diff options
author | davidxu <davidxu@FreeBSD.org> | 2006-01-24 02:46:15 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2006-01-24 02:46:15 +0000 |
commit | acb3d897fbdea11378e2c12bca5794f5098a15da (patch) | |
tree | c9274741b091589002f36543a60e583c687b7fe4 /sys/kern/vfs_aio.c | |
parent | c934cfadd1ea1fb9ac2c5aa3bf99bbe86c8f70b8 (diff) | |
download | FreeBSD-src-acb3d897fbdea11378e2c12bca5794f5098a15da.zip FreeBSD-src-acb3d897fbdea11378e2c12bca5794f5098a15da.tar.gz |
More cleanup for aio code:
1) unregsiter kqueue filter for EVFILT_LIO.
2) free uma_zones.
3) call setsid directly to enter another session rather than
implementing by itself.
Submitted by: jhb
Diffstat (limited to 'sys/kern/vfs_aio.c')
-rw-r--r-- | sys/kern/vfs_aio.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index f7bde2e..fbfa5a1 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -420,10 +420,18 @@ aio_unload(void) error = kqueue_del_filteropts(EVFILT_AIO); if (error) return error; + error = kqueue_del_filteropts(EVFILT_LIO); + if (error) + return error; async_io_version = 0; aio_swake = NULL; taskqueue_free(taskqueue_aiod_bio); delete_unrhdr(aiod_unr); + uma_zdestroy(kaio_zone); + uma_zdestroy(aiop_zone); + uma_zdestroy(aiocb_zone); + uma_zdestroy(aiol_zone); + uma_zdestroy(aiolio_zone); EVENTHANDLER_DEREGISTER(process_exit, exit_tag); EVENTHANDLER_DEREGISTER(process_exec, exec_tag); mtx_destroy(&aio_job_mtx); @@ -833,8 +841,6 @@ aio_daemon(void *_id) struct proc *curcp, *mycp, *userp; struct vmspace *myvm, *tmpvm; struct thread *td = curthread; - struct pgrp *newpgrp; - struct session *newsess; int id = (intptr_t)_id; /* @@ -866,15 +872,7 @@ aio_daemon(void *_id) */ fdfree(td); - /* The daemon resides in its own pgrp. */ - MALLOC(newpgrp, struct pgrp *, sizeof(struct pgrp), M_PGRP, - M_WAITOK | M_ZERO); - MALLOC(newsess, struct session *, sizeof(struct session), M_SESSION, - M_WAITOK | M_ZERO); - - sx_xlock(&proctree_lock); - enterpgrp(mycp, mycp->p_pid, newpgrp, newsess); - sx_xunlock(&proctree_lock); + setsid(td, NULL); /* * Wakeup parent process. (Parent sleeps to keep from blasting away |