- Fix a leftover - vfs_mount_alloc() is now exported properly.

This fixes stange panics when listing .zfs/snapshot/ directory for me.
  Reported by:	simokawa
  Reported by:	Johan Hendriks <Johan@double-l.nl>
- Hide cache_purge() under FREEBSD_NAMECACHE like in other files.
- Protect mnt_flag with mount interlock.
This commit is contained in:
Pawel Jakub Dawidek 2007-04-17 21:16:34 +00:00
parent 7760d8409f
commit a1bcf4dc7b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=168824
2 changed files with 10 additions and 8 deletions

View File

@ -153,9 +153,6 @@ traverse(vnode_t **cvpp)
return (error);
}
extern struct mount *vfs_mount_alloc(struct vnode *vp, struct vfsconf *vfsp,
const char *fspath, struct thread *td);
int
domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath,
char *fspec, int fsflags)
@ -205,10 +202,12 @@ domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath,
/*
* Set the mount level flags.
*/
MNT_ILOCK(mp);
if (fsflags & MNT_RDONLY)
mp->mnt_flag |= MNT_RDONLY;
mp->mnt_flag &=~ MNT_UPDATEMASK;
mp->mnt_flag |= fsflags & (MNT_UPDATEMASK | MNT_FORCE | MNT_ROOTFS);
MNT_IUNLOCK(mp);
/*
* Mount the filesystem.
* XXX The final recipients of VFS_MOUNT just overwrite the ndp they
@ -231,7 +230,9 @@ domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath,
/*
* Put the new filesystem on the mount list after root.
*/
// cache_purge(vp);
#ifdef FREEBSD_NAMECACHE
cache_purge(vp);
#endif
if (!error) {
vnode_t *mvp;

View File

@ -153,9 +153,6 @@ traverse(vnode_t **cvpp)
return (error);
}
extern struct mount *vfs_mount_alloc(struct vnode *vp, struct vfsconf *vfsp,
const char *fspath, struct thread *td);
int
domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath,
char *fspec, int fsflags)
@ -205,10 +202,12 @@ domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath,
/*
* Set the mount level flags.
*/
MNT_ILOCK(mp);
if (fsflags & MNT_RDONLY)
mp->mnt_flag |= MNT_RDONLY;
mp->mnt_flag &=~ MNT_UPDATEMASK;
mp->mnt_flag |= fsflags & (MNT_UPDATEMASK | MNT_FORCE | MNT_ROOTFS);
MNT_IUNLOCK(mp);
/*
* Mount the filesystem.
* XXX The final recipients of VFS_MOUNT just overwrite the ndp they
@ -231,7 +230,9 @@ domount(kthread_t *td, vnode_t *vp, const char *fstype, char *fspath,
/*
* Put the new filesystem on the mount list after root.
*/
// cache_purge(vp);
#ifdef FREEBSD_NAMECACHE
cache_purge(vp);
#endif
if (!error) {
vnode_t *mvp;