From owner-freebsd-hackers Mon Feb 11 0:40:20 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from milla.33net.fdns.net (milla.33net.fdns.net [217.197.166.58]) by hub.freebsd.org (Postfix) with ESMTP id 1641D37B400 for ; Mon, 11 Feb 2002 00:40:13 -0800 (PST) Received: (from nick@localhost) by milla.33net.fdns.net (8.11.6/8.11.6) id g1B8enf07691 for freebsd-hackers@freebsd.org; Mon, 11 Feb 2002 09:40:49 +0100 (CET) (envelope-from nick) Date: Mon, 11 Feb 2002 09:40:49 +0100 From: =?ISO-8859-2?Q?Pawe=B3_Jakub_Dawidek?= To: freebsd-hackers@freebsd.org Subject: Devices and namei(9). Message-ID: <20020211094049.B251@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="wzJLGUyc3ArbnUjN" Content-Disposition: inline User-Agent: Mutt/1.2.5i X-PGP-Key-URL: http://garage.freebsd.pl/keys/PGP.txt X-OS: FreeBSD 4.5-STABLE i386 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --wzJLGUyc3ArbnUjN Content-Type: text/plain; charset=ISO-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi. I got problem with namei(9) and some devices. Example (catching syscall open()): static int n_open(register struct proc *p, register struct open_args *ea) { [...] long finode =3D 0; struct nameidata nd, *ndptr; [...] ndptr =3D &nd; NDINIT(ndptr, LOOKUP, FOLLOW | SAVENAME, UIO_USERSPACE, ea->path, p); if (!namei(ndptr)) if (!VOP_GETATTR(ndptr->ni_vp, &va, p->p_ucred, p)) finode =3D va.va_fileid; [...] } I use namei() coz i want file inode. But when namei() will be called some devices are blocking. For example if I do in this way: [...] return open(p, ea); if (!namei(ndptr)) [...] Everything is oke, but: namei(ndptr) return open(p, ea); isn't. % mpg123 some.mp3 Can't open /dev/dsp! And /dev/dsp is completely fucked up, it is still busy even if I unload my module. Only reboot can free it. So what's going on? Or maybe there is some other way to get file inode? --=20 Pawe=B3 Jakub Dawidek Network Administrator. Am I Evil? Yes, I Am. --wzJLGUyc3ArbnUjN Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: 2.6.3ia iQCVAwUBPGeDkT/PhmMH/Mf1AQEUoAP/Wh/P1ukaSSILkrfJVu85wRDb668a/Kwa kNLHgQjBg3oUlhAkiaLOv622FC9qGKKWzTj1EAcBHgbzUXyYVTm2AgHdh/TWuGsH 4tgcr/Eh9Z0CH+p4lGR/t+NEB/iHahsYZPsdjQCkbjqVC+uw+Qa29rF/4L9q65aB /WwUeUHTQDk= =nnyP -----END PGP SIGNATURE----- --wzJLGUyc3ArbnUjN-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message