mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-29 16:44:03 +00:00
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
This commit is contained in:
parent
14665331ab
commit
bd793be3c6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154744
@ -418,12 +418,20 @@ aio_unload(void)
|
||||
return (EOPNOTSUPP);
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user