Index: fs/devfs/devfs.h
===================================================================
RCS file: /home/ncvs/src/sys/fs/devfs/devfs.h,v
retrieving revision 1.16
diff -u -r1.16 devfs.h
--- fs/devfs/devfs.h	16 Oct 2002 08:04:11 -0000	1.16
+++ fs/devfs/devfs.h	7 Dec 2002 03:01:04 -0000
@@ -168,7 +168,7 @@
 };
 
 struct devfs_mount {
-	struct vnode	*dm_root;	/* Root node */
+	struct mount	*dm_mount;
 	struct devfs_dirent *dm_rootdir;
 	struct devfs_dirent *dm_basedir;
 	unsigned	dm_generation;
Index: fs/devfs/devfs_devs.c
===================================================================
RCS file: /home/ncvs/src/sys/fs/devfs/devfs_devs.c,v
retrieving revision 1.22
diff -u -r1.22 devfs_devs.c
--- fs/devfs/devfs_devs.c	28 Sep 2002 21:21:01 -0000	1.22
+++ fs/devfs/devfs_devs.c	7 Dec 2002 03:01:04 -0000
@@ -334,8 +334,8 @@
 				if (de == NULL) {
 					de = devfs_vmkdir(s, q - s, dd);
 #ifdef MAC
-					mac_create_devfs_directory(s, q - s,
-					    de);
+					mac_create_devfs_directory(
+					    dm->dm_mount, s, q - s, de);
 #endif
 					de->de_inode = dm->dm_inode++;
 					TAILQ_INSERT_TAIL(&dd->de_dlist, de, de_list);
@@ -363,7 +363,7 @@
 				de->de_dirent->d_type = DT_CHR;
 			}
 #ifdef MAC
-			mac_create_devfs_device(dev, de);
+			mac_create_devfs_device(dm->dm_mount, dev, de);
 #endif
 			*dep = de;
 			de->de_dir = dd;
Index: fs/devfs/devfs_vfsops.c
===================================================================
RCS file: /home/ncvs/src/sys/fs/devfs/devfs_vfsops.c,v
retrieving revision 1.25
diff -u -r1.25 devfs_vfsops.c
--- fs/devfs/devfs_vfsops.c	16 Oct 2002 07:51:18 -0000	1.25
+++ fs/devfs/devfs_vfsops.c	7 Dec 2002 03:01:04 -0000
@@ -88,6 +88,7 @@
 #ifdef MAC
 	mp->mnt_flag |= MNT_MULTILABEL;
 #endif
+	fmp->dm_mount = mp;
 	mp->mnt_data = (qaddr_t) fmp;
 	vfs_getnewfsid(mp);
 
@@ -96,7 +97,7 @@
 	fmp->dm_rootdir = devfs_vmkdir("(root)", 6, NULL);
 	fmp->dm_rootdir->de_inode = 2;
 #ifdef MAC
-	mac_create_devfs_directory("", 0, fmp->dm_rootdir);
+	mac_create_devfs_directory(mp, "", 0, fmp->dm_rootdir);
 #endif
 	fmp->dm_basedir = fmp->dm_rootdir;
 	devfs_rules_newmount(fmp, td);
Index: fs/devfs/devfs_vnops.c
===================================================================
RCS file: /home/ncvs/src/sys/fs/devfs/devfs_vnops.c,v
retrieving revision 1.54
diff -u -r1.54 devfs_vnops.c
--- fs/devfs/devfs_vnops.c	26 Oct 2002 14:38:19 -0000	1.54
+++ fs/devfs/devfs_vnops.c	7 Dec 2002 03:01:04 -0000
@@ -832,7 +832,7 @@
 	de = vp->v_data;
 
 	mac_relabel_vnode(ap->a_cred, vp, ap->a_label);
-	mac_update_devfsdirent(de, vp);
+	mac_update_devfsdirent(vp->v_mount, de, vp);
 
 	return (0);
 }
@@ -869,7 +869,7 @@
 	bcopy(ap->a_target, de->de_symlink, i);
 	lockmgr(&dmp->dm_lock, LK_EXCLUSIVE, 0, curthread);
 #ifdef MAC
-	mac_create_devfs_symlink(ap->a_cnp->cn_cred, dd, de);
+	mac_create_devfs_symlink(ap->a_cnp->cn_cred, dmp->dm_mount, dd, de);
 #endif
 	TAILQ_INSERT_TAIL(&dd->de_dlist, de, de_list);
 	devfs_allocv(de, ap->a_dvp->v_mount, ap->a_vpp, 0);
Index: kern/kern_mac.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/kern_mac.c,v
retrieving revision 1.70
diff -u -r1.70 kern_mac.c
--- kern/kern_mac.c	26 Nov 2002 17:11:57 -0000	1.70
+++ kern/kern_mac.c	7 Dec 2002 03:01:06 -0000
@@ -1196,10 +1196,12 @@
 }
 
 void
-mac_update_devfsdirent(struct devfs_dirent *de, struct vnode *vp)
+mac_update_devfsdirent(struct mount *mp, struct devfs_dirent *de,
+    struct vnode *vp)
 {
 
-	MAC_PERFORM(update_devfsdirent, de, &de->de_label, vp, &vp->v_label);
+	MAC_PERFORM(update_devfsdirent, mp, de, &de->de_label, vp,
+	    &vp->v_label);
 }
 
 void
@@ -2801,27 +2803,27 @@
 }
 
 void
-mac_create_devfs_device(dev_t dev, struct devfs_dirent *de)
+mac_create_devfs_device(struct mount *mp, dev_t dev, struct devfs_dirent *de)
 {
 
-	MAC_PERFORM(create_devfs_device, dev, de, &de->de_label);
+	MAC_PERFORM(create_devfs_device, mp, dev, de, &de->de_label);
 }
 
 void
-mac_create_devfs_symlink(struct ucred *cred, struct devfs_dirent *dd,
-    struct devfs_dirent *de)
+mac_create_devfs_symlink(struct ucred *cred, struct mount *mp,
+    struct devfs_dirent *dd, struct devfs_dirent *de)
 {
 
-	MAC_PERFORM(create_devfs_symlink, cred, dd, &dd->de_label, de,
+	MAC_PERFORM(create_devfs_symlink, cred, mp, dd, &dd->de_label, de,
 	    &de->de_label);
 }
 
 void
-mac_create_devfs_directory(char *dirname, int dirnamelen,
+mac_create_devfs_directory(struct mount *mp, char *dirname, int dirnamelen,
     struct devfs_dirent *de)
 {
 
-	MAC_PERFORM(create_devfs_directory, dirname, dirnamelen, de,
+	MAC_PERFORM(create_devfs_directory, mp, dirname, dirnamelen, de,
 	    &de->de_label);
 }
 
Index: security/mac_biba/mac_biba.c
===================================================================
RCS file: /home/ncvs/src/sys/security/mac_biba/mac_biba.c,v
retrieving revision 1.47
diff -u -r1.47 mac_biba.c
--- security/mac_biba/mac_biba.c	12 Nov 2002 04:20:36 -0000	1.47
+++ security/mac_biba/mac_biba.c	7 Dec 2002 03:01:10 -0000
@@ -800,8 +800,8 @@
  * a lot like file system objects.
  */
 static void
-mac_biba_create_devfs_device(dev_t dev, struct devfs_dirent *devfs_dirent,
-    struct label *label)
+mac_biba_create_devfs_device(struct mount *mp, dev_t dev,
+    struct devfs_dirent *devfs_dirent, struct label *label)
 {
 	struct mac_biba *mac_biba;
 	int biba_type;
@@ -822,8 +822,8 @@
 }
 
 static void
-mac_biba_create_devfs_directory(char *dirname, int dirnamelen,
-    struct devfs_dirent *devfs_dirent, struct label *label)
+mac_biba_create_devfs_directory(struct mount *mp, char *dirname,
+    int dirnamelen, struct devfs_dirent *devfs_dirent, struct label *label)
 {
 	struct mac_biba *mac_biba;
 
@@ -832,8 +832,9 @@
 }
 
 static void
-mac_biba_create_devfs_symlink(struct ucred *cred, struct devfs_dirent *dd,
-    struct label *ddlabel, struct devfs_dirent *de, struct label *delabel)
+mac_biba_create_devfs_symlink(struct ucred *cred, struct mount *mp,
+    struct devfs_dirent *dd, struct label *ddlabel, struct devfs_dirent *de,
+    struct label *delabel)
 {
 	struct mac_biba *source, *dest;
 
@@ -882,8 +883,9 @@
 }
 
 static void
-mac_biba_update_devfsdirent(struct devfs_dirent *devfs_dirent,
-    struct label *direntlabel, struct vnode *vp, struct label *vnodelabel)
+mac_biba_update_devfsdirent(struct mount *mp,
+    struct devfs_dirent *devfs_dirent, struct label *direntlabel,
+    struct vnode *vp, struct label *vnodelabel)
 {
 	struct mac_biba *source, *dest;
 
Index: security/mac_lomac/mac_lomac.c
===================================================================
RCS file: /home/ncvs/src/sys/security/mac_lomac/mac_lomac.c,v
retrieving revision 1.4
diff -u -r1.4 mac_lomac.c
--- security/mac_lomac/mac_lomac.c	4 Dec 2002 22:01:03 -0000	1.4
+++ security/mac_lomac/mac_lomac.c	7 Dec 2002 03:01:10 -0000
@@ -943,8 +943,8 @@
  * a lot like file system objects.
  */
 static void
-mac_lomac_create_devfs_device(dev_t dev, struct devfs_dirent *devfs_dirent,
-    struct label *label)
+mac_lomac_create_devfs_device(struct mount *mp, dev_t dev,
+    struct devfs_dirent *devfs_dirent, struct label *label)
 {
 	struct mac_lomac *mac_lomac;
 	int lomac_type;
@@ -966,8 +966,8 @@
 }
 
 static void
-mac_lomac_create_devfs_directory(char *dirname, int dirnamelen,
-    struct devfs_dirent *devfs_dirent, struct label *label)
+mac_lomac_create_devfs_directory(struct mount *mp, char *dirname,
+    int dirnamelen, struct devfs_dirent *devfs_dirent, struct label *label)
 {
 	struct mac_lomac *mac_lomac;
 
@@ -976,8 +976,9 @@
 }
 
 static void
-mac_lomac_create_devfs_symlink(struct ucred *cred, struct devfs_dirent *dd,
-    struct label *ddlabel, struct devfs_dirent *de, struct label *delabel)
+mac_lomac_create_devfs_symlink(struct ucred *cred, struct mount *mp,
+    struct devfs_dirent *dd, struct label *ddlabel, struct devfs_dirent *de,
+    struct label *delabel)
 {
 	struct mac_lomac *source, *dest;
 
@@ -1026,8 +1027,9 @@
 }
 
 static void
-mac_lomac_update_devfsdirent(struct devfs_dirent *devfs_dirent,
-    struct label *direntlabel, struct vnode *vp, struct label *vnodelabel)
+mac_lomac_update_devfsdirent(struct mount *mp,
+    struct devfs_dirent *devfs_dirent, struct label *direntlabel,
+    struct vnode *vp, struct label *vnodelabel)
 {
 	struct mac_lomac *source, *dest;
 
Index: security/mac_mls/mac_mls.c
===================================================================
RCS file: /home/ncvs/src/sys/security/mac_mls/mac_mls.c,v
retrieving revision 1.35
diff -u -r1.35 mac_mls.c
--- security/mac_mls/mac_mls.c	12 Nov 2002 04:20:36 -0000	1.35
+++ security/mac_mls/mac_mls.c	7 Dec 2002 03:01:10 -0000
@@ -766,8 +766,8 @@
  * a lot like file system objects.
  */
 static void
-mac_mls_create_devfs_device(dev_t dev, struct devfs_dirent *devfs_dirent,
-    struct label *label)
+mac_mls_create_devfs_device(struct mount *mp, dev_t dev,
+    struct devfs_dirent *devfs_dirent, struct label *label)
 {
 	struct mac_mls *mac_mls;
 	int mls_type;
@@ -791,8 +791,8 @@
 }
 
 static void
-mac_mls_create_devfs_directory(char *dirname, int dirnamelen,
-    struct devfs_dirent *devfs_dirent, struct label *label)
+mac_mls_create_devfs_directory(struct mount *mp, char *dirname,
+    int dirnamelen, struct devfs_dirent *devfs_dirent, struct label *label)
 {
 	struct mac_mls *mac_mls;
 
@@ -801,8 +801,9 @@
 }
 
 static void
-mac_mls_create_devfs_symlink(struct ucred *cred, struct devfs_dirent *dd,
-    struct label *ddlabel, struct devfs_dirent *de, struct label *delabel)
+mac_mls_create_devfs_symlink(struct ucred *cred, struct mount *mp,
+    struct devfs_dirent *dd, struct label *ddlabel, struct devfs_dirent *de,
+    struct label *delabel)
 {
 	struct mac_mls *source, *dest;
 
@@ -851,8 +852,9 @@
 }
 
 static void
-mac_mls_update_devfsdirent(struct devfs_dirent *devfs_dirent,
-    struct label *direntlabel, struct vnode *vp, struct label *vnodelabel)
+mac_mls_update_devfsdirent(struct mount *mp,
+    struct devfs_dirent *devfs_dirent, struct label *direntlabel,
+    struct vnode *vp, struct label *vnodelabel)
 {
 	struct mac_mls *source, *dest;
 
Index: security/mac_none/mac_none.c
===================================================================
RCS file: /home/ncvs/src/sys/security/mac_none/mac_none.c,v
retrieving revision 1.23
diff -u -r1.23 mac_none.c
--- security/mac_none/mac_none.c	12 Nov 2002 04:20:36 -0000	1.23
+++ security/mac_none/mac_none.c	7 Dec 2002 03:01:10 -0000
@@ -169,22 +169,23 @@
 }
 
 static void
-mac_none_create_devfs_device(dev_t dev, struct devfs_dirent *devfs_dirent,
-    struct label *label)
+mac_none_create_devfs_device(struct mount *mp, dev_t dev,
+    struct devfs_dirent *devfs_dirent, struct label *label)
 {
 
 }
 
 static void
-mac_none_create_devfs_directory(char *dirname, int dirnamelen,
-    struct devfs_dirent *devfs_dirent, struct label *label)
+mac_none_create_devfs_directory(struct mount *mp, char *dirname,
+    int dirnamelen, struct devfs_dirent *devfs_dirent, struct label *label)
 {
 
 }
 
 static void
-mac_none_create_devfs_symlink(struct ucred *cred, struct devfs_dirent *dd,
-    struct label *ddlabel, struct devfs_dirent *de, struct label *delabel)
+mac_none_create_devfs_symlink(struct ucred *cred, struct mount *mp,
+    struct devfs_dirent *dd, struct label *ddlabel, struct devfs_dirent *de,
+    struct label *delabel)
 {
 
 }
@@ -228,8 +229,9 @@
 }
 
 static void
-mac_none_update_devfsdirent(struct devfs_dirent *devfs_dirent,
-    struct label *direntlabel, struct vnode *vp, struct label *vnodelabel)
+mac_none_update_devfsdirent(struct mount *mp,
+    struct devfs_dirent *devfs_dirent, struct label *direntlabel,
+    struct vnode *vp, struct label *vnodelabel)
 {
 
 }
Index: security/mac_test/mac_test.c
===================================================================
RCS file: /home/ncvs/src/sys/security/mac_test/mac_test.c,v
retrieving revision 1.20
diff -u -r1.20 mac_test.c
--- security/mac_test/mac_test.c	12 Nov 2002 04:20:36 -0000	1.20
+++ security/mac_test/mac_test.c	7 Dec 2002 03:01:10 -0000
@@ -518,22 +518,23 @@
 }
 
 static void
-mac_test_create_devfs_device(dev_t dev, struct devfs_dirent *devfs_dirent,
-    struct label *label)
+mac_test_create_devfs_device(struct mount *mp, dev_t dev,
+    struct devfs_dirent *devfs_dirent, struct label *label)
 {
 
 }
 
 static void
-mac_test_create_devfs_directory(char *dirname, int dirnamelen,
-    struct devfs_dirent *devfs_dirent, struct label *label)
+mac_test_create_devfs_directory(struct mount *mp, char *dirname,
+    int dirnamelen, struct devfs_dirent *devfs_dirent, struct label *label)
 {
 
 }
 
 static void
-mac_test_create_devfs_symlink(struct ucred *cred, struct devfs_dirent *dd,
-    struct label *ddlabel, struct devfs_dirent *de, struct label *delabel)
+mac_test_create_devfs_symlink(struct ucred *cred, struct mount *mp,
+    struct devfs_dirent *dd, struct label *ddlabel, struct devfs_dirent *de,
+    struct label *delabel)
 {
 
 }
@@ -577,8 +578,9 @@
 }
 
 static void
-mac_test_update_devfsdirent(struct devfs_dirent *devfs_dirent,
-    struct label *direntlabel, struct vnode *vp, struct label *vnodelabel)
+mac_test_update_devfsdirent(struct mount *mp,
+    struct devfs_dirent *devfs_dirent, struct label *direntlabel,
+    struct vnode *vp, struct label *vnodelabel)
 {
 
 }
Index: sys/mac.h
===================================================================
RCS file: /home/ncvs/src/sys/sys/mac.h,v
retrieving revision 1.33
diff -u -r1.33 mac.h
--- sys/mac.h	26 Nov 2002 17:11:57 -0000	1.33
+++ sys/mac.h	7 Dec 2002 03:01:10 -0000
@@ -171,18 +171,20 @@
 	    struct vnode *vp);
 int	mac_associate_vnode_extattr(struct mount *mp, struct vnode *vp);
 void	mac_associate_vnode_singlelabel(struct mount *mp, struct vnode *vp);
-void	mac_create_devfs_device(dev_t dev, struct devfs_dirent *de);
-void	mac_create_devfs_directory(char *dirname, int dirnamelen,
-	    struct devfs_dirent *de);
-void	mac_create_devfs_symlink(struct ucred *cred, struct devfs_dirent *dd,
+void	mac_create_devfs_device(struct mount *mp, dev_t dev,
 	    struct devfs_dirent *de);
+void	mac_create_devfs_directory(struct mount *mp, char *dirname,
+	    int dirnamelen, struct devfs_dirent *de);
+void	mac_create_devfs_symlink(struct ucred *cred, struct mount *mp,
+	    struct devfs_dirent *dd, struct devfs_dirent *de);
 int	mac_create_vnode_extattr(struct ucred *cred, struct mount *mp,
 	    struct vnode *dvp, struct vnode *vp, struct componentname *cnp);
 void	mac_create_mount(struct ucred *cred, struct mount *mp);
 void	mac_create_root_mount(struct ucred *cred, struct mount *mp);
 void	mac_relabel_vnode(struct ucred *cred, struct vnode *vp,
 	    struct label *newlabel);
-void	mac_update_devfsdirent(struct devfs_dirent *de, struct vnode *vp);
+void	mac_update_devfsdirent(struct mount *mp, struct devfs_dirent *de,
+	    struct vnode *vp);
 
 /*
  * Labeling event operations: IPC objects.
Index: sys/mac_policy.h
===================================================================
RCS file: /home/ncvs/src/sys/sys/mac_policy.h,v
retrieving revision 1.33
diff -u -r1.33 mac_policy.h
--- sys/mac_policy.h	20 Nov 2002 15:41:25 -0000	1.33
+++ sys/mac_policy.h	7 Dec 2002 03:01:11 -0000
@@ -142,13 +142,15 @@
 	void	(*mpo_associate_vnode_singlelabel)(struct mount *mp,
 		    struct label *fslabel, struct vnode *vp,
 		    struct label *vlabel);
-	void	(*mpo_create_devfs_device)(dev_t dev, struct devfs_dirent *de,
-		    struct label *label);
-	void	(*mpo_create_devfs_directory)(char *dirname, int dirnamelen,
+	void	(*mpo_create_devfs_device)(struct mount *mp, dev_t dev,
 		    struct devfs_dirent *de, struct label *label);
+	void	(*mpo_create_devfs_directory)(struct mount *mp, char *dirname,
+		    int dirnamelen, struct devfs_dirent *de,
+		    struct label *label);
 	void	(*mpo_create_devfs_symlink)(struct ucred *cred,
-		    struct devfs_dirent *dd, struct label *ddlabel,
-		    struct devfs_dirent *de, struct label *delabel);
+		    struct mount *mp, struct devfs_dirent *dd,
+		    struct label *ddlabel, struct devfs_dirent *de,
+		    struct label *delabel);
 	int	(*mpo_create_vnode_extattr)(struct ucred *cred,
 		    struct mount *mp, struct label *fslabel,
 		    struct vnode *dvp, struct label *dlabel,
@@ -163,7 +165,8 @@
 	int	(*mpo_setlabel_vnode_extattr)(struct ucred *cred,
 		    struct vnode *vp, struct label *vlabel,
 		    struct label *intlabel);
-	void	(*mpo_update_devfsdirent)(struct devfs_dirent *devfs_dirent,
+	void	(*mpo_update_devfsdirent)(struct mount *mp,
+		    struct devfs_dirent *devfs_dirent,
 		    struct label *direntlabel, struct vnode *vp,
 		    struct label *vnodelabel);
 
