Lines Matching refs:cg

72 static struct rdma_cgroup *parent_rdmacg(struct rdma_cgroup *cg)  in parent_rdmacg()  argument
74 return css_rdmacg(cg->css.parent); in parent_rdmacg()
113 find_cg_rpool_locked(struct rdma_cgroup *cg, in find_cg_rpool_locked() argument
121 list_for_each_entry(pool, &cg->rpools, cg_node) in find_cg_rpool_locked()
129 get_cg_rpool_locked(struct rdma_cgroup *cg, struct rdmacg_device *device) in get_cg_rpool_locked() argument
133 rpool = find_cg_rpool_locked(cg, device); in get_cg_rpool_locked()
146 list_add_tail(&rpool->cg_node, &cg->rpools); in get_cg_rpool_locked()
162 uncharge_cg_locked(struct rdma_cgroup *cg, in uncharge_cg_locked() argument
168 rpool = find_cg_rpool_locked(cg, device); in uncharge_cg_locked()
176 pr_warn("Invalid device %p or rdma cgroup %p\n", cg, device); in uncharge_cg_locked()
206 static void rdmacg_uncharge_hierarchy(struct rdma_cgroup *cg, in rdmacg_uncharge_hierarchy() argument
215 for (p = cg; p != stop_cg; p = parent_rdmacg(p)) in rdmacg_uncharge_hierarchy()
220 css_put(&cg->css); in rdmacg_uncharge_hierarchy()
229 void rdmacg_uncharge(struct rdma_cgroup *cg, in rdmacg_uncharge() argument
236 rdmacg_uncharge_hierarchy(cg, device, NULL, index); in rdmacg_uncharge()
265 struct rdma_cgroup *cg, *p; in rdmacg_try_charge() local
277 cg = get_current_rdmacg(); in rdmacg_try_charge()
280 for (p = cg; p; p = parent_rdmacg(p)) { in rdmacg_try_charge()
298 *rdmacg = cg; in rdmacg_try_charge()
303 rdmacg_uncharge_hierarchy(cg, device, p, index); in rdmacg_try_charge()
430 struct rdma_cgroup *cg = css_rdmacg(of_css(of)); in rdmacg_resource_set_max() local
465 rpool = get_cg_rpool_locked(cg, device); in rdmacg_resource_set_max()
530 struct rdma_cgroup *cg = css_rdmacg(seq_css(sf)); in rdmacg_resource_read() local
537 rpool = find_cg_rpool_locked(cg, device); in rdmacg_resource_read()
567 struct rdma_cgroup *cg; in rdmacg_css_alloc() local
569 cg = kzalloc(sizeof(*cg), GFP_KERNEL); in rdmacg_css_alloc()
570 if (!cg) in rdmacg_css_alloc()
573 INIT_LIST_HEAD(&cg->rpools); in rdmacg_css_alloc()
574 return &cg->css; in rdmacg_css_alloc()
579 struct rdma_cgroup *cg = css_rdmacg(css); in rdmacg_css_free() local
581 kfree(cg); in rdmacg_css_free()
595 struct rdma_cgroup *cg = css_rdmacg(css); in rdmacg_css_offline() local
600 list_for_each_entry(rpool, &cg->rpools, cg_node) in rdmacg_css_offline()