[Libsysio-commit] HEAD: libsysio/src namei.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2008-04-22 21:56:07
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19135/src Modified Files: namei.c Log Message: Two changes: 1) Pnodes that are root of a mount now loop on themselves. Changed lookup to descend, then move up when encountering such a node now. 2) Automounts need their root to have a soft-reference, always, now. Index: namei.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/namei.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -w -b -B -p -r1.28 -r1.29 --- namei.c 7 Apr 2008 19:15:49 -0000 1.28 +++ namei.c 22 Apr 2008 21:56:03 -0000 1.29 @@ -118,7 +118,11 @@ lookup(struct pnode *parent, else if (name->len == 2 && name->name[0] == '.' && name->name[1] == '.') { + while (parent->p_mount->mnt_root == parent && + parent != parent->p_mount->mnt_covers) + parent = parent->p_mount->mnt_covers; pno = parent->p_parent; + assert(pno); } if (pno) P_REF(pno); @@ -129,8 +133,6 @@ lookup(struct pnode *parent, err = _sysio_p_find_alias(parent, name, &pno); if (err) return err; - } - /* * While covered, move to the covering node. */ @@ -142,6 +144,7 @@ lookup(struct pnode *parent, P_RELE(pno); pno = cover; } + } *pnop = pno; @@ -296,6 +299,7 @@ _sysio_path_walk(struct pnode *parent, s * arrange the mount if so. */ assert(!nd->nd_pno->p_cover); + pno = NULL; err = lookup(nd->nd_pno, &_sysio_mount_file_name, @@ -304,28 +308,21 @@ _sysio_path_walk(struct pnode *parent, s NULL, 1); if (!err && (err = _sysio_automount(pno)) == 0) { - struct pnode *root; - /* * All went well. Need to switch * parent pno and ino to the * root of the newly mounted sub-tree. * * NB: - * We don't recurseively retry these + * We don't recursively retry these * things. It's OK to have the new root * be an automount-point but it's going * to take another lookup to accomplish it. * The alternative could get us into an * infinite loop. */ - root = nd->nd_pno->p_cover; - assert(root); - P_RELE(nd->nd_pno); - nd->nd_pno = root; -#if 0 + nd->nd_pno = nd->nd_pno->p_cover; P_REF(nd->nd_pno); -#endif ino = nd->nd_pno->p_base->pb_ino; assert(ino); |