Changes in kernel/generic/src/cap/cap.c [c1f68b0:ce732e74] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/cap/cap.c
rc1f68b0 rce732e74 84 84 85 85 static slab_cache_t *cap_slab; 86 87 static kobject_t *cap_unpublish_locked(task_t *, cap_handle_t, kobject_type_t); 86 88 87 89 static size_t caps_hash(const ht_link_t *item) … … 148 150 void caps_task_init(task_t *task) 149 151 { 150 mutex_initialize(&task->cap_info->lock, MUTEX_ RECURSIVE);152 mutex_initialize(&task->cap_info->lock, MUTEX_PASSIVE); 151 153 152 154 for (kobject_type_t t = 0; t < KOBJECT_TYPE_MAX; t++) … … 238 240 if (cap->state == CAP_STATE_PUBLISHED && cap->kobject->ops->reclaim && 239 241 cap->kobject->ops->reclaim(cap->kobject)) { 240 kobject_t *kobj = cap_unpublish (cap->task, cap->handle,242 kobject_t *kobj = cap_unpublish_locked(cap->task, cap->handle, 241 243 cap->kobject->type); 242 244 kobject_put(kobj); … … 318 320 } 319 321 320 /** Unpublish published capability 321 * 322 * The kernel object is moved out of the capability. In other words, the 323 * capability's reference to the objects is handed over to the kernel object 324 * pointer returned by this function. Once unpublished, the capability does not 325 * refer to any kernel object anymore. 326 * 327 * @param task Task in which to unpublish the capability. 328 * @param handle Capability handle. 329 * @param type Kernel object type of the object associated with the 330 * capability. 331 */ 332 kobject_t *cap_unpublish(task_t *task, cap_handle_t handle, kobject_type_t type) 322 static kobject_t * 323 cap_unpublish_locked(task_t *task, cap_handle_t handle, kobject_type_t type) 333 324 { 334 325 kobject_t *kobj = NULL; 335 326 336 mutex_lock(&task->cap_info->lock);337 327 cap_t *cap = cap_get(task, handle, CAP_STATE_PUBLISHED); 338 328 if (cap) { … … 345 335 } 346 336 } 337 338 return kobj; 339 } 340 341 /** Unpublish published capability 342 * 343 * The kernel object is moved out of the capability. In other words, the 344 * capability's reference to the objects is handed over to the kernel object 345 * pointer returned by this function. Once unpublished, the capability does not 346 * refer to any kernel object anymore. 347 * 348 * @param task Task in which to unpublish the capability. 349 * @param handle Capability handle. 350 * @param type Kernel object type of the object associated with the 351 * capability. 352 */ 353 kobject_t *cap_unpublish(task_t *task, cap_handle_t handle, kobject_type_t type) 354 { 355 356 mutex_lock(&task->cap_info->lock); 357 kobject_t *kobj = cap_unpublish_locked(task, handle, type); 347 358 mutex_unlock(&task->cap_info->lock); 348 359
Note:
See TracChangeset
for help on using the changeset viewer.