[Libsysio-commit] HEAD: libsysio/src mount.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2008-04-22 22:02:56
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22547/src Modified Files: mount.c Log Message: Parent pointer of root of a mount no longer points to the parent of the node it covered. Instead, such nodes loop. Also, the diagnostic that prints a pnode needs some more fields to be initialized in the mount record. Index: mount.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mount.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -w -b -B -p -r1.27 -r1.28 --- mount.c 14 Apr 2008 23:26:13 -0000 1.27 +++ mount.c 22 Apr 2008 22:02:49 -0000 1.28 @@ -159,8 +159,9 @@ _sysio_do_mount(struct filesys *fs, /* * Get alias for the new root. */ + mnt->mnt_root = mnt->mnt_covers = NULL; mnt->mnt_root = - _sysio_p_new_alias(tocover ? tocover->p_parent : NULL, rootpb, mnt); + _sysio_p_new_alias(NULL, rootpb, mnt); if (!mnt->mnt_root) { err = -ENOMEM; goto error; @@ -236,6 +237,7 @@ _sysio_do_unmount(struct mount *mnt) struct filesys *fs; root = mnt->mnt_root; + assert(root->p_ref); if (root->p_cover && root->p_cover != root) { /* * Active mount. @@ -727,15 +729,13 @@ _sysio_automount(struct pnode *mntpno) /* * Do the deed. */ - P_REF(mntpno->p_parent); + assert(mntpno->p_parent->p_ref); err = (*fssw->fssw_ops.fsswop_mount)(source, flags, opts, mntpno->p_parent, &mnt); - if (err) - P_RELE(mntpno->p_parent); out: if (buf) |