X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/39236c6e673c41db228275375ab7fdb0f837b292..c18c124eaa464aaaa5549e99e5a70fc9cbb50944:/bsd/kern/kern_lockf.c diff --git a/bsd/kern/kern_lockf.c b/bsd/kern/kern_lockf.c index 2b5f0906a..3bbf77a45 100644 --- a/bsd/kern/kern_lockf.c +++ b/bsd/kern/kern_lockf.c @@ -606,13 +606,15 @@ lf_setlock(struct lockf *lock, struct timespec *timeout) /* Check if current task can donate importance. The * check of imp_donor bit is done without holding - * task lock. The value may change after you read it, + * any lock. The value may change after you read it, * but it is ok to boost a task while someone else is * unboosting you. + * + * TODO: Support live inheritance on file locks. */ if (task_is_importance_donor(boosting_task)) { if (block->lf_boosted != LF_BOOSTED && - task_is_importance_receiver(block_task)) { + task_is_importance_receiver_type(block_task)) { lf_hold_assertion(block_task, block); } lf_jump_to_queue_head(block, lock); @@ -1383,8 +1385,9 @@ lf_printlist(const char *tag, struct lockf *lock) static void lf_hold_assertion(task_t block_task, struct lockf *block) { - task_importance_hold_internal_assertion(block_task, 1); - block->lf_boosted = LF_BOOSTED; + if (task_importance_hold_file_lock_assertion(block_task, 1)) { + block->lf_boosted = LF_BOOSTED; + } } @@ -1425,7 +1428,7 @@ lf_drop_assertion(struct lockf *block) task_t current_task; current_task = proc_task((proc_t) block->lf_id); - task_importance_drop_internal_assertion(current_task, 1); + task_importance_drop_file_lock_assertion(current_task, 1); block->lf_boosted = LF_NOT_BOOSTED; }