• Home
  • Raw
  • Download

Lines Matching refs:ref

1132 	struct binder_ref *ref;  in binder_get_ref()  local
1135 ref = rb_entry(n, struct binder_ref, rb_node_desc); in binder_get_ref()
1137 if (desc < ref->desc) { in binder_get_ref()
1139 } else if (desc > ref->desc) { in binder_get_ref()
1141 } else if (need_strong_ref && !ref->strong) { in binder_get_ref()
1145 return ref; in binder_get_ref()
1157 struct binder_ref *ref, *new_ref; in binder_get_ref_for_node() local
1162 ref = rb_entry(parent, struct binder_ref, rb_node_node); in binder_get_ref_for_node()
1164 if (node < ref->node) in binder_get_ref_for_node()
1166 else if (node > ref->node) in binder_get_ref_for_node()
1169 return ref; in binder_get_ref_for_node()
1171 new_ref = kzalloc_preempt_disabled(sizeof(*ref)); in binder_get_ref_for_node()
1183 ref = rb_entry(n, struct binder_ref, rb_node_desc); in binder_get_ref_for_node()
1184 if (ref->desc > new_ref->desc) in binder_get_ref_for_node()
1186 new_ref->desc = ref->desc + 1; in binder_get_ref_for_node()
1192 ref = rb_entry(parent, struct binder_ref, rb_node_desc); in binder_get_ref_for_node()
1194 if (new_ref->desc < ref->desc) in binder_get_ref_for_node()
1196 else if (new_ref->desc > ref->desc) in binder_get_ref_for_node()
1218 static void binder_delete_ref(struct binder_ref *ref) in binder_delete_ref() argument
1222 ref->proc->pid, ref->debug_id, ref->desc, in binder_delete_ref()
1223 ref->node->debug_id); in binder_delete_ref()
1225 rb_erase(&ref->rb_node_desc, &ref->proc->refs_by_desc); in binder_delete_ref()
1226 rb_erase(&ref->rb_node_node, &ref->proc->refs_by_node); in binder_delete_ref()
1227 if (ref->strong) in binder_delete_ref()
1228 binder_dec_node(ref->node, 1, 1); in binder_delete_ref()
1229 hlist_del(&ref->node_entry); in binder_delete_ref()
1230 binder_dec_node(ref->node, 0, 1); in binder_delete_ref()
1231 if (ref->death) { in binder_delete_ref()
1234 ref->proc->pid, ref->debug_id, ref->desc); in binder_delete_ref()
1235 list_del(&ref->death->work.entry); in binder_delete_ref()
1236 kfree(ref->death); in binder_delete_ref()
1239 kfree(ref); in binder_delete_ref()
1243 static int binder_inc_ref(struct binder_ref *ref, int strong, in binder_inc_ref() argument
1249 if (ref->strong == 0) { in binder_inc_ref()
1250 ret = binder_inc_node(ref->node, 1, 1, target_list); in binder_inc_ref()
1254 ref->strong++; in binder_inc_ref()
1256 if (ref->weak == 0) { in binder_inc_ref()
1257 ret = binder_inc_node(ref->node, 0, 1, target_list); in binder_inc_ref()
1261 ref->weak++; in binder_inc_ref()
1267 static int binder_dec_ref(struct binder_ref *ref, int strong) in binder_dec_ref() argument
1270 if (ref->strong == 0) { in binder_dec_ref()
1272 ref->proc->pid, ref->debug_id, in binder_dec_ref()
1273 ref->desc, ref->strong, ref->weak); in binder_dec_ref()
1276 ref->strong--; in binder_dec_ref()
1277 if (ref->strong == 0) { in binder_dec_ref()
1280 ret = binder_dec_node(ref->node, strong, 1); in binder_dec_ref()
1285 if (ref->weak == 0) { in binder_dec_ref()
1287 ref->proc->pid, ref->debug_id, in binder_dec_ref()
1288 ref->desc, ref->strong, ref->weak); in binder_dec_ref()
1291 ref->weak--; in binder_dec_ref()
1293 if (ref->strong == 0 && ref->weak == 0) in binder_dec_ref()
1294 binder_delete_ref(ref); in binder_dec_ref()
1568 struct binder_ref *ref; in binder_transaction_buffer_release() local
1571 ref = binder_get_ref(proc, fp->handle, in binder_transaction_buffer_release()
1573 if (ref == NULL) { in binder_transaction_buffer_release()
1580 ref->debug_id, ref->desc, ref->node->debug_id); in binder_transaction_buffer_release()
1581 binder_dec_ref(ref, hdr->type == BINDER_TYPE_HANDLE); in binder_transaction_buffer_release()
1652 struct binder_ref *ref; in binder_translate_binder() local
1675 ref = binder_get_ref_for_node(target_proc, node); in binder_translate_binder()
1676 if (!ref) in binder_translate_binder()
1684 fp->handle = ref->desc; in binder_translate_binder()
1686 binder_inc_ref(ref, fp->hdr.type == BINDER_TYPE_HANDLE, &thread->todo); in binder_translate_binder()
1688 trace_binder_transaction_node_to_ref(t, node, ref); in binder_translate_binder()
1692 ref->debug_id, ref->desc); in binder_translate_binder()
1701 struct binder_ref *ref; in binder_translate_handle() local
1705 ref = binder_get_ref(proc, fp->handle, in binder_translate_handle()
1707 if (!ref) { in binder_translate_handle()
1715 if (ref->node->proc == target_proc) { in binder_translate_handle()
1720 fp->binder = ref->node->ptr; in binder_translate_handle()
1721 fp->cookie = ref->node->cookie; in binder_translate_handle()
1722 binder_inc_node(ref->node, fp->hdr.type == BINDER_TYPE_BINDER, in binder_translate_handle()
1724 trace_binder_transaction_ref_to_node(t, ref); in binder_translate_handle()
1727 ref->debug_id, ref->desc, ref->node->debug_id, in binder_translate_handle()
1728 (u64)ref->node->ptr); in binder_translate_handle()
1732 new_ref = binder_get_ref_for_node(target_proc, ref->node); in binder_translate_handle()
1741 trace_binder_transaction_ref_to_ref(t, ref, new_ref); in binder_translate_handle()
1744 ref->debug_id, ref->desc, new_ref->debug_id, in binder_translate_handle()
1745 new_ref->desc, ref->node->debug_id); in binder_translate_handle()
1984 struct binder_ref *ref; in binder_transaction() local
1986 ref = binder_get_ref(proc, tr->target.handle, true); in binder_transaction()
1987 if (ref == NULL) { in binder_transaction()
1993 target_node = ref->node; in binder_transaction()
2366 struct binder_ref *ref; in binder_thread_write() local
2374 ref = binder_get_ref_for_node(proc, in binder_thread_write()
2376 if (ref->desc != target) { in binder_thread_write()
2379 ref->desc); in binder_thread_write()
2382 ref = binder_get_ref(proc, target, in binder_thread_write()
2385 if (ref == NULL) { in binder_thread_write()
2393 binder_inc_ref(ref, 0, NULL); in binder_thread_write()
2397 binder_inc_ref(ref, 1, NULL); in binder_thread_write()
2401 binder_dec_ref(ref, 1); in binder_thread_write()
2406 binder_dec_ref(ref, 0); in binder_thread_write()
2411 proc->pid, thread->pid, debug_string, ref->debug_id, in binder_thread_write()
2412 ref->desc, ref->strong, ref->weak, ref->node->debug_id); in binder_thread_write()
2584 struct binder_ref *ref; in binder_thread_write() local
2593 ref = binder_get_ref(proc, target, false); in binder_thread_write()
2594 if (ref == NULL) { in binder_thread_write()
2610 (u64)cookie, ref->debug_id, ref->desc, in binder_thread_write()
2611 ref->strong, ref->weak, ref->node->debug_id); in binder_thread_write()
2614 if (ref->death) { in binder_thread_write()
2630 ref->death = death; in binder_thread_write()
2631 if (ref->node->proc == NULL) { in binder_thread_write()
2632 ref->death->work.type = BINDER_WORK_DEAD_BINDER; in binder_thread_write()
2634 list_add_tail(&ref->death->work.entry, &thread->todo); in binder_thread_write()
2636 list_add_tail(&ref->death->work.entry, &proc->todo); in binder_thread_write()
2641 if (ref->death == NULL) { in binder_thread_write()
2646 death = ref->death; in binder_thread_write()
2654 ref->death = NULL; in binder_thread_write()
3643 struct binder_ref *ref; in binder_node_release() local
3662 hlist_for_each_entry(ref, &node->refs, node_entry) { in binder_node_release()
3665 if (!ref->death) in binder_node_release()
3670 if (list_empty(&ref->death->work.entry)) { in binder_node_release()
3671 ref->death->work.type = BINDER_WORK_DEAD_BINDER; in binder_node_release()
3672 list_add_tail(&ref->death->work.entry, in binder_node_release()
3673 &ref->proc->todo); in binder_node_release()
3674 wake_up_interruptible(&ref->proc->wait); in binder_node_release()
3731 struct binder_ref *ref; in binder_deferred_release() local
3733 ref = rb_entry(n, struct binder_ref, rb_node_desc); in binder_deferred_release()
3735 binder_delete_ref(ref); in binder_deferred_release()
3961 struct binder_ref *ref; in print_binder_node() local
3966 hlist_for_each_entry(ref, &node->refs, node_entry) in print_binder_node()
3976 hlist_for_each_entry(ref, &node->refs, node_entry) in print_binder_node()
3977 seq_printf(m, " %d", ref->proc->pid); in print_binder_node()
3985 static void print_binder_ref(struct seq_file *m, struct binder_ref *ref) in print_binder_ref() argument
3988 ref->debug_id, ref->desc, ref->node->proc ? "" : "dead ", in print_binder_ref()
3989 ref->node->debug_id, ref->strong, ref->weak, ref->death); in print_binder_ref()
4163 struct binder_ref *ref = rb_entry(n, struct binder_ref, in print_binder_proc_stats() local
4166 strong += ref->strong; in print_binder_proc_stats()
4167 weak += ref->weak; in print_binder_proc_stats()