From: Thomas Veerman Date: Fri, 27 Jan 2012 13:38:40 +0000 (+0000) Subject: AVFS: initialize root FS before receiving new work X-Git-Tag: v3.2.0~102 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/Bv9ARM.ch10.html?a=commitdiff_plain;h=0e537f1085d53df3217dee2c519f8fe5fe7a52e6;p=minix.git AVFS: initialize root FS before receiving new work --- diff --git a/servers/avfs/glo.h b/servers/avfs/glo.h index 0995c144b..931c68c33 100644 --- a/servers/avfs/glo.h +++ b/servers/avfs/glo.h @@ -35,7 +35,6 @@ EXTERN message m_out; /* the output message used for reply */ # define super_user (fp->fp_effuid == SU_UID ? 1 : 0) # define scratch(p) (scratchpad[((int) ((p) - fproc))]) EXTERN struct worker_thread *self; -EXTERN endpoint_t receive_from;/* endpoint with pending reply */ EXTERN int force_sync; /* toggle forced synchronous communication */ EXTERN int verbose; EXTERN int deadlock_resolving; diff --git a/servers/avfs/main.c b/servers/avfs/main.c index bca40234a..143ce9d4b 100644 --- a/servers/avfs/main.c +++ b/servers/avfs/main.c @@ -62,6 +62,7 @@ FORWARD _PROTOTYPE( int unblock, (struct fproc *rfp) ); FORWARD _PROTOTYPE( void sef_local_startup, (void) ); FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) ); PRIVATE mutex_t pm_lock; +PRIVATE endpoint_t receive_from; /*===========================================================================* * main * @@ -485,6 +486,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *info) struct rprocpub rprocpub[NR_BOOT_PROCS]; force_sync = 0; + receive_from = ANY; /* Initialize proc endpoints to NONE */ for (rfp = &fproc[0]; rfp < &fproc[NR_PROCS]; rfp++) { @@ -579,6 +581,7 @@ PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *info) init_filps(); /* Init filp structures */ mount_pfs(); /* mount Pipe File Server */ worker_start(do_init_root); /* mount initial ramdisk as file system root */ + yield(); /* force do_init_root to start */ return(OK); } @@ -607,8 +610,10 @@ PRIVATE void *do_init_root(void *arg) rfp->fp_wd = NULL; } + receive_from = MFS_PROC_NR; if ((r = mount_fs(DEV_IMGRD, "/", MFS_PROC_NR, 0, mount_label)) != OK) panic("Failed to initialize root"); + receive_from = ANY; unlock_pm(); thread_cleanup(fp); @@ -729,7 +734,7 @@ PRIVATE void get_work() for(;;) { /* Normal case. No one to revive. Get a useful request. */ - if ((r = sef_receive(ANY, &m_in)) != OK) { + if ((r = sef_receive(receive_from, &m_in)) != OK) { panic("VFS: sef_receive error: %d", r); }