From e955c1f2367288f5e7047e33c48ad55ad58a9c80 Mon Sep 17 00:00:00 2001
From: Dan Born <dborn@google.com>
Date: Tue, 20 Dec 2016 13:48:11 -0800
Subject: [PATCH] Method to expose the resource quota of a resource user

---
 src/core/lib/iomgr/resource_quota.c | 5 +++++
 src/core/lib/iomgr/resource_quota.h | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/src/core/lib/iomgr/resource_quota.c b/src/core/lib/iomgr/resource_quota.c
index 213d29600c..74c6c3e0fb 100644
--- a/src/core/lib/iomgr/resource_quota.c
+++ b/src/core/lib/iomgr/resource_quota.c
@@ -695,6 +695,11 @@ grpc_resource_user *grpc_resource_user_create(
   return resource_user;
 }
 
+grpc_resource_quota *grpc_resource_user_quota(
+    grpc_resource_user *resource_user) {
+  return resource_user->resource_quota;
+}
+
 static void ru_ref_by(grpc_resource_user *resource_user, gpr_atm amount) {
   GPR_ASSERT(amount > 0);
   GPR_ASSERT(gpr_atm_no_barrier_fetch_add(&resource_user->refs, amount) != 0);
diff --git a/src/core/lib/iomgr/resource_quota.h b/src/core/lib/iomgr/resource_quota.h
index 0181fd978b..14475c864e 100644
--- a/src/core/lib/iomgr/resource_quota.h
+++ b/src/core/lib/iomgr/resource_quota.h
@@ -88,6 +88,8 @@ typedef struct grpc_resource_user grpc_resource_user;
 
 grpc_resource_user *grpc_resource_user_create(
     grpc_resource_quota *resource_quota, const char *name);
+grpc_resource_quota *grpc_resource_user_quota(
+    grpc_resource_user *resource_user);
 void grpc_resource_user_ref(grpc_resource_user *resource_user);
 void grpc_resource_user_unref(grpc_exec_ctx *exec_ctx,
                               grpc_resource_user *resource_user);
-- 
GitLab