From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 13 19:49:56 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4240916A41B for ; Sun, 13 Jan 2008 19:49:56 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:610:652::211]) by mx1.freebsd.org (Postfix) with ESMTP id F417813C461 for ; Sun, 13 Jan 2008 19:49:55 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id C56181CD4C; Sun, 13 Jan 2008 20:49:54 +0100 (CET) Date: Sun, 13 Jan 2008 20:49:54 +0100 From: Ed Schouten To: Fernando =?iso-8859-1?Q?Apestegu=EDa?= Message-ID: <20080113194954.GG80300@hoeg.nl> References: <1bd550a00801131034o2999b85eu589cd8ee18a114ea@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jk/5KjyVsvxWSMIA" Content-Disposition: inline In-Reply-To: <1bd550a00801131034o2999b85eu589cd8ee18a114ea@mail.gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: FreeBSD Hackers Subject: Re: mutex lock for filesystem list. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Jan 2008 19:49:56 -0000 --jk/5KjyVsvxWSMIA Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Fernando Apestegu=EDa wrote: > I'm trying to write a patch to add a file to the linprocfs. This file > provides the list of filesystems present in the kernel. >=20 > Though I was able to create the file and traverse the list, it's > clearly unsafe. I would like to know wich semaphore I should lock > cause I can't find it in the kernel code. >=20 > In addition I'd like to know if there is a book similar to the > Understanding the Linux kernel, but for freebsd. What is the best > information source to get introduced in the freebsd kernel programming > (apart of the code itself)? You're probably looking through the mountlist? Then you need to make sure you lock the mountlist_mtx. See src/sys/kern/vfs_mount.c. --=20 Ed Schouten WWW: http://g-rave.nl/ --jk/5KjyVsvxWSMIA Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (FreeBSD) iEYEARECAAYFAkeKa2IACgkQ52SDGA2eCwXQqACfbuRDpg1XfCI/CR5Tk/dxXsJK p2IAnjd1OeGhpYYfkg/jOaW2D5+pm8af =jEwV -----END PGP SIGNATURE----- --jk/5KjyVsvxWSMIA--