Lines Matching full:rh
37 struct rethook *rh = container_of(head, struct rethook, rcu); in rethook_free_rcu() local
38 objpool_fini(&rh->pool); in rethook_free_rcu()
43 * @rh: the struct rethook to stop.
49 void rethook_stop(struct rethook *rh) in rethook_stop() argument
51 rcu_assign_pointer(rh->handler, NULL); in rethook_stop()
56 * @rh: the struct rethook to be freed.
59 * @rh::data is cleaned if needed (or, the handler can access it after
60 * calling this function.) This function will set the @rh to be freed
62 * not touch @rh after calling this.
64 void rethook_free(struct rethook *rh) in rethook_free() argument
66 rethook_stop(rh); in rethook_free()
68 call_rcu(&rh->rcu, rethook_free_rcu); in rethook_free()
85 static inline rethook_handler_t rethook_get_handler(struct rethook *rh) in rethook_get_handler() argument
87 return (rethook_handler_t)rcu_dereference_check(rh->handler, in rethook_get_handler()
106 struct rethook *rh; in rethook_alloc() local
111 rh = kzalloc(sizeof(struct rethook), GFP_KERNEL); in rethook_alloc()
112 if (!rh) in rethook_alloc()
115 rh->data = data; in rethook_alloc()
116 rcu_assign_pointer(rh->handler, handler); in rethook_alloc()
119 if (objpool_init(&rh->pool, num, size, GFP_KERNEL, rh, in rethook_alloc()
121 kfree(rh); in rethook_alloc()
124 return rh; in rethook_alloc()
130 struct rethook *rh = node->rethook; in free_rethook_node_rcu() local
132 objpool_drop(node, &rh->pool); in free_rethook_node_rcu()
156 * @rh: The struct rethook which pools the nodes.
158 * Get an unused rethook node from @rh. If the node pool is empty, this
161 struct rethook_node *rethook_try_get(struct rethook *rh) in rethook_try_get() argument
163 rethook_handler_t handler = rethook_get_handler(rh); in rethook_try_get()
165 /* Check whether @rh is going to be freed. */ in rethook_try_get()
180 return (struct rethook_node *)objpool_pop(&rh->pool); in rethook_try_get()
208 struct rethook_node *rh = NULL; in __rethook_find_ret_addr() local
217 rh = container_of(node, struct rethook_node, llist); in __rethook_find_ret_addr()
218 if (rh->ret_addr != (unsigned long)arch_rethook_trampoline) { in __rethook_find_ret_addr()
220 return rh->ret_addr; in __rethook_find_ret_addr()