mutex lock for filesystem list.

Ed Schouten ed at fxq.nl
Sun Jan 13 11:49:56 PST 2008


* Fernando Apesteguía <fernando.apesteguia at gmail.com> 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.
> 
> 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.
> 
> 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.

-- 
 Ed Schouten <ed at fxq.nl>
 WWW: http://g-rave.nl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20080113/2d733f26/attachment.pgp


More information about the freebsd-hackers mailing list