PERFORCE change 167183 for review
Edward Tomasz Napierala
trasz at FreeBSD.org
Mon Aug 10 18:25:38 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=167183
Change 167183 by trasz at trasz_anger on 2009/08/10 18:25:06
Style fixes.
Affected files ...
.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_hrl.c#53 edit
Differences ...
==== //depot/projects/soc2009/trasz_limits/sys/kern/kern_hrl.c#53 (text+ko) ====
@@ -62,7 +62,8 @@
int hrl_group_accounting = 0;
TUNABLE_INT("kern.hrl_group_accounting", &hrl_group_accounting);
-SYSCTL_INT(_kern, OID_AUTO, hrl_group_accounting, CTLFLAG_RD, &hrl_group_accounting, 0, "");
+SYSCTL_INT(_kern, OID_AUTO, hrl_group_accounting, CTLFLAG_RD,
+ &hrl_group_accounting, 0, "");
struct dict {
const char *d_name;
@@ -387,9 +388,9 @@
sbuf_new(&sb, buf, HRL_LOG_BUFSIZE, SBUF_FIXEDLEN);
hrl_rule_to_sbuf(&sb, rule);
sbuf_finish(&sb);
- printf("resource limit \"%s\" exceeded by process %d (%s), "
- "uid %d\n", sbuf_data(&sb), p->p_pid, p->p_comm,
- p->p_ucred->cr_uid);
+ printf("resource limit \"%s\" exceeded by process %d "
+ "(%s), uid %d\n", sbuf_data(&sb), p->p_pid,
+ p->p_comm, p->p_ucred->cr_uid);
sbuf_delete(&sb);
free(buf, M_HRL);
break;
@@ -496,14 +497,15 @@
if (hrl_group_accounting) {
for (i = 0; i < cred->cr_ngroups; i++) {
/*
- * Make sure we don't account a group more than once if it appears
- * in cr_groups[] more than once.
+ * Make sure we don't account a group more than once
+ * if it appears in cr_groups[] more than once.
*/
for (j = 0; j < i; j++) {
if (cred->cr_groups[i] == cred->cr_groups[j])
goto skip_group;
}
- cred->cr_gidinfos[i]->gi_usage.hu_resources[resource] += amount;
+ cred->cr_gidinfos[i]->gi_usage.hu_resources[resource] +=
+ amount;
skip_group:
continue;
}
@@ -558,14 +560,15 @@
if (hrl_group_accounting) {
for (i = 0; i < cred->cr_ngroups; i++) {
/*
- * Make sure we don't account a group more than once if it appears
- * in cr_groups[] more than once.
+ * Make sure we don't account a group more than once
+ * if it appears in cr_groups[] more than once.
*/
for (j = 0; j < i; j++) {
if (cred->cr_groups[i] == cred->cr_groups[j])
goto skip_group;
}
- cred->cr_gidinfos[i]->gi_usage.hu_resources[resource] += diff;
+ cred->cr_gidinfos[i]->gi_usage.hu_resources[resource] +=
+ diff;
skip_group:
continue;
}
@@ -598,9 +601,9 @@
mtx_lock(&hrl_lock);
#ifdef notyet
KASSERT(amount <= p->p_usage.hu_resources[resource],
- ("hrl_free_proc: freeing %lld of %s, which is more than allocated %lld "
- "for %s (pid %d)", amount, hrl_resource_name(resource), p->p_usage.hu_resources[resource],
- p->p_comm, p->p_pid));
+ ("hrl_free_proc: freeing %lld of %s, which is more than allocated "
+ "%lld for %s (pid %d)", amount, hrl_resource_name(resource),
+ p->p_usage.hu_resources[resource], p->p_comm, p->p_pid));
#endif
p->p_usage.hu_resources[resource] -= amount;
cred = p->p_ucred;
@@ -613,14 +616,15 @@
if (hrl_group_accounting) {
for (i = 0; i < cred->cr_ngroups; i++) {
/*
- * Make sure we don't account a group more than once if it appears
- * in cr_groups[] more than once.
+ * Make sure we don't account a group more than once
+ * if it appears in cr_groups[] more than once.
*/
for (j = 0; j < i; j++) {
if (cred->cr_groups[i] == cred->cr_groups[j])
goto skip_group;
}
- cred->cr_gidinfos[i]->gi_usage.hu_resources[resource] -= amount;
+ cred->cr_gidinfos[i]->gi_usage.hu_resources[resource] -=
+ amount;
skip_group:
continue;
}
@@ -658,12 +662,15 @@
mtx_lock(&hrl_lock);
for (i = 0; i < HRL_RESOURCE_MAX; i++) {
#ifdef notyet
- KASSERT(dest->hu_resources[i] >= 0, ("resource usage propagation meltdown"));
- KASSERT(src->hu_resources[i] >= 0, ("resource usage propagation meltdown"));
+ KASSERT(dest->hu_resources[i] >= 0,
+ ("resource usage propagation meltdown"));
+ KASSERT(src->hu_resources[i] >= 0,
+ ("resource usage propagation meltdown"));
#endif
dest->hu_resources[i] += src->hu_resources[i];
#ifdef notyet
- KASSERT(dest->hu_resources[i] >= 0, ("resource usage propagation meltdown"));
+ KASSERT(dest->hu_resources[i] >= 0,
+ ("resource usage propagation meltdown"));
#endif
}
mtx_unlock(&hrl_lock);
@@ -677,13 +684,17 @@
mtx_lock(&hrl_lock);
for (i = 0; i < HRL_RESOURCE_MAX; i++) {
#ifdef notyet
- KASSERT(dest->hu_resources[i] >= 0, ("resource usage propagation meltdown"));
- KASSERT(src->hu_resources[i] >= 0, ("resource usage propagation meltdown"));
- KASSERT(src->hu_resources[i] <= dest->hu_resources[i], ("resource usage propagation meltdown"));
+ KASSERT(dest->hu_resources[i] >= 0,
+ ("resource usage propagation meltdown"));
+ KASSERT(src->hu_resources[i] >= 0,
+ ("resource usage propagation meltdown"));
+ KASSERT(src->hu_resources[i] <= dest->hu_resources[i],
+ ("resource usage propagation meltdown"));
#endif
dest->hu_resources[i] -= src->hu_resources[i];
#ifdef notyet
- KASSERT(dest->hu_resources[i] >= 0, ("resource usage propagation meltdown"));
+ KASSERT(dest->hu_resources[i] >= 0,
+ ("resource usage propagation meltdown"));
#endif
}
mtx_unlock(&hrl_lock);
@@ -1171,11 +1182,14 @@
return (ESRCH);
}
- error = loginclass_limits_foreach(hrl_rule_remove_callback, filter, (void *)&found);
+ error = loginclass_limits_foreach(hrl_rule_remove_callback, filter,
+ (void *)&found);
KASSERT(error == 0, ("loginclass_limits_foreach failed"));
- error = ui_limits_foreach(hrl_rule_remove_callback, filter, (void *)&found);
+ error = ui_limits_foreach(hrl_rule_remove_callback, filter,
+ (void *)&found);
KASSERT(error == 0, ("ui_limits_foreach failed"));
- error = gi_limits_foreach(hrl_rule_remove_callback, filter, (void *)&found);
+ error = gi_limits_foreach(hrl_rule_remove_callback, filter,
+ (void *)&found);
KASSERT(error == 0, ("gi_limits_foreach failed"));
sx_slock(&proctree_lock);
@@ -1365,16 +1379,20 @@
switch (filter->hr_subject) {
case HRL_SUBJECT_PROCESS:
- error = hrl_get_usage_pid(td, filter->hr_subject_id, &outputsbuf);
+ error = hrl_get_usage_pid(td, filter->hr_subject_id,
+ &outputsbuf);
break;
case HRL_SUBJECT_USER:
- error = hrl_get_usage_uid(td, filter->hr_subject_id, &outputsbuf);
+ error = hrl_get_usage_uid(td, filter->hr_subject_id,
+ &outputsbuf);
break;
case HRL_SUBJECT_GROUP:
- error = hrl_get_usage_gid(td, filter->hr_subject_id, &outputsbuf);
+ error = hrl_get_usage_gid(td, filter->hr_subject_id,
+ &outputsbuf);
break;
case HRL_SUBJECT_JAIL:
- error = hrl_get_usage_jid(td, filter->hr_subject_id, &outputsbuf);
+ error = hrl_get_usage_jid(td, filter->hr_subject_id,
+ &outputsbuf);
break;
default:
error = EINVAL;
@@ -1389,7 +1407,8 @@
}
static int
-hrl_get_rules_callback(struct hrl_limits_head *limits, const struct hrl_rule *filter, void *arg3)
+hrl_get_rules_callback(struct hrl_limits_head *limits,
+ const struct hrl_rule *filter, void *arg3)
{
struct hrl_limit *limit;
struct sbuf *sb = (struct sbuf *)arg3;
More information about the p4-projects
mailing list