summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_extattr.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1997-11-12 05:42:33 +0000
committerjulian <julian@FreeBSD.org>1997-11-12 05:42:33 +0000
commitae22df605c505c7004dbd0315e0c8a69837113ac (patch)
treec92335bedfadb094a99ac0f1f934ff8b75ad8f50 /sys/kern/vfs_extattr.c
parent88e48b4b98e11a59cad7cf68de7887e54bc94a5b (diff)
downloadFreeBSD-src-ae22df605c505c7004dbd0315e0c8a69837113ac.zip
FreeBSD-src-ae22df605c505c7004dbd0315e0c8a69837113ac.tar.gz
Reviewed by: various.
Ever since I first say the way the mount flags were used I've hated the fact that modes, and events, internal and exported, and short-term and long term flags are all thrown together. Finally it's annoyed me enough.. This patch to the entire FreeBSD tree adds a second mount flag word to the mount struct. it is not exported to userspace. I have moved some of the non exported flags over to this word. this means that we now have 8 free bits in the mount flags. There are another two that might well move over, but which I'm not sure about. The only user visible change would have been in pstat -v, except that davidg has disabled it anyhow. I'd still like to move the state flags and the 'command' flags apart from each other.. e.g. MNT_FORCE really doesn't have the same semantics as MNT_RDONLY, but that's left for another day.
Diffstat (limited to 'sys/kern/vfs_extattr.c')
-rw-r--r--sys/kern/vfs_extattr.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index 75877ed..5e1fa19 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
- * $Id: vfs_syscalls.c,v 1.79 1997/10/28 10:29:55 bde Exp $
+ * $Id: vfs_syscalls.c,v 1.80 1997/11/06 19:29:30 phk Exp $
*/
/*
@@ -110,7 +110,7 @@ mount(p, uap)
struct vnode *vp;
struct mount *mp;
struct vfsconf *vfsp;
- int error, flag = 0;
+ int error, flag = 0, flag2 = 0;
struct vattr va;
u_long fstypenum;
struct nameidata nd;
@@ -134,6 +134,7 @@ mount(p, uap)
}
mp = vp->v_mount;
flag = mp->mnt_flag;
+ flag2 = mp->mnt_kern_flag;
/*
* We only allow the filesystem to be reloaded if it
* is currently mounted read-only.
@@ -257,7 +258,7 @@ update:
if (SCARG(uap, flags) & MNT_RDONLY)
mp->mnt_flag |= MNT_RDONLY;
else if (mp->mnt_flag & MNT_RDONLY)
- mp->mnt_flag |= MNT_WANTRDWR;
+ mp->mnt_kern_flag |= MNTK_WANTRDWR;
mp->mnt_flag &=~ (MNT_NOSUID | MNT_NOEXEC | MNT_NODEV |
MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_NOATIME |
MNT_NOCLUSTERR | MNT_NOCLUSTERW);
@@ -270,12 +271,13 @@ update:
error = VFS_MOUNT(mp, SCARG(uap, path), SCARG(uap, data), &nd, p);
if (mp->mnt_flag & MNT_UPDATE) {
vrele(vp);
- if (mp->mnt_flag & MNT_WANTRDWR)
+ if (mp->mnt_kern_flag & MNTK_WANTRDWR)
mp->mnt_flag &= ~MNT_RDONLY;
- mp->mnt_flag &=~
- (MNT_UPDATE | MNT_RELOAD | MNT_FORCE | MNT_WANTRDWR);
+ mp->mnt_flag &=~ (MNT_UPDATE | MNT_RELOAD | MNT_FORCE);
+ mp->mnt_kern_flag &=~ (MNTK_WANTRDWR);
if (error)
mp->mnt_flag = flag;
+ mp->mnt_kern_flag = flag2;
vfs_unbusy(mp, p);
return (error);
}
@@ -415,7 +417,7 @@ dounmount(mp, flags, p)
int error;
simple_lock(&mountlist_slock);
- mp->mnt_flag |= MNT_UNMOUNT;
+ mp->mnt_kern_flag |= MNTK_UNMOUNT;
lockmgr(&mp->mnt_lock, LK_DRAIN | LK_INTERLOCK, &mountlist_slock, p);
if (mp->mnt_flag & MNT_EXPUBLIC)
@@ -431,7 +433,7 @@ dounmount(mp, flags, p)
error = VFS_UNMOUNT(mp, flags, p);
simple_lock(&mountlist_slock);
if (error) {
- mp->mnt_flag &= ~MNT_UNMOUNT;
+ mp->mnt_kern_flag &= ~MNTK_UNMOUNT;
lockmgr(&mp->mnt_lock, LK_RELEASE | LK_INTERLOCK | LK_REENABLE,
&mountlist_slock, p);
return (error);
@@ -445,7 +447,7 @@ dounmount(mp, flags, p)
if (mp->mnt_vnodelist.lh_first != NULL)
panic("unmount: dangling vnode");
lockmgr(&mp->mnt_lock, LK_RELEASE | LK_INTERLOCK, &mountlist_slock, p);
- if (mp->mnt_flag & MNT_MWAIT)
+ if (mp->mnt_kern_flag & MNTK_MWAIT)
wakeup((caddr_t)mp);
free((caddr_t)mp, M_MOUNT);
return (0);
OpenPOWER on IntegriCloud