Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Jan 2011 12:50:58 GMT
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 187838 for review
Message-ID:  <201101151250.p0FCowKr022780@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help

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

Change 187838 by trasz@trasz_victim on 2011/01/15 12:50:18

	Use FEATURE().

Affected files ...

.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_container.c#52 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_rctl.c#8 edit
.. //depot/projects/soc2009/trasz_limits/usr.bin/userstat/userstat.sh#7 edit

Differences ...

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

@@ -62,6 +62,8 @@
 
 #ifdef CONTAINERS
 
+FEATURE(containers, "Resource Containers");
+
 static struct mtx container_lock;
 MTX_SYSINIT(container_lock, &container_lock, "container lock", MTX_DEF);
 

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

@@ -63,13 +63,15 @@
 #error "The RCTL option requires the CONTAINERS option"
 #endif
 
+FEATURE(rctl, "Resource Limits");
+
 #define	HRF_DEFAULT		0
 #define	HRF_DONT_INHERIT	1
 #define	HRF_DONT_ACCUMULATE	2
 
 /* Default buffer size for rctl_get_rules(2). */
 #define	RCTL_DEFAULT_BUFSIZE	4096
-#define	RCTL_LOG_BUFSIZE		128
+#define	RCTL_LOG_BUFSIZE	128
 
 /*
  * 'rctl_rule_link' connects a rule with every container it's related to.

==== //depot/projects/soc2009/trasz_limits/usr.bin/userstat/userstat.sh#7 (text+ko) ====

@@ -49,6 +49,12 @@
 [  "$wait" ">" 0 ] || wait="0"
 [  "$count" ">" 0 ] || count="0"
 
+sysctl kern.features.rctl > /dev/null 2>&1
+if [ $? -ne 0 ]; then
+	echo "no RCTL support in the kernel" 2>&1
+	exit 1
+fi
+
 n=0
 while :; do
 	if [ "`basename $0`" = "jailstat" ]; then



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