From owner-svn-src-all@FreeBSD.ORG Sun Nov 23 08:25:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 088E6463; Sun, 23 Nov 2014 08:25:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF30985E; Sun, 23 Nov 2014 08:25:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAN8PjaM021394; Sun, 23 Nov 2014 08:25:45 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAN8PjYs021389; Sun, 23 Nov 2014 08:25:45 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201411230825.sAN8PjYs021389@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 23 Nov 2014 08:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274911 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Nov 2014 08:25:46 -0000 Author: mjg Date: Sun Nov 23 08:25:44 2014 New Revision: 274911 URL: https://svnweb.freebsd.org/changeset/base/274911 Log: ifdef RACCT ui_racct_foreach and struct uidinfo's ui_racct Change racct_ create and destroy to macros evaluating to nothing without RACCT so that their callers passing ui_racct don't have to be ifdefed. Modified: head/sys/kern/kern_resource.c head/sys/sys/racct.h head/sys/sys/resourcevar.h Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Sun Nov 23 08:17:46 2014 (r274910) +++ head/sys/kern/kern_resource.c Sun Nov 23 08:25:44 2014 (r274911) @@ -1334,6 +1334,7 @@ uifree(struct uidinfo *uip) free(uip, M_UIDINFO); } +#ifdef RACCT void ui_racct_foreach(void (*callback)(struct racct *racct, void *arg2, void *arg3), void *arg2, void *arg3) @@ -1349,6 +1350,7 @@ ui_racct_foreach(void (*callback)(struct } rw_runlock(&uihashtbl_lock); } +#endif /* * Change the count associated with number of processes Modified: head/sys/sys/racct.h ============================================================================== --- head/sys/sys/racct.h Sun Nov 23 08:17:46 2014 (r274910) +++ head/sys/sys/racct.h Sun Nov 23 08:25:44 2014 (r274911) @@ -220,15 +220,8 @@ racct_get_available(struct proc *p, int return (UINT64_MAX); } -static inline void -racct_create(struct racct **racctp) -{ -} - -static inline void -racct_destroy(struct racct **racctp) -{ -} +#define racct_create(x) +#define racct_destroy(x) static inline int racct_proc_fork(struct proc *parent, struct proc *child) Modified: head/sys/sys/resourcevar.h ============================================================================== --- head/sys/sys/resourcevar.h Sun Nov 23 08:17:46 2014 (r274910) +++ head/sys/sys/resourcevar.h Sun Nov 23 08:25:44 2014 (r274911) @@ -102,7 +102,9 @@ struct uidinfo { long ui_kqcnt; /* (b) number of kqueues */ uid_t ui_uid; /* (a) uid */ u_int ui_ref; /* (b) reference count */ +#ifdef RACCT struct racct *ui_racct; /* (a) resource accounting */ +#endif }; #define UIDINFO_VMSIZE_LOCK(ui) mtx_lock(&((ui)->ui_vmsize_mtx)) @@ -148,8 +150,10 @@ struct uidinfo void uifree(struct uidinfo *uip); void uihashinit(void); void uihold(struct uidinfo *uip); +#ifdef RACCT void ui_racct_foreach(void (*callback)(struct racct *racct, void *arg2, void *arg3), void *arg2, void *arg3); +#endif #endif /* _KERNEL */ #endif /* !_SYS_RESOURCEVAR_H_ */