improve FS process bookkeeping; fixes bug where vfs tries to e.g. send

stime messages to NONE of an unmounted filesystem.
This commit is contained in:
Ben Gras 2007-05-31 12:20:09 +00:00
parent 0e44ca2b61
commit af78f809ee
3 changed files with 9 additions and 3 deletions

View File

@ -319,8 +319,10 @@ PRIVATE void init_root()
last_login_fs_e = NONE;
/* Initialize vmnt table */
for (vmp = &vmnt[0]; vmp < &vmnt[NR_MNTS]; ++vmp)
for (vmp = &vmnt[0]; vmp < &vmnt[NR_MNTS]; ++vmp) {
vmp->m_dev = NO_DEV;
vmp->m_fs_e = NONE;
}
vmp = &vmnt[0];
@ -411,7 +413,7 @@ PRIVATE void service_pm()
/* Send new time for all FS processes */
for (vmp = &vmnt[0]; vmp < &vmnt[NR_MNTS]; ++vmp) {
if (vmp->m_fs_e)
if (vmp->m_fs_e != NONE)
req_stime(vmp->m_fs_e, boottime);
}
/* No need to report status to PM */

View File

@ -72,7 +72,7 @@ PUBLIC int do_stime()
/* Send new time for all FS processes */
for (vmp = &vmnt[0]; vmp < &vmnt[NR_MNTS]; ++vmp) {
if (vmp->m_fs_e) req_stime(vmp->m_fs_e, boottime);
if (vmp->m_fs_e != NONE) req_stime(vmp->m_fs_e, boottime);
}
return OK;

View File

@ -3,6 +3,8 @@
* Jul 2006 (Balazs Gerofi)
*/
#include <minix/com.h>
#include "fs.h"
#include "vmnt.h"
@ -27,6 +29,8 @@ PUBLIC struct vmnt *get_free_vmnt(short *index)
PUBLIC struct vmnt *find_vmnt(int fs_e)
{
struct vmnt *vp;
if(fs_e == NONE)
panic(__FILE__, "find_vmnt: find for NONE", NO_NUM);
for (vp = &vmnt[0]; vp < &vmnt[NR_MNTS]; ++vp) {
if (vp->m_fs_e == fs_e) return vp;
}