From owner-p4-projects@FreeBSD.ORG Fri Jul 9 21:26:48 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D68C7106567A; Fri, 9 Jul 2010 21:26:47 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E42B1065670 for ; Fri, 9 Jul 2010 21:26:47 +0000 (UTC) (envelope-from trasz@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 60CF38FC1D for ; Fri, 9 Jul 2010 21:26:47 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o69LQlTn016934 for ; Fri, 9 Jul 2010 21:26:47 GMT (envelope-from trasz@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o69LQlak016932 for perforce@freebsd.org; Fri, 9 Jul 2010 21:26:47 GMT (envelope-from trasz@freebsd.org) Date: Fri, 9 Jul 2010 21:26:47 GMT Message-Id: <201007092126.o69LQlak016932@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to trasz@freebsd.org using -f From: Edward Tomasz Napierala To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 180706 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2010 21:26:48 -0000 http://p4web.freebsd.org/@@180706?ac=10 Change 180706 by trasz@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 __FBSDID("$FreeBSD$"); +#include "opt_hrl.h" + #include #include #include @@ -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