PERFORCE change 165431 for review

Edward Tomasz Napierala trasz at FreeBSD.org
Mon Jun 29 19:15:27 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=165431

Change 165431 by trasz at trasz_victim on 2009/06/29 19:15:05

	s/accounting/usage/g.

Affected files ...

.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_hrl.c#20 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_jail.c#6 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_prot.c#12 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_resource.c#10 edit
.. //depot/projects/soc2009/trasz_limits/sys/sys/hrl.h#15 edit
.. //depot/projects/soc2009/trasz_limits/sys/sys/jail.h#5 edit
.. //depot/projects/soc2009/trasz_limits/sys/sys/proc.h#6 edit
.. //depot/projects/soc2009/trasz_limits/sys/sys/resourcevar.h#6 edit
.. //depot/projects/soc2009/trasz_limits/usr.sbin/hrl/hrl.c#11 edit

Differences ...

==== //depot/projects/soc2009/trasz_limits/sys/kern/kern_hrl.c#20 (text+ko) ====

@@ -156,7 +156,7 @@
 
 #ifdef INVARIANTS
 /*
- * Go through the accounting info and verify that it makes sense.
+ * Go through the resource usage info and verify that it makes sense.
  */
 static void
 hrl_assert_proc(const struct proc *p __unused)
@@ -169,13 +169,13 @@
 	cred = p->p_ucred;
 	mtx_assert(&hrl_lock, MA_OWNED);
 	for (resource = 0; resource < HRL_RESOURCE_MAX; resource++)
-		KASSERT(p->p_accounting.ha_resources[resource] >= 0, ("resource usage propagation meltdown"));
-	KASSERT(cred->cr_ruidinfo->ui_accounting.ha_resources[resource] >= 0, ("resource usage propagation meltdown"));
+		KASSERT(p->p_usage.hu_resources[resource] >= 0, ("resource usage propagation meltdown"));
+	KASSERT(cred->cr_ruidinfo->ui_usage.hu_resources[resource] >= 0, ("resource usage propagation meltdown"));
 	for (pr = cred->cr_prison; pr != NULL; pr = pr->pr_parent)
-		KASSERT(pr->pr_accounting.ha_resources[resource] >= 0, ("resource usage propagation meltdown"));
+		KASSERT(pr->pr_usage.hu_resources[resource] >= 0, ("resource usage propagation meltdown"));
 	for (i = 0; i < cred->cr_ngroups; i++) {
 		for (resource = 0; resource < HRL_RESOURCE_MAX; resource++)
-			KASSERT(cred->cr_gidinfos[i]->gi_accounting.ha_resources[resource] >= 0, ("resource usage propagation meltdown"));
+			KASSERT(cred->cr_gidinfos[i]->gi_usage.hu_resources[resource] >= 0, ("resource usage propagation meltdown"));
 	}
 #endif
 }
@@ -194,8 +194,8 @@
 
 	mtx_lock(&hrl_lock);
 	for (i = 0; i < HRL_RESOURCE_MAX; i++) {
-		if (p->p_accounting.ha_resources[i] != 0)
-			KASSERT(p->p_accounting.ha_resources == 0,
+		if (p->p_usage.hu_resources[i] != 0)
+			KASSERT(p->p_usage.hu_resources == 0,
 			    ("dead process still holding resources"));
 	}
 	mtx_unlock(&hrl_lock);
@@ -233,8 +233,8 @@
 
 	mtx_lock(&hrl_lock);
 	for (i = 0; i < HRL_RESOURCE_MAX; i++) {
-		if (parent->p_accounting.ha_resources[i] != 0 && hrl_resource_inheritable(i))
-			hrl_allocated_proc(child, i, parent->p_accounting.ha_resources[i]);
+		if (parent->p_usage.hu_resources[i] != 0 && hrl_resource_inheritable(i))
+			hrl_allocated_proc(child, i, parent->p_usage.hu_resources[i]);
 	}
 	mtx_unlock(&hrl_lock);
 }
@@ -254,13 +254,13 @@
 	    hrl_resource_name(resource), amount));
 
 	mtx_lock(&hrl_lock);
-	p->p_accounting.ha_resources[resource] += amount;
+	p->p_usage.hu_resources[resource] += amount;
 	cred = p->p_ucred;
-	cred->cr_ruidinfo->ui_accounting.ha_resources[resource] += amount;
+	cred->cr_ruidinfo->ui_usage.hu_resources[resource] += amount;
 	if (cred->cr_ruidinfo != cred->cr_uidinfo)
-		cred->cr_uidinfo->ui_accounting.ha_resources[resource] += amount;
+		cred->cr_uidinfo->ui_usage.hu_resources[resource] += amount;
 	for (pr = cred->cr_prison; pr != NULL; pr = pr->pr_parent)
-		pr->pr_accounting.ha_resources[resource] += amount;
+		pr->pr_usage.hu_resources[resource] += amount;
 	/*
 	 * XXX: Slow.
 	 */
@@ -273,7 +273,7 @@
 			if (cred->cr_groups[i] == cred->cr_groups[j])
 				goto skip_group;
 		}
-		cred->cr_gidinfos[i]->gi_accounting.ha_resources[resource] += amount;
+		cred->cr_gidinfos[i]->gi_usage.hu_resources[resource] += amount;
 skip_group:
 		continue;
 	}
@@ -312,14 +312,14 @@
 	    hrl_resource_name(resource), amount));
 
 	mtx_lock(&hrl_lock);
-	diff = amount - p->p_accounting.ha_resources[resource];
-	p->p_accounting.ha_resources[resource] = amount;
+	diff = amount - p->p_usage.hu_resources[resource];
+	p->p_usage.hu_resources[resource] = amount;
 	cred = p->p_ucred;
-	cred->cr_ruidinfo->ui_accounting.ha_resources[resource] += diff;
+	cred->cr_ruidinfo->ui_usage.hu_resources[resource] += diff;
 	if (cred->cr_ruidinfo != cred->cr_uidinfo)
-		cred->cr_uidinfo->ui_accounting.ha_resources[resource] += diff;
+		cred->cr_uidinfo->ui_usage.hu_resources[resource] += diff;
 	for (pr = cred->cr_prison; pr != NULL; pr = pr->pr_parent)
-		pr->pr_accounting.ha_resources[resource] += diff;
+		pr->pr_usage.hu_resources[resource] += diff;
 	/*
 	 * XXX: Slow.
 	 */
@@ -332,7 +332,7 @@
 			if (cred->cr_groups[i] == cred->cr_groups[j])
 				goto skip_group;
 		}
-		cred->cr_gidinfos[i]->gi_accounting.ha_resources[resource] += diff;
+		cred->cr_gidinfos[i]->gi_usage.hu_resources[resource] += diff;
 skip_group:
 		continue;
 	}
@@ -358,19 +358,19 @@
 	    hrl_resource_name(resource), amount));
 
 	mtx_lock(&hrl_lock);
-	p->p_accounting.ha_resources[resource] -= amount;
+	p->p_usage.hu_resources[resource] -= amount;
 #ifdef notyet
-	KASSERT(amount <= p->p_accounting.ha_resources[resource],
+	KASSERT(amount <= p->p_usage.hu_resources[resource],
 	    ("hrl_free_proc: freeing %lld, which is more than allocated %lld "
-	    "for %s", amount, p->p_accounting.ha_resources[resource],
+	    "for %s", amount, p->p_usage.hu_resources[resource],
 	    hrl_resource_name(resource)));
 #endif
 	cred = p->p_ucred;
-	cred->cr_ruidinfo->ui_accounting.ha_resources[resource] -= amount;
+	cred->cr_ruidinfo->ui_usage.hu_resources[resource] -= amount;
 	if (cred->cr_ruidinfo != cred->cr_uidinfo)
-		cred->cr_uidinfo->ui_accounting.ha_resources[resource] -= amount;
+		cred->cr_uidinfo->ui_usage.hu_resources[resource] -= amount;
 	for (pr = cred->cr_prison; pr != NULL; pr = pr->pr_parent)
-		pr->pr_accounting.ha_resources[resource] -= amount;
+		pr->pr_usage.hu_resources[resource] -= amount;
 	/*
 	 * XXX: Slow.
 	 */
@@ -383,7 +383,7 @@
 			if (cred->cr_groups[i] == cred->cr_groups[j])
 				goto skip_group;
 		}
-		cred->cr_gidinfos[i]->gi_accounting.ha_resources[resource] -= amount;
+		cred->cr_gidinfos[i]->gi_usage.hu_resources[resource] -= amount;
 skip_group:
 		continue;
 	}
@@ -456,39 +456,39 @@
 }
 
 void
-hrl_acc_add(struct hrl_acc *dest, const struct hrl_acc *src)
+hrl_usage_add(struct hrl_usage *dest, const struct hrl_usage *src)
 {
 	int i;
 
 	mtx_lock(&hrl_lock);
 	for (i = 0; i < HRL_RESOURCE_MAX; i++) {
 #ifdef notyet
-		KASSERT(dest->ha_resources[i] >= 0, ("resource usage propagation meltdown"));
-		KASSERT(src->ha_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->ha_resources[i] += src->ha_resources[i];
+		dest->hu_resources[i] += src->hu_resources[i];
 #ifdef notyet
-		KASSERT(dest->ha_resources[i] >= 0, ("resource usage propagation meltdown"));
+		KASSERT(dest->hu_resources[i] >= 0, ("resource usage propagation meltdown"));
 #endif
 	}
 	mtx_unlock(&hrl_lock);
 }
 
 void
-hrl_acc_subtract(struct hrl_acc *dest, const struct hrl_acc *src)
+hrl_usage_subtract(struct hrl_usage *dest, const struct hrl_usage *src)
 {
 	int i;
 
 	mtx_lock(&hrl_lock);
 	for (i = 0; i < HRL_RESOURCE_MAX; i++) {
 #ifdef notyet
-		KASSERT(dest->ha_resources[i] >= 0, ("resource usage propagation meltdown"));
-		KASSERT(src->ha_resources[i] >= 0, ("resource usage propagation meltdown"));
-		KASSERT(src->ha_resources[i] <= dest->ha_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->ha_resources[i] -= src->ha_resources[i];
+		dest->hu_resources[i] -= src->hu_resources[i];
 #ifdef notyet
-		KASSERT(dest->ha_resources[i] >= 0, ("resource usage propagation meltdown"));
+		KASSERT(dest->hu_resources[i] >= 0, ("resource usage propagation meltdown"));
 #endif
 	}
 	mtx_unlock(&hrl_lock);
@@ -793,7 +793,7 @@
 }
 
 static int
-hrl_get_acc_pid(struct thread *td, char *inputstr, void *bufp, size_t buflen)
+hrl_get_usage_pid(struct thread *td, char *inputstr, void *bufp, size_t buflen)
 {
 	int error;
 	id_t pid;
@@ -806,14 +806,14 @@
 		if ((p = zpfind(pid)) == NULL)
 			return (ESRCH);
 	}
-	error = copyout(&p->p_accounting, bufp, sizeof(p->p_accounting));
+	error = copyout(&p->p_usage, bufp, sizeof(p->p_usage));
 	PROC_UNLOCK(p);
 
 	return (error);
 }
 
 static int
-hrl_get_acc_uid(struct thread *td, char *inputstr, void *bufp, size_t buflen)
+hrl_get_usage_uid(struct thread *td, char *inputstr, void *bufp, size_t buflen)
 {
 	int error;
 	id_t uid;
@@ -825,14 +825,14 @@
 	uip = uifind_existing(uid);
 	if (uip == NULL)
 		return (ESRCH);
-	error = copyout(&uip->ui_accounting, bufp, sizeof(uip->ui_accounting));
+	error = copyout(&uip->ui_usage, bufp, sizeof(uip->ui_usage));
 	uifree(uip);
 
 	return (error);
 }
 
 static int
-hrl_get_acc_gid(struct thread *td, char *inputstr, void *bufp, size_t buflen)
+hrl_get_usage_gid(struct thread *td, char *inputstr, void *bufp, size_t buflen)
 {
 	int error;
 	id_t gid;
@@ -844,14 +844,14 @@
 	gip = gifind_existing(gid);
 	if (gip == NULL)
 		return (ESRCH);
-	error = copyout(&gip->gi_accounting, bufp, sizeof(gip->gi_accounting));
+	error = copyout(&gip->gi_usage, bufp, sizeof(gip->gi_usage));
 	gifree(gip);
 
 	return (error);
 }
 
 static int
-hrl_get_acc_jid(struct thread *td, char *inputstr, void *bufp, size_t buflen)
+hrl_get_usage_jid(struct thread *td, char *inputstr, void *bufp, size_t buflen)
 {
 	int error;
 	id_t jid;
@@ -867,7 +867,7 @@
 		sx_xunlock(&allprison_lock);
 		return (ENOENT);
 	}
-	error = copyout(&pr->pr_accounting, bufp, sizeof(pr->pr_accounting));
+	error = copyout(&pr->pr_usage, bufp, sizeof(pr->pr_usage));
 	prison_free(pr);
 	sx_xunlock(&allprison_lock);
 
@@ -900,17 +900,17 @@
 	case HRL_OP_REMOVE_RULE:
 		error = hrl_remove_rule(td, inputstr);
 		break;
-	case HRL_OP_GET_ACC_PID:
-		error = hrl_get_acc_pid(td, inputstr, uap->outbufp, uap->outbuflen);
+	case HRL_OP_GET_USAGE_PID:
+		error = hrl_get_usage_pid(td, inputstr, uap->outbufp, uap->outbuflen);
 		break;
-	case HRL_OP_GET_ACC_UID:
-		error = hrl_get_acc_uid(td, inputstr, uap->outbufp, uap->outbuflen);
+	case HRL_OP_GET_USAGE_UID:
+		error = hrl_get_usage_uid(td, inputstr, uap->outbufp, uap->outbuflen);
 		break;
-	case HRL_OP_GET_ACC_GID:
-		error = hrl_get_acc_gid(td, inputstr, uap->outbufp, uap->outbuflen);
+	case HRL_OP_GET_USAGE_GID:
+		error = hrl_get_usage_gid(td, inputstr, uap->outbufp, uap->outbuflen);
 		break;
-	case HRL_OP_GET_ACC_JAILID:
-		error = hrl_get_acc_jid(td, inputstr, uap->outbufp, uap->outbuflen);
+	case HRL_OP_GET_USAGE_JAILID:
+		error = hrl_get_usage_jid(td, inputstr, uap->outbufp, uap->outbuflen);
 		break;
 	default:
 		error = EINVAL;
@@ -936,7 +936,7 @@
 
 	uip = p->p_ucred->cr_ruidinfo;
 	for (i = 0; i < HRL_RESOURCE_MAX + 1; i++)
-		uip->ui_accounting.ha_resources[i] -= p->p_accounting.ha_resources[i];
+		uip->ui_usage.hu_resources[i] -= p->p_usage.hu_resources[i];
 
 	/*
 	 * Remove temporary rules created via setrlimit(2).

==== //depot/projects/soc2009/trasz_limits/sys/kern/kern_jail.c#6 (text+ko) ====

@@ -2448,9 +2448,9 @@
 			cpuset_rel(pr->pr_cpuset);
 		osd_jail_exit(pr);
 		for (i = 0; i < HRL_RESOURCE_MAX; i++) {
-			if (pr->pr_accounting.ha_resources[i] != 0)
+			if (pr->pr_usage.hu_resources[i] != 0)
 				printf("prison_deref: resource %d = %lld\n",
-				    i, pr->pr_accounting.ha_resources[i]);
+				    i, pr->pr_usage.hu_resources[i]);
 		}
 		free(pr, M_PRISON);
 

==== //depot/projects/soc2009/trasz_limits/sys/kern/kern_prot.c#12 (text+ko) ====

@@ -2047,8 +2047,8 @@
 	newuip = newcred->cr_uidinfo;
 	olduip = p->p_ucred->cr_uidinfo;
 	if (newuip != olduip) {
-		hrl_acc_subtract(&olduip->ui_accounting, &p->p_accounting);
-		hrl_acc_add(&newuip->ui_accounting, &p->p_accounting);
+		hrl_usage_subtract(&olduip->ui_usage, &p->p_usage);
+		hrl_usage_add(&newuip->ui_usage, &p->p_usage);
 	}
 
 	/*
@@ -2057,17 +2057,17 @@
 	newuip = newcred->cr_ruidinfo;
 	olduip = p->p_ucred->cr_ruidinfo;
 	if (newuip != olduip) {
-		hrl_acc_subtract(&olduip->ui_accounting, &p->p_accounting);
-		hrl_acc_add(&newuip->ui_accounting, &p->p_accounting);
+		hrl_usage_subtract(&olduip->ui_usage, &p->p_usage);
+		hrl_usage_add(&newuip->ui_usage, &p->p_usage);
 	}
 
 	/*
 	 * Fix up per-group resource consumption.
 	 */
 	for (i = 0; i < p->p_ucred->cr_ngroups; i++)
-		hrl_acc_subtract(&p->p_ucred->cr_gidinfos[i]->gi_accounting, &p->p_accounting);
+		hrl_usage_subtract(&p->p_ucred->cr_gidinfos[i]->gi_usage, &p->p_usage);
 	for (i = 0; i < newcred->cr_ngroups; i++)
-		hrl_acc_add(&newcred->cr_gidinfos[i]->gi_accounting, &p->p_accounting);
+		hrl_usage_add(&newcred->cr_gidinfos[i]->gi_usage, &p->p_usage);
 
 	p->p_ucred = newcred;
 }

==== //depot/projects/soc2009/trasz_limits/sys/kern/kern_resource.c#10 (text+ko) ====

@@ -1371,10 +1371,10 @@
 			printf("freeing uidinfo: uid = %d, proccnt = %ld\n",
 			    uip->ui_uid, uip->ui_proccnt);
 		for (i = 0; i < HRL_RESOURCE_MAX; i++) {
-			if (uip->ui_accounting.ha_resources[i] != 0)
+			if (uip->ui_usage.hu_resources[i] != 0)
 				printf("uifree: freeing uidinfo: uid = %d, "
 				    "resource %d = %lld \n", uip->ui_uid, i,
-				    uip->ui_accounting.ha_resources[i]);
+				    uip->ui_usage.hu_resources[i]);
 		}
 		free(uip, M_UIDINFO);
 		return;
@@ -1516,10 +1516,10 @@
 		LIST_REMOVE(gip, gi_hash);
 		rw_wunlock(&gihashtbl_lock);
 		for (i = 0; i < HRL_RESOURCE_MAX; i++) {
-			if (gip->gi_accounting.ha_resources[i] != 0)
+			if (gip->gi_usage.hu_resources[i] != 0)
 				printf("gifree: freeing gidinfo: gid = %d, "
 				    "resource %d = %lld \n", gip->gi_gid, i,
-				    gip->gi_accounting.ha_resources[i]);
+				    gip->gi_usage.hu_resources[i]);
 		}
 		free(gip, M_GIDINFO);
 		return;

==== //depot/projects/soc2009/trasz_limits/sys/sys/hrl.h#15 (text+ko) ====

@@ -98,17 +98,17 @@
 #define	HRL_OP_GET_RULES		1
 #define	HRL_OP_ADD_RULE			6
 #define	HRL_OP_REMOVE_RULE		7
-#define	HRL_OP_GET_ACC_PID		2
-#define	HRL_OP_GET_ACC_UID		3
-#define	HRL_OP_GET_ACC_GID		4
-#define	HRL_OP_GET_ACC_JAILID		5
+#define	HRL_OP_GET_USAGE_PID		2
+#define	HRL_OP_GET_USAGE_UID		3
+#define	HRL_OP_GET_USAGE_GID		4
+#define	HRL_OP_GET_USAGE_JAILID		5
 
 /*
- * 'hrl_acc' defines resource consumption for a particular
+ * 'hrl_usage' defines resource consumption for a particular
  * object, such as process or user.
  */
-struct hrl_acc {
-	int64_t	ha_resources[HRL_RESOURCE_MAX + 1];
+struct hrl_usage {
+	int64_t	hu_resources[HRL_RESOURCE_MAX + 1];
 };
 
 #ifdef _KERNEL
@@ -123,8 +123,8 @@
 void	hrl_free_proc(struct proc *p, int object, uint64_t amount);
 
 void	hrl_adjust(int subject, id_t subject_id, int per, int resource, int action, int64_t amount);
-void	hrl_acc_add(struct hrl_acc *dest, const struct hrl_acc *src);
-void	hrl_acc_subtract(struct hrl_acc *dest, const struct hrl_acc *src);
+void	hrl_usage_add(struct hrl_usage *dest, const struct hrl_usage *src);
+void	hrl_usage_subtract(struct hrl_usage *dest, const struct hrl_usage *src);
 void	hrl_proc_exiting(struct proc *p);
 void	hrl_proc_fork(struct proc *parent, struct proc *child);
 

==== //depot/projects/soc2009/trasz_limits/sys/sys/jail.h#5 (text+ko) ====

@@ -174,7 +174,7 @@
 	char		 pr_hostuuid[HOSTUUIDLEN];	/* (p) jail hostuuid */
 	unsigned long	 pr_hostid;			/* (p) jail hostid */
 	struct vnet	*pr_vnet;			/* (c) network stack */
-	struct hrl_acc	 pr_accounting;			/* (*) HRL resource accounting */
+	struct hrl_usage pr_usage;			/* (*) HRL resource accounting */
 };
 #endif /* _KERNEL || _WANT_PRISON */
 

==== //depot/projects/soc2009/trasz_limits/sys/sys/proc.h#6 (text+ko) ====

@@ -514,7 +514,7 @@
 	int		p_boundary_count;/* (c) Num threads at user boundary */
 	int		p_pendingcnt;	/* how many signals are pending */
 	struct itimers	*p_itimers;	/* (c) POSIX interval timers. */
-	struct hrl_acc	p_accounting;	/* (*) HRL resource accounting */
+	struct hrl_usage p_usage;	/* (*) HRL resource accounting */
 /* End area that is zeroed on creation. */
 #define	p_endzero	p_magic
 

==== //depot/projects/soc2009/trasz_limits/sys/sys/resourcevar.h#6 (text+ko) ====

@@ -95,7 +95,7 @@
 	long	ui_ptscnt;		/* (b) number of pseudo-terminals */
 	uid_t	ui_uid;			/* (a) uid */
 	u_int	ui_ref;			/* (b) reference count */
-	struct hrl_acc	ui_accounting;	/* (*) HRL resource accounting */
+	struct hrl_usage ui_usage;	/* (*) HRL resource accounting */
 };
 
 /*
@@ -110,7 +110,7 @@
 	LIST_ENTRY(gidinfo) gi_hash;	/* (c) hash chain of gidinfos */
 	gid_t	gi_gid;			/* (a) gid */
 	u_int	gi_ref;			/* (b) reference count */
-	struct hrl_acc	gi_accounting;	/* (*) HRL resource accounting */
+	struct hrl_usage gi_usage;	/* (*) HRL resource accounting */
 };
 
 struct proc;

==== //depot/projects/soc2009/trasz_limits/usr.sbin/hrl/hrl.c#11 (text+ko) ====

@@ -105,8 +105,8 @@
 	case HRL_RESOURCE_MAXPROCESSES:
 		printf("maxprocesses");
 		break;
-	case HRL_RESOURCE_OPENFILES:
-		printf("openfiles");
+	case HRL_RESOURCE_FILEDESCRIPTORS:
+		printf("filedescriptors");
 		break;
 	case HRL_RESOURCE_SBSIZE:
 		printf("sbsize");
@@ -293,17 +293,17 @@
 }
 
 static void
-print_accounting(int op, id_t id)
+print_usage(int op, id_t id)
 {
 	int error, i;
-	struct hrl_acc acc;
+	struct hrl_usage usage;
 	char *str;
 
 	asprintf(&str, "%d", (int)id);
 	if (str == NULL)
 		err(1, "asprintf");
 
-	error = hrl(op, str, strlen(str) + 1, &acc, sizeof(acc));
+	error = hrl(op, str, strlen(str) + 1, &usage, sizeof(usage));
 	if (error)
 		err(1, "hrl");
 
@@ -312,7 +312,7 @@
 	for (i = 1; i < HRL_RESOURCE_MAX + 1; i++) {
 		print_resource(i);
 		printf("=");
-		printf("%jd\n", acc.ha_resources[i]);
+		printf("%jd\n", usage.hu_resources[i]);
 	}
 }
 
@@ -386,17 +386,17 @@
 			break;
 		case 'g':
 			gflag = 1;
-			op = HRL_OP_GET_ACC_GID;
+			op = HRL_OP_GET_USAGE_GID;
 			id = parse_group(optarg);
 			break;
 		case 'j':
 			jflag = 1;
-			op = HRL_OP_GET_ACC_JAILID;
+			op = HRL_OP_GET_USAGE_JAILID;
 			id = parse_group(optarg);
 			break;
 		case 'p':
 			pflag = 1;
-			op = HRL_OP_GET_ACC_PID;
+			op = HRL_OP_GET_USAGE_PID;
 			id = parse_pid(optarg);
 			break;
 		case 'r':
@@ -406,7 +406,7 @@
 			break;
 		case 'u':
 			uflag = 1;
-			op = HRL_OP_GET_ACC_UID;
+			op = HRL_OP_GET_USAGE_UID;
 			id = parse_user(optarg);
 			break;
 		case '?':
@@ -433,11 +433,11 @@
 		print_rules(rule);
 		break;
 
-	case HRL_OP_GET_ACC_PID:
-	case HRL_OP_GET_ACC_UID:
-	case HRL_OP_GET_ACC_GID:
-	case HRL_OP_GET_ACC_JAILID:
-		print_accounting(op, id);
+	case HRL_OP_GET_USAGE_PID:
+	case HRL_OP_GET_USAGE_UID:
+	case HRL_OP_GET_USAGE_GID:
+	case HRL_OP_GET_USAGE_JAILID:
+		print_usage(op, id);
 		break;
 
 	case HRL_OP_ADD_RULE:


More information about the p4-projects mailing list