Commit dfde6e0d authored by Ondřej Surý's avatar Ondřej Surý
Browse files

Backport isc_quota_getused() function

parent 880dfa27
......@@ -114,6 +114,12 @@ isc_quota_detach(isc_quota_t **p);
* quota.
*/
unsigned int
isc_quota_getused(isc_quota_t *quota);
/*%<
* Get the current usage of quota.
*/
ISC_LANG_ENDDECLS
#endif /* ISC_QUOTA_H */
......@@ -111,3 +111,13 @@ isc_quota_detach(isc_quota_t **p) {
isc_quota_release(*p);
*p = NULL;
}
unsigned int
isc_quota_getused(isc_quota_t *quota) {
int used;
LOCK(&quota->lock);
used = quota->used;
UNLOCK(&quota->lock);
return (used);
}
......@@ -520,6 +520,7 @@ isc_quota_attach
isc_quota_destroy
isc_quota_detach
isc_quota_force
isc_quota_getused
isc_quota_init
isc_quota_max
isc_quota_release
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment