Two 'dynamic driver' features in FS:
. When drivers disappear that have pending select()s, wake up those user processes with EAGAIN so that they can retry their select() and won't hang forever on it. . When drivers re-appear and are mapped into the dmap, run through the list of mounted filesystems and re-dev_open() every one (for partition tables and such). This can't happen before the driver has exec()ced itself, so processes that have fork()ed but not exec()ced yet are marked as DMAP_BABY in the dmap table if they are dmapped before they are execced. If that happens, the above procedure happens after the exec(). If the exec() happens before the dmapping, it (the dev_open()ing) happens right away.
This commit is contained in:
+9
-3
@@ -11,6 +11,7 @@
|
||||
* release: check to see if a suspended process can be released and do
|
||||
* it
|
||||
* revive: mark a suspended process as able to run again
|
||||
* unsuspend_by_proc: revive all processes blocking on a given process
|
||||
* do_unpause: a signal has been sent to a process; see if it suspended
|
||||
*/
|
||||
|
||||
@@ -197,17 +198,22 @@ int task; /* who is proc waiting for? (PIPE = pipe) */
|
||||
/*===========================================================================*
|
||||
* unsuspend_by_proc *
|
||||
*===========================================================================*/
|
||||
void unsuspend_by_proc(int proc)
|
||||
PUBLIC void unsuspend_by_proc(int proc)
|
||||
{
|
||||
struct fproc *rp;
|
||||
int client = 0;
|
||||
|
||||
/* Revive processes waiting for drivers (SUSPENDed) that have
|
||||
* disappeared with return code EIO.
|
||||
* disappeared with return code EAGAIN.
|
||||
*/
|
||||
for (rp = &fproc[0]; rp < &fproc[NR_PROCS]; rp++, client++)
|
||||
if(rp->fp_suspended == SUSPENDED && rp->fp_task == -proc)
|
||||
revive(client, EIO);
|
||||
revive(client, EAGAIN);
|
||||
|
||||
/* Revive processes waiting in drivers on select()s
|
||||
* with EAGAIN too.
|
||||
*/
|
||||
select_unsuspend_by_proc(proc);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user