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.
This commit is contained in:
Mateusz Guzik 2014-11-23 08:25:44 +00:00
parent dbfd8ef2e4
commit dff9862c0e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=274911
3 changed files with 8 additions and 9 deletions

View File

@ -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 racct *racct,
}
rw_runlock(&uihashtbl_lock);
}
#endif
/*
* Change the count associated with number of processes

View File

@ -220,15 +220,8 @@ racct_get_available(struct proc *p, int resource)
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)

View File

@ -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_ */