Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Nov 2014 08:25:45 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r274911 - in head/sys: kern sys
Message-ID:  <201411230825.sAN8PjYs021389@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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_ */



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