PERFORCE change 180706 for review

Edward Tomasz Napierala trasz at FreeBSD.org
Fri Jul 9 21:26:48 UTC 2010


http://p4web.freebsd.org/@@180706?ac=10

Change 180706 by trasz at trasz_victim on 2010/07/09 21:26:26

	Ifdef out more HRL-specific code.

Affected files ...

.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_loginclass.c#19 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_resource.c#36 edit

Differences ...

==== //depot/projects/soc2009/trasz_limits/sys/kern/kern_loginclass.c#19 (text+ko) ====

@@ -40,6 +40,8 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include "opt_hrl.h"
+
 #include <sys/param.h>
 #include <sys/eventhandler.h>
 #include <sys/kernel.h>
@@ -85,7 +87,9 @@
 
 	mtx_lock(&loginclasses_lock);
 	if (refcount_release(&lc->lc_refcount)) {
+#ifdef HRL
 		container_destroy(&lc->lc_container);
+#endif
 		LIST_REMOVE(lc, lc_next);
 		mtx_unlock(&loginclasses_lock);
 		free(lc, M_LOGINCLASS);
@@ -125,7 +129,9 @@
 	}
 
 	/* Add new loginclass. */
+#ifdef HRL
 	container_create(&newlc->lc_container);
+#endif
 	strcpy(newlc->lc_name, name);
 	refcount_init(&newlc->lc_refcount, 1);
 	LIST_INSERT_HEAD(&loginclasses, newlc, lc_next);
@@ -206,6 +212,7 @@
 	return (0);
 }
 
+#ifdef HRL
 int
 loginclass_container_foreach(int (*callback)(struct container *container,
     const struct hrl_rule *filter, void *arg3),
@@ -222,6 +229,7 @@
 
 	return (0);
 }
+#endif
 
 static void
 lc_init(void)

==== //depot/projects/soc2009/trasz_limits/sys/kern/kern_resource.c#36 (text+ko) ====

@@ -1343,7 +1343,9 @@
 			mtx_init(&uip->ui_vmsize_mtx, "ui_vmsize", NULL,
 			    MTX_DEF);
 			LIST_INSERT_HEAD(UIHASH(uid), uip, ui_hash);
+#ifdef HRL
 			container_create(&uip->ui_container);
+#endif
 		}
 	}
 	uihold(uip);
@@ -1391,7 +1393,9 @@
 	/* Prepare for suboptimal case. */
 	rw_wlock(&uihashtbl_lock);
 	if (refcount_release(&uip->ui_ref)) {
+#ifdef HRL
 		container_destroy(&uip->ui_container);
+#endif
 		LIST_REMOVE(uip, ui_hash);
 		rw_wunlock(&uihashtbl_lock);
 		if (uip->ui_sbsize != 0)
@@ -1414,6 +1418,7 @@
 	rw_wunlock(&uihashtbl_lock);
 }
 
+#ifdef HRL
 int
 ui_container_foreach(int (*callback)(struct container *container,
     const struct hrl_rule *filter, void *arg3),
@@ -1438,6 +1443,7 @@
 
 	return (0);
 }
+#endif
 
 /*
  * Find the gidinfo structure for a gid.  This structure is used to
@@ -1549,7 +1555,9 @@
 	/* Prepare for suboptimal case. */
 	rw_wlock(&gihashtbl_lock);
 	if (refcount_release(&gip->gi_ref)) {
+#ifdef HRL
 		container_destroy(&gip->gi_container);
+#endif
 		LIST_REMOVE(gip, gi_hash);
 		rw_wunlock(&gihashtbl_lock);
 		free(gip, M_GIDINFO);
@@ -1562,6 +1570,7 @@
 	rw_wunlock(&gihashtbl_lock);
 }
 
+#ifdef HRL
 int
 gi_container_foreach(int (*callback)(struct container *container,
     const struct hrl_rule *filter, void *arg3),
@@ -1586,6 +1595,7 @@
 
 	return (0);
 }
+#endif
 
 /*
  * Change the count associated with number of processes


More information about the p4-projects mailing list