From: Thomas Veerman Date: Tue, 13 Sep 2011 13:02:47 +0000 (+0000) Subject: Unmap drivers upon exit X-Git-Tag: v3.2.0~308 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/invmod.png?a=commitdiff_plain;h=200b9d73394b3e9e66284bd5461911d900d36f69;p=minix.git Unmap drivers upon exit --- diff --git a/servers/avfs/device.c b/servers/avfs/device.c index 4fc25ab95..b75200a3b 100644 --- a/servers/avfs/device.c +++ b/servers/avfs/device.c @@ -565,8 +565,8 @@ PUBLIC int do_ioctl() /*===========================================================================* * gen_io * *===========================================================================*/ -PUBLIC int gen_io(task_nr, mess_ptr) -endpoint_t task_nr; /* which task to call */ +PUBLIC int gen_io(driver_e, mess_ptr) +endpoint_t driver_e; /* which endpoint to call */ message *mess_ptr; /* pointer to message for task */ { /* All file system I/O ultimately comes down to I/O on major/minor device @@ -577,15 +577,15 @@ message *mess_ptr; /* pointer to message for task */ proc_e = mess_ptr->USER_ENDPT; - r = sendrec(task_nr, mess_ptr); + r = sendrec(driver_e, mess_ptr); if (r == OK && mess_ptr->REP_STATUS == ERESTART) r = EDEADEPT; if (r != OK) { if (r == EDEADSRCDST || r == EDEADEPT) { - printf("VFS: dead driver %d\n", task_nr); - dmap_unmap_by_endpt(task_nr); + printf("VFS: dead driver %d\n", driver_e); + dmap_unmap_by_endpt(driver_e); return(r); } else if (r == ELOCKED) { - printf("VFS: ELOCKED talking to %d\n", task_nr); + printf("VFS: ELOCKED talking to %d\n", driver_e); return(r); } panic("call_task: can't send/receive: %d", r); diff --git a/servers/avfs/misc.c b/servers/avfs/misc.c index 0aee50600..092078c05 100644 --- a/servers/avfs/misc.c +++ b/servers/avfs/misc.c @@ -456,6 +456,7 @@ PRIVATE void free_proc(struct fproc *exiter, int flags) * dmap table is used in the first step.) */ unsuspend_by_endpt(exiter->fp_endpoint); + dmap_unmap_by_endpt(exiter->fp_endpoint); /* Release root and working directories. */ if (exiter->fp_rd) { put_vnode(exiter->fp_rd); exiter->fp_rd = NULL; } diff --git a/servers/avfs/proto.h b/servers/avfs/proto.h index d0c51b14a..9a327da78 100644 --- a/servers/avfs/proto.h +++ b/servers/avfs/proto.h @@ -32,7 +32,7 @@ _PROTOTYPE( int dev_close, (dev_t dev, int filp_no) ); _PROTOTYPE( int dev_io, (int op, dev_t dev, endpoint_t proc_e, void *buf, u64_t pos, size_t bytes, int flags, int suspend_reopen) ); _PROTOTYPE( int gen_opcl, (int op, dev_t dev, endpoint_t task_nr, int flags)); -_PROTOTYPE( int gen_io, (int task_nr, message *mess_ptr) ); +_PROTOTYPE( int gen_io, (endpoint_t driver_e, message *mess_ptr) ); _PROTOTYPE( int asyn_io, (int task_nr, message *mess_ptr) ); _PROTOTYPE( int no_dev, (int op, dev_t dev, int proc, int flags) ); _PROTOTYPE( int no_dev_io, (int, message *) );