Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Jul 2002 20:01:53 -0700 (PDT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 14491 for review
Message-ID:  <200207200301.g6K31rJ5002206@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=14491

Change 14491 by rwatson@rwatson_curry on 2002/07/19 20:01:43

	Possible naming consistency improvements.

Affected files ...

.. //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#173 edit
.. //depot/projects/trustedbsd/mac/sys/sys/mac.h#110 edit
.. //depot/projects/trustedbsd/mac/sys/sys/mac_policy.h#71 edit
.. //depot/projects/trustedbsd/mac/sys/ufs/ufs/ufs_vnops.c#39 edit

Differences ...

==== //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#173 (text+ko) ====

@@ -142,7 +142,8 @@
 static int	mac_policy_register(struct mac_policy_conf *mpc);
 static int	mac_policy_unregister(struct mac_policy_conf *mpc);
 
-static int	mac_create_extattr_from_vnode(struct vnode *vp);
+static int	mac_stdcreatevnode_ea(struct vnode *vp);
+
 
 /*
  * mac_policy_list_lock protects the consistency of 'mac_policy_list',
@@ -328,8 +329,8 @@
 			mpc->mpc_ops.mpo_create_devfs_vnode =
 			    mpe->mpe_function;
 			break;
-		case MAC_CREATE_EXTATTR_FROM_VNODE:
-			mpc->mpc_ops.mpo_create_extattr_from_vnode =
+		case MAC_STDCREATEVNODE_EA:
+			mpc->mpc_ops.mpo_stdcreatevnode_ea =
 			    mpe->mpe_function;
 			break;
 		case MAC_CREATE_VNODE_FROM_VNODE:
@@ -1063,7 +1064,7 @@
  * commit of the label to disk (etc), do cache the label.
  */
 int
-mac_stdcreatevnode_ea(struct vnode *dvp, struct vnode *tvp, struct ucred *cred)
+vop_stdcreatevnode_ea(struct vnode *dvp, struct vnode *tvp, struct ucred *cred)
 {
 	struct mac extmac;
 	int error;
@@ -1084,10 +1085,14 @@
 		 */
 		mac_create_vnode_from_vnode(cred, dvp, tvp);
 
-		error = mac_create_extattr_from_vnode(tvp);
+		error = mac_stdcreatevnode_ea(tvp);
 		if (error)
 			return (error);
 
+		/*
+		 * XXX: Eventually this will go away and all policies will
+		 * directly manage their extended attributes.
+		 */
 		error = mac_externalize(&tvp->v_label, &extmac);
 		if (error)
 			return (error);
@@ -2254,11 +2259,11 @@
 }
 
 static int
-mac_create_extattr_from_vnode(struct vnode *vp)
+mac_stdcreatevnode_ea(struct vnode *vp)
 {
 	int error;
 
-	MAC_CHECK(create_extattr_from_vnode, vp, &vp->v_label);
+	MAC_CHECK(stdcreatevnode_ea, vp, &vp->v_label);
 
 	return (error);
 }

==== //depot/projects/trustedbsd/mac/sys/sys/mac.h#110 (text+ko) ====

@@ -353,7 +353,7 @@
 /* Calls to help various file systems implement labeling using EAs. */
 struct vop_refreshlabel_args;
 struct vop_setlabel_args;
-int	mac_stdcreatevnode_ea(struct vnode *dvp, struct vnode *tvp,
+int	vop_stdcreatevnode_ea(struct vnode *dvp, struct vnode *tvp,
 	    struct ucred *cred);
 int	vop_stdrefreshlabel_ea(struct vop_refreshlabel_args *ap);
 int	vop_stdsetlabel_ea(struct vop_setlabel_args *ap);

==== //depot/projects/trustedbsd/mac/sys/sys/mac_policy.h#71 (text+ko) ====

@@ -119,10 +119,10 @@
 	void	(*mpo_create_root_mount)(struct ucred *cred,
 		    struct mount *mp, struct label *mountlabel,
 		    struct label *fslabel);
-	int	(*mpo_create_extattr_from_vnode)(struct vnode *vp,
-		    struct label *vnodelabel);
 	void	(*mpo_relabel_vnode)(struct ucred *cred, struct vnode *vp,
 		    struct label *vnodelabel, struct label *label);
+	int	(*mpo_stdcreatevnode_ea)(struct vnode *vp,
+		    struct label *vnodelabel);
 	void	(*mpo_update_devfsdirent_from_vnode)(
 		    struct devfs_dirent *devfs_dirent,
 		    struct label *direntlabel, struct vnode *vp,
@@ -346,8 +346,8 @@
 	MAC_CREATE_VNODE_FROM_VNODE,
 	MAC_CREATE_MOUNT,
 	MAC_CREATE_ROOT_MOUNT,
-	MAC_CREATE_EXTATTR_FROM_VNODE,
 	MAC_RELABEL_VNODE,
+	MAC_STDCREATEVNODE_EA,
 	MAC_UPDATE_DEVFSDIRENT_FROM_VNODE,
 	MAC_UPDATE_PROCFSVNODE_FROM_SUBJECT,
 	MAC_UPDATE_VNODE_FROM_EXTATTR,

==== //depot/projects/trustedbsd/mac/sys/ufs/ufs/ufs_vnops.c#39 (text+ko) ====

@@ -1533,7 +1533,7 @@
 		goto bad;
 
 #ifdef MAC
-	error = mac_stdcreatevnode_ea(dvp, tvp, cnp->cn_cred);
+	error = vop_stdcreatevnode_ea(dvp, tvp, cnp->cn_cred);
 	if (error)
 		goto bad;
 #endif
@@ -2445,7 +2445,7 @@
 	if (error)
 		goto bad;
 #ifdef MAC
-	error = mac_stdcreatevnode_ea(dvp, tvp, cnp->cn_cred);
+	error = vop_stdcreatevnode_ea(dvp, tvp, cnp->cn_cred);
 	if (error)
 		goto bad;
 #endif

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200207200301.g6K31rJ5002206>