cvs commit: src/sys/coda coda_vfsops.c src/sys/fs/devfs devfs_vfsops.c src/sys/fs/fdescfs fdesc.h fdesc_vfsops.c src/sys/fs/hpfs hpfs_vfsops.c src/sys/fs/msdosfs msdosfs_vfsops.c src/sys/fs/ntfs ntfs_vfsops.c src/sys/fs/nullfs null_vfsops.c ...

Robert Watson rwatson at FreeBSD.org
Tue Jul 13 06:39:52 PDT 2004


On Mon, 12 Jul 2004, Alfred Perlstein wrote:

>   Make VFS_ROOT() and vflush() take a thread argument.
>   This is to allow filesystems to decide based on the passed thread
>   which vnode to return.
>   Several filesystems used curthread, they now use the passed thread.

This strikes me as fairly suspect, as most consumers of any thread pointer
are going to dereference it in a way that's only safe if that thread is
curthread.  The same dubious quality applies to passing threads into other
VFS operations, and the only real purpose in most cases is to trade off
the cost of a PCPU lookup and a stack argument.  Do you plan to pass in a
thread other than curthread?  If so, how will you ensure this is safe?

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert at fledge.watson.org      Principal Research Scientist, McAfee Research




More information about the cvs-src mailing list