/* * The caller must own the object (i.e. thanks to object->usage) to safely put * it.
*/ void landlock_put_object(struct landlock_object *const object)
{ /* * The call to @object->underops->release(object) might sleep, e.g. * because of iput().
*/
might_sleep(); if (!object) return;
/* * If the @object's refcount cannot drop to zero, we can just decrement * the refcount without holding a lock. Otherwise, the decrement must * happen under @object->lock for synchronization with things like * get_inode_object().
*/ if (refcount_dec_and_lock(&object->usage, &object->lock)) {
__acquire(&object->lock); /* * With @object->lock initially held, remove the reference from * @object->underobj to @object (if it still exists).
*/
object->underops->release(object);
kfree_rcu(object, rcu_free);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.