diff options
author | des <des@FreeBSD.org> | 2007-04-14 14:08:30 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2007-04-14 14:08:30 +0000 |
commit | 8dea6eb551705418618e5d68bee96d521d326dc6 (patch) | |
tree | 8776799c42c10769a373413b3de276bdb92b7d60 /sys/fs/pseudofs/pseudofs.h | |
parent | 5953cee02a231f279bc2d4cf8fdf52d332e94a29 (diff) | |
download | FreeBSD-src-8dea6eb551705418618e5d68bee96d521d326dc6.zip FreeBSD-src-8dea6eb551705418618e5d68bee96d521d326dc6.tar.gz |
Further pseudofs improvements:
The pfs_info mutex is only needed to lock pi_unrhdr. Everything else
in struct pfs_info is modified only while Giant is held (during
vfs_init() / vfs_uninit()); add assertions to that effect.
Simplify pfs_destroy somewhat.
Remove superfluous arguments from pfs_fileno_{alloc,free}(), and the
assertions which were added in the previous commit to ensure they were
consistent.
Assert that Giant is held while the vnode cache is initialized and
destroyed. Also assert that the cache is empty when it is destroyed.
Rename the vnode cache mutex for consistency.
Fix a long-standing bug in pfs_getattr(): it would uncritically return
the node's pn_fileno as st_ino. This would result in st_ino being 0
if the node had not previously been visited by readdir(), and also in
an incorrect st_ino for process directories and any files contained
therein. Correct this by abstracting the fileno manipulations
previously done in pfs_readdir() into a new function, pfs_fileno(),
which is used by both pfs_getattr() and pfs_readdir().
Diffstat (limited to 'sys/fs/pseudofs/pseudofs.h')
-rw-r--r-- | sys/fs/pseudofs/pseudofs.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/fs/pseudofs/pseudofs.h b/sys/fs/pseudofs/pseudofs.h index bb1efd1..4fa3311 100644 --- a/sys/fs/pseudofs/pseudofs.h +++ b/sys/fs/pseudofs/pseudofs.h @@ -165,14 +165,18 @@ typedef int (*pfs_destroy_t)(PFS_DESTROY_ARGS); /* * pfs_info: describes a pseudofs instance + * + * The pi_mutex is only used to avoid using the global subr_unit lock for + * unrhdr. The rest of struct pfs_info is only modified while Giant is + * held (during vfs_init() and vfs_uninit()). */ struct pfs_info { char pi_name[PFS_FSNAMELEN]; pfs_init_t pi_init; pfs_init_t pi_uninit; - /* members below this line aren't initialized */ + + /* members below this line are initialized at run time*/ struct pfs_node *pi_root; - /* currently, the mutex is only used to protect the bitmap */ struct mtx pi_mutex; struct unrhdr *pi_unrhdr; }; |