Changeset 455241b in mainline for kernel/generic/src/cap/cap.c
- Timestamp:
- 2025-01-16T19:29:20Z (27 hours ago)
- Children:
- 6caf5fb
- Parents:
- df721df
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2025-01-16 19:23:14)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2025-01-16 19:29:20)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/cap/cap.c
rdf721df r455241b 97 97 98 98 static slab_cache_t *cap_cache; 99 static slab_cache_t *kobject_cache;100 99 101 100 kobject_ops_t *kobject_ops[KOBJECT_TYPE_MAX] = { … … 156 155 cap_cache = slab_cache_create("cap_t", sizeof(cap_t), 0, NULL, 157 156 NULL, 0); 158 kobject_cache = slab_cache_create("kobject_t", sizeof(kobject_t), 0,159 NULL, NULL, 0);160 157 } 161 158 … … 463 460 } 464 461 465 kobject_t *kobject_alloc(unsigned int flags)466 {467 return slab_alloc(kobject_cache, flags);468 }469 470 void kobject_free(kobject_t *kobj)471 {472 slab_free(kobject_cache, kobj);473 }474 475 462 /** Initialize kernel object 476 463 * 477 464 * @param kobj Kernel object to initialize. 478 465 * @param type Type of the kernel object. 479 * @param raw Raw pointer to the encapsulated object. 480 */ 481 void kobject_initialize(kobject_t *kobj, kobject_type_t type, void *raw) 466 */ 467 void kobject_initialize(kobject_t *kobj, kobject_type_t type) 482 468 { 483 469 refcount_init(&kobj->refcnt); … … 487 473 488 474 kobj->type = type; 489 kobj->raw = raw;490 475 } 491 476 … … 537 522 { 538 523 if (refcount_down(&kobj->refcnt)) { 539 KOBJECT_OP(kobj)->destroy(kobj->raw); 540 kobject_free(kobj); 524 KOBJECT_OP(kobj)->destroy(kobj); 541 525 } 542 526 }
Note:
See TracChangeset
for help on using the changeset viewer.