new_vmp->m_flags &= ~VMNT_MOUNTING;
if (r != OK) {
- new_vmp->m_fs_e = NONE;
- new_vmp->m_dev = NO_DEV;
+ mark_vmnt_free(new_vmp);
unlock_vnode(root_node);
if (vp != NULL) {
unlock_vnode(vp);
if (r != OK) {
unlock_vnode(vp);
unlock_vnode(root_node);
+ mark_vmnt_free(new_vmp);
unlock_vmnt(new_vmp);
put_vnode(vp);
put_vnode(root_node);
- new_vmp->m_dev = NO_DEV;
- new_vmp->m_flags = 0;
unlock_bsf();
return(r);
}
vmp->m_root_node->v_sdev = NO_DEV;
vmp->m_root_node = NULL;
}
- vmp->m_dev = NO_DEV;
- vmp->m_fs_e = NONE;
+ mark_vmnt_free(vmp);
unlock_vmnt(vmp);
/* vmnt.c */
_PROTOTYPE( void check_vmnt_locks, (void) );
_PROTOTYPE( void check_vmnt_locks_by_me, (struct fproc *rfp) );
+_PROTOTYPE( void mark_vmnt_free, (struct vmnt *vmp) );
_PROTOTYPE( struct vmnt *get_free_vmnt, (void) );
_PROTOTYPE( struct vmnt *find_vmnt, (endpoint_t fs_e) );
_PROTOTYPE( struct vmnt *get_locked_vmnt, (struct fproc *rfp) );
#endif
}
+/*===========================================================================*
+ * mark_vmnt_free *
+ *===========================================================================*/
+PUBLIC void mark_vmnt_free(struct vmnt *vmp)
+{
+ ASSERTVMP(vmp);
+
+ vmp->m_fs_e = NONE;
+ vmp->m_dev = NO_DEV;
+}
+
/*===========================================================================*
* clear_vmnt *
*===========================================================================*/
*===========================================================================*/
PUBLIC struct vmnt *get_free_vmnt(void)
{
- struct vmnt *vp;
+ struct vmnt *vmp;
- for (vp = &vmnt[0]; vp < &vmnt[NR_MNTS]; ++vp)
- if (vp->m_dev == NO_DEV) return(vp);
+ for (vmp = &vmnt[0]; vmp < &vmnt[NR_MNTS]; ++vmp) {
+ if (vmp->m_dev == NO_DEV) {
+ clear_vmnt(vmp);
+ return(vmp);
+ }
+ }
return(NULL);
}
struct vmnt *vmp;
if ((vmp = find_vmnt(proc_e)) != NULL) {
+ mark_vmnt_free(vmp);
fs_cancel(vmp);
invalidate_filp_by_endpt(proc_e);
if (vmp->m_mounted_on) {
* point. That is, the mount was succesful. */
put_vnode(vmp->m_mounted_on);
}
- clear_vmnt(vmp);
}
}