Lines Matching defs:obj

14  * <obj, id> pair and a pointer value.  It is the responsibility of the
50 * @obj: pointer to parent object
57 void *obj;
63 * klp_shadow_match() - verify a shadow variable matches given <obj, id>
65 * @obj: pointer to parent object
70 static inline bool klp_shadow_match(struct klp_shadow *shadow, void *obj,
73 return shadow->obj == obj && shadow->id == id;
78 * @obj: pointer to parent object
83 void *klp_shadow_get(void *obj, unsigned long id)
90 (unsigned long)obj) {
92 if (klp_shadow_match(shadow, obj, id)) {
104 static void *__klp_shadow_get_or_alloc(void *obj, unsigned long id,
114 shadow_data = klp_shadow_get(obj, id);
127 /* Look for <obj, id> again under the lock */
129 shadow_data = klp_shadow_get(obj, id);
140 new_shadow->obj = obj;
146 err = ctor(obj, new_shadow->data, ctor_data);
151 obj, id, err);
156 /* No <obj, id> found, so attach the newly allocated one */
158 (unsigned long)new_shadow->obj);
165 WARN(1, "Duplicate shadow variable <%p, %lx>\n", obj, id);
174 * @obj: pointer to parent object
186 * If an existing <obj, id> shadow variable can be found, this routine will
196 void *klp_shadow_alloc(void *obj, unsigned long id,
200 return __klp_shadow_get_or_alloc(obj, id, size, gfp_flags,
207 * @obj: pointer to parent object
214 * Returns a pointer to existing shadow data if an <obj, id> shadow
219 * @id for the given @obj. It also guarantees that the constructor function
225 void *klp_shadow_get_or_alloc(void *obj, unsigned long id,
229 return __klp_shadow_get_or_alloc(obj, id, size, gfp_flags,
239 dtor(shadow->obj, shadow->data);
244 * klp_shadow_free() - detach and free a <obj, id> shadow variable
245 * @obj: pointer to parent object
250 * This function releases the memory for this <obj, id> shadow variable
253 void klp_shadow_free(void *obj, unsigned long id, klp_shadow_dtor_t dtor)
260 /* Delete <obj, id> from hash */
262 (unsigned long)obj) {
264 if (klp_shadow_match(shadow, obj, id)) {
293 if (klp_shadow_match(shadow, shadow->obj, id))