--- src/sys/emulation/ibcs2/i386/Attic/ibcs2_stat.c 2003/09/23 05:03:50 1.9 +++ src/sys/emulation/ibcs2/i386/Attic/ibcs2_stat.c 2004/11/12 00:09:16 1.10 @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include @@ -108,21 +108,24 @@ ibcs2_statfs(struct ibcs2_statfs_args *u struct mount *mp; struct statfs *sp; int error; - struct nameidata nd; + struct nlookupdata nd; caddr_t sg = stackgap_init(); CHECKALTEXIST(&sg, SCARG(uap, path)); - NDINIT(&nd, NAMEI_LOOKUP, CNP_FOLLOW, UIO_USERSPACE, SCARG(uap, path), td); - if ((error = namei(&nd)) != 0) - return (error); - NDFREE(&nd, NDF_ONLY_PNBUF); - mp = nd.ni_vp->v_mount; - sp = &mp->mnt_stat; - vrele(nd.ni_vp); - if ((error = VFS_STATFS(mp, sp, td)) != 0) - return (error); - sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; - return cvt_statfs(sp, (caddr_t)SCARG(uap, buf), SCARG(uap, len)); + error = nlookup_init(&nd, SCARG(uap, path), UIO_USERSPACE, NLC_FOLLOW); + if (error == 0) + error = nlookup(&nd); + if (error == 0) { + mp = nd.nl_ncp->nc_mount; + sp = &mp->mnt_stat; + error = VFS_STATFS(mp, sp, td); + if (error == 0) { + sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; + error = cvt_statfs(sp, (caddr_t)SCARG(uap, buf), + SCARG(uap, len)); + } + } + nlookup_done(&nd); } int