Fix the umount problems for DEVFS.
PR: 3276 & 3469 (the fixes), 2738, 2033 (reports) Submitted by: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>
This commit is contained in:
parent
a912e453bc
commit
ce34628b4b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=25436
@ -2,7 +2,7 @@
|
||||
/*
|
||||
* Written by Julian Elischer (julian@DIALix.oz.au)
|
||||
*
|
||||
* $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.34 1997/02/12 16:19:04 mpp Exp $
|
||||
* $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.35 1997/04/10 14:35:18 bde Exp $
|
||||
*/
|
||||
|
||||
#include "opt_devfs.h"
|
||||
@ -496,6 +496,12 @@ devfs_dn_free(dn_p dnp)
|
||||
if(--dnp->links <= 0 ) /* can be -1 for initial free, on error */
|
||||
{
|
||||
/*probably need to do other cleanups XXX */
|
||||
if (dnp->nextsibling != dnp) {
|
||||
dn_p* prevp = dnp->prevsiblingp;
|
||||
*prevp = dnp->nextsibling;
|
||||
dnp->nextsibling->prevsiblingp = prevp;
|
||||
|
||||
}
|
||||
if(dnp->type == DEV_SLNK) {
|
||||
free(dnp->by.Slnk.name,M_DEVFSNODE);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Written by Julian Elischer (julian@DIALix.oz.au)
|
||||
*
|
||||
* $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_vfsops.c,v 1.15 1996/11/21 07:18:58 julian Exp $
|
||||
* $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_vfsops.c,v 1.16 1997/02/12 16:19:08 mpp Exp $
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ -139,13 +139,20 @@ DBPRINT(("start "));
|
||||
|
||||
/*
|
||||
* Unmount the filesystem described by mp.
|
||||
* Note: vnodes from this FS may hang around if being used..
|
||||
* This should not be a problem, they should be self contained.
|
||||
*/
|
||||
static int
|
||||
devfs_unmount( struct mount *mp, int mntflags, struct proc *p)
|
||||
{
|
||||
struct devfsmount *devfs_mp_p = (struct devfsmount *)mp->mnt_data;
|
||||
int flags = 0;
|
||||
int error;
|
||||
|
||||
if (mntflags & MNT_FORCE) {
|
||||
flags |= FORCECLOSE;
|
||||
}
|
||||
error = vflush(mp, NULLVP, flags);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
DBPRINT(("unmount "));
|
||||
devfs_free_plane(devfs_mp_p);
|
||||
|
Loading…
Reference in New Issue
Block a user