Lines Matching refs:rh

38 	struct rethook *rh = container_of(head, struct rethook, rcu);  in rethook_free_rcu()  local
43 node = rh->pool.head; in rethook_free_rcu()
52 if (refcount_sub_and_test(count, &rh->ref)) in rethook_free_rcu()
53 kfree(rh); in rethook_free_rcu()
64 void rethook_stop(struct rethook *rh) in rethook_stop() argument
66 rcu_assign_pointer(rh->handler, NULL); in rethook_stop()
79 void rethook_free(struct rethook *rh) in rethook_free() argument
81 rethook_stop(rh); in rethook_free()
83 call_rcu(&rh->rcu, rethook_free_rcu); in rethook_free()
86 static inline rethook_handler_t rethook_get_handler(struct rethook *rh) in rethook_get_handler() argument
88 return (rethook_handler_t)rcu_dereference_check(rh->handler, in rethook_get_handler()
103 struct rethook *rh = kzalloc(sizeof(struct rethook), GFP_KERNEL); in rethook_alloc() local
105 if (!rh || !handler) { in rethook_alloc()
106 kfree(rh); in rethook_alloc()
110 rh->data = data; in rethook_alloc()
111 rcu_assign_pointer(rh->handler, handler); in rethook_alloc()
112 rh->pool.head = NULL; in rethook_alloc()
113 refcount_set(&rh->ref, 1); in rethook_alloc()
115 return rh; in rethook_alloc()
126 void rethook_add_node(struct rethook *rh, struct rethook_node *node) in rethook_add_node() argument
128 node->rethook = rh; in rethook_add_node()
129 freelist_add(&node->freelist, &rh->pool); in rethook_add_node()
130 refcount_inc(&rh->ref); in rethook_add_node()
168 struct rethook_node *rethook_try_get(struct rethook *rh) in rethook_try_get() argument
170 rethook_handler_t handler = rethook_get_handler(rh); in rethook_try_get()
186 fn = freelist_try_get(&rh->pool); in rethook_try_get()
218 struct rethook_node *rh = NULL; in __rethook_find_ret_addr() local
227 rh = container_of(node, struct rethook_node, llist); in __rethook_find_ret_addr()
228 if (rh->ret_addr != (unsigned long)arch_rethook_trampoline) { in __rethook_find_ret_addr()
230 return rh->ret_addr; in __rethook_find_ret_addr()