Changes in kernel/generic/src/cap/cap.c [ce732e74:c1f68b0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/cap/cap.c
rce732e74 rc1f68b0 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);88 86 89 87 static size_t caps_hash(const ht_link_t *item) … … 150 148 void caps_task_init(task_t *task) 151 149 { 152 mutex_initialize(&task->cap_info->lock, MUTEX_ PASSIVE);150 mutex_initialize(&task->cap_info->lock, MUTEX_RECURSIVE); 153 151 154 152 for (kobject_type_t t = 0; t < KOBJECT_TYPE_MAX; t++) … … 240 238 if (cap->state == CAP_STATE_PUBLISHED && cap->kobject->ops->reclaim && 241 239 cap->kobject->ops->reclaim(cap->kobject)) { 242 kobject_t *kobj = cap_unpublish _locked(cap->task, cap->handle,240 kobject_t *kobj = cap_unpublish(cap->task, cap->handle, 243 241 cap->kobject->type); 244 242 kobject_put(kobj); … … 320 318 } 321 319 322 static kobject_t * 323 cap_unpublish_locked(task_t *task, cap_handle_t handle, kobject_type_t type) 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) 324 333 { 325 334 kobject_t *kobj = NULL; 326 335 336 mutex_lock(&task->cap_info->lock); 327 337 cap_t *cap = cap_get(task, handle, CAP_STATE_PUBLISHED); 328 338 if (cap) { … … 335 345 } 336 346 } 337 338 return kobj;339 }340 341 /** Unpublish published capability342 *343 * The kernel object is moved out of the capability. In other words, the344 * capability's reference to the objects is handed over to the kernel object345 * pointer returned by this function. Once unpublished, the capability does not346 * 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 the351 * 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);358 347 mutex_unlock(&task->cap_info->lock); 359 348
Note:
See TracChangeset
for help on using the changeset viewer.