Home
last modified time | relevance | path

Searched refs:refcount (Results 1 – 25 of 539) sorted by relevance

12345678910>>...22

/linux-6.1.9/Documentation/translations/zh_CN/core-api/
Dkref.rst41 struct kref refcount;
58 kref_init(&data->refcount);
60 这将kref中的refcount设置为1。
68 行线程,你必须在传递之前用kref_get()增加refcount::
70 kref_get(&data->refcount);
72 如果你已经有了一个指向kref-ed结构体的有效指针(refcount不能为零),你
77 kref_put(&data->refcount, data_release);
91 struct my_data *data = container_of(ref, struct my_data, refcount);
101 kref_put(&data->refcount, data_release);
112 kref_init(&data->refcount);
[all …]
/linux-6.1.9/include/linux/
Dkref.h20 refcount_t refcount; member
23 #define KREF_INIT(n) { .refcount = REFCOUNT_INIT(n), }
31 refcount_set(&kref->refcount, 1); in kref_init()
36 return refcount_read(&kref->refcount); in kref_read()
45 refcount_inc(&kref->refcount); in kref_get()
64 if (refcount_dec_and_test(&kref->refcount)) { in kref_put()
75 if (refcount_dec_and_mutex_lock(&kref->refcount, lock)) { in kref_put_mutex()
86 if (refcount_dec_and_lock(&kref->refcount, lock)) { in kref_put_lock()
111 return refcount_inc_not_zero(&kref->refcount); in kref_get_unless_zero()
/linux-6.1.9/drivers/gpu/drm/amd/display/dc/core/
Ddc_surface.c112 kref_init(&plane_state->refcount); in dc_create_plane_state()
177 kref_get(&plane_state->refcount); in dc_plane_state_retain()
182 struct dc_plane_state *plane_state = container_of(kref, struct dc_plane_state, refcount); in dc_plane_state_free()
189 kref_put(&plane_state->refcount, dc_plane_state_free); in dc_plane_state_release()
194 kref_get(&gamma->refcount); in dc_gamma_retain()
199 struct dc_gamma *gamma = container_of(kref, struct dc_gamma, refcount); in dc_gamma_free()
205 kref_put(&(*gamma)->refcount, dc_gamma_free); in dc_gamma_release()
216 kref_init(&gamma->refcount); in dc_create_gamma()
225 kref_get(&tf->refcount); in dc_transfer_func_retain()
230 struct dc_transfer_func *tf = container_of(kref, struct dc_transfer_func, refcount); in dc_transfer_func_free()
[all …]
Ddc_sink.c62 kref_get(&sink->refcount); in dc_sink_retain()
67 struct dc_sink *sink = container_of(kref, struct dc_sink, refcount); in dc_sink_free()
74 kref_put(&sink->refcount, dc_sink_free); in dc_sink_release()
87 kref_init(&sink->refcount); in dc_sink_create()
/linux-6.1.9/include/trace/events/
Dobjagg.h88 unsigned int refcount),
90 TP_ARGS(objagg, obj, refcount),
95 __field(unsigned int, refcount)
101 __entry->refcount = refcount;
105 __entry->objagg, __entry->obj, __entry->refcount)
111 unsigned int refcount),
113 TP_ARGS(objagg, obj, refcount),
118 __field(unsigned int, refcount)
124 __entry->refcount = refcount;
128 __entry->objagg, __entry->obj, __entry->refcount)
/linux-6.1.9/drivers/scsi/qedf/
Dqedf_els.c84 kref_put(&els_req->refcount, qedf_release_cmd); in qedf_initiate_els()
97 kref_put(&els_req->refcount, qedf_release_cmd); in qedf_initiate_els()
188 kref_put(&els_req->refcount, qedf_release_cmd); in qedf_process_els_compl()
196 int refcount; in qedf_rrq_compl() local
211 refcount = kref_read(&orig_io_req->refcount); in qedf_rrq_compl()
214 orig_io_req, orig_io_req->xid, rrq_req->xid, refcount); in qedf_rrq_compl()
221 if (orig_io_req && refcount > 0) in qedf_rrq_compl()
222 kref_put(&orig_io_req->refcount, qedf_release_cmd); in qedf_rrq_compl()
232 kref_put(&rrq_req->refcount, qedf_release_cmd); in qedf_rrq_compl()
248 int refcount; in qedf_send_rrq() local
[all …]
Dqedf_io.c54 kref_put(&io_req->refcount, qedf_release_cmd); in qedf_cmd_timeout()
75 kref_get(&io_req->refcount); in qedf_cmd_timeout()
90 kref_put(&io_req->refcount, qedf_release_cmd); in qedf_cmd_timeout()
375 kref_init(&io_req->refcount); /* ID: 001 */ in qedf_alloc_cmd()
383 kref_put(&io_req->refcount, qedf_release_cmd); in qedf_alloc_cmd()
435 container_of(ref, struct qedf_ioreq, refcount); in qedf_release_cmd()
824 io_log->refcount = kref_read(&io_req->refcount); in qedf_trace_io()
883 kref_put(&io_req->refcount, qedf_release_cmd); in qedf_post_io_req()
892 kref_put(&io_req->refcount, qedf_release_cmd); in qedf_post_io_req()
911 kref_put(&io_req->refcount, qedf_release_cmd); in qedf_post_io_req()
[all …]
/linux-6.1.9/Documentation/core-api/
Dkref.rst28 struct kref refcount;
46 kref_init(&data->refcount);
48 This sets the refcount in the kref to 1.
58 increment the refcount with kref_get() before passing it off::
60 kref_get(&data->refcount);
63 refcount cannot go to zero) you may do this without a lock.
67 kref_put(&data->refcount, data_release);
85 struct my_data *data = container_of(ref, struct my_data, refcount);
95 kref_put(&data->refcount, data_release);
106 kref_init(&data->refcount);
[all …]
/linux-6.1.9/net/batman-adv/
Doriginator.c75 if (!kref_get_unless_zero(&orig_node->refcount)) in batadv_orig_hash_find()
122 if (!kref_get_unless_zero(&tmp->refcount)) in batadv_orig_node_vlan_get()
163 kref_init(&vlan->refcount); in batadv_orig_node_vlan_new()
166 kref_get(&vlan->refcount); in batadv_orig_node_vlan_new()
184 orig_vlan = container_of(ref, struct batadv_orig_node_vlan, refcount); in batadv_orig_node_vlan_release()
228 neigh_ifinfo = container_of(ref, struct batadv_neigh_ifinfo, refcount); in batadv_neigh_ifinfo_release()
246 refcount); in batadv_hardif_neigh_release()
267 neigh_node = container_of(ref, struct batadv_neigh_node, refcount); in batadv_neigh_node_release()
307 if (router && !kref_get_unless_zero(&router->refcount)) in batadv_orig_router_get()
335 if (!kref_get_unless_zero(&tmp->refcount)) in batadv_orig_ifinfo_get()
[all …]
Dtypes.h190 struct kref refcount; member
274 struct kref refcount; member
344 struct kref refcount; member
497 struct kref refcount; member
572 struct kref refcount; member
631 struct kref refcount; member
666 struct kref refcount; member
735 struct kref refcount; member
1482 struct kref refcount; member
1510 struct kref refcount; member
[all …]
Doriginator.h96 kref_put(&orig_vlan->refcount, batadv_orig_node_vlan_release); in batadv_orig_node_vlan_put()
110 kref_put(&neigh_ifinfo->refcount, batadv_neigh_ifinfo_release); in batadv_neigh_ifinfo_put()
124 kref_put(&hardif_neigh->refcount, batadv_hardif_neigh_release); in batadv_hardif_neigh_put()
137 kref_put(&neigh_node->refcount, batadv_neigh_node_release); in batadv_neigh_node_put()
151 kref_put(&orig_ifinfo->refcount, batadv_orig_ifinfo_release); in batadv_orig_ifinfo_put()
164 kref_put(&orig_node->refcount, batadv_orig_node_release); in batadv_orig_node_put()
/linux-6.1.9/mm/
Dzpool.c39 atomic_set(&driver->refcount, 0); in zpool_register_driver()
57 int ret = 0, refcount; in zpool_unregister_driver() local
60 refcount = atomic_read(&driver->refcount); in zpool_unregister_driver()
61 WARN_ON(refcount < 0); in zpool_unregister_driver()
62 if (refcount > 0) in zpool_unregister_driver()
83 atomic_inc(&driver->refcount); in zpool_get_driver()
95 atomic_dec(&driver->refcount); in zpool_put_driver()
/linux-6.1.9/arch/arm64/kvm/hyp/nvhe/
Dpage_alloc.c58 if (!buddy || buddy->order != order || buddy->refcount) in __find_buddy_avail()
149 BUG_ON(p->refcount == USHRT_MAX); in hyp_page_ref_inc()
150 p->refcount++; in hyp_page_ref_inc()
155 BUG_ON(!p->refcount); in hyp_page_ref_dec_and_test()
156 p->refcount--; in hyp_page_ref_dec_and_test()
157 return (p->refcount == 0); in hyp_page_ref_dec_and_test()
162 BUG_ON(p->refcount); in hyp_set_page_refcounted()
163 p->refcount = 1; in hyp_set_page_refcounted()
/linux-6.1.9/drivers/media/mc/
Dmc-dev-allocator.c33 struct kref refcount; member
45 container_of(kref, struct media_device_instance, refcount); in media_device_instance_release()
71 kref_get(&mdi->refcount); in __media_device_get()
89 kref_init(&mdi->refcount); in __media_device_get()
133 kref_put(&mdi->refcount, media_device_instance_release); in media_device_delete()
/linux-6.1.9/drivers/net/ethernet/mellanox/mlx5/core/
Drl.c124 if (!table->rl_entry[i].refcount) in find_rl_entry()
129 if (table->rl_entry[i].refcount) { in find_rl_entry()
184 table->refcount++; in mlx5_rl_table_get()
199 table->refcount++; in mlx5_rl_table_get()
206 if (--table->refcount) in mlx5_rl_table_put()
222 if (table->rl_entry[i].refcount) in mlx5_rl_table_free()
229 entry->refcount++; in mlx5_rl_entry_get()
235 entry->refcount--; in mlx5_rl_entry_put()
236 if (!entry->refcount) in mlx5_rl_entry_put()
270 if (!entry->refcount) { in mlx5_rl_add_rate_raw()
[all …]
/linux-6.1.9/drivers/net/ethernet/mellanox/mlx5/core/lib/
Dgeneve.c14 u32 refcount; member
72 if (geneve->refcount) { in mlx5_geneve_tlv_option_add()
76 geneve->refcount++; in mlx5_geneve_tlv_option_add()
107 geneve->refcount++; in mlx5_geneve_tlv_option_add()
121 if (--geneve->refcount == 0) { in mlx5_geneve_tlv_option_del()
153 if (geneve->refcount) in mlx5_geneve_destroy()
/linux-6.1.9/net/core/
Ddev_addr_lists.c65 ha->refcount = 1; in __hw_addr_create()
113 ha->refcount++; in __hw_addr_add_ex()
155 if (--ha->refcount) in __hw_addr_del_entry()
223 ha->refcount++; in __hw_addr_sync_one()
253 if (ha->sync_cnt == ha->refcount) { in __hw_addr_sync_multiple()
281 } else if (ha->refcount == 1) in __hw_addr_sync()
325 if (!ha->sync_cnt || ha->refcount != 1) in __hw_addr_sync_dev()
346 ha->refcount++; in __hw_addr_sync_dev()
382 if ((ha->sync_cnt << 1) <= ha->refcount) in __hw_addr_ref_sync_dev()
386 ref_cnt = ha->refcount - ha->sync_cnt; in __hw_addr_ref_sync_dev()
[all …]
/linux-6.1.9/drivers/gpu/host1x/
Dchannel.c49 kref_get(&channel->refcount); in host1x_channel_get()
68 if (!kref_get_unless_zero(&ch->refcount)) in host1x_channel_get_index()
85 container_of(kref, struct host1x_channel, refcount); in release_channel()
97 kref_put(&channel->refcount, release_channel); in host1x_channel_put()
138 kref_init(&channel->refcount); in host1x_channel_request()
/linux-6.1.9/drivers/net/wireguard/
Dpeer.c53 kref_init(&peer->refcount); in wg_peer_create()
75 if (unlikely(!peer || !kref_get_unless_zero(&peer->refcount))) in wg_peer_get_maybe_zero()
200 static void kref_release(struct kref *refcount) in kref_release() argument
202 struct wg_peer *peer = container_of(refcount, struct wg_peer, refcount); in kref_release()
227 kref_put(&peer->refcount, kref_release); in wg_peer_put()
/linux-6.1.9/include/net/
Dnetrom.h100 refcount_t refcount; member
116 refcount_t refcount; member
125 refcount_inc(&((__nr_node)->refcount))
129 if (refcount_dec_and_test(&nr_node->refcount)) { in nr_node_put()
135 refcount_inc(&((__nr_neigh)->refcount))
139 if (refcount_dec_and_test(&nr_neigh->refcount)) { in nr_neigh_put()
Dax25.h163 refcount_t refcount; member
172 refcount_inc(&((ax25)->refcount))
176 if (refcount_dec_and_test(&assoc->refcount)) { in ax25_uid_put()
230 refcount_t refcount; member
255 refcount_t refcount; member
277 refcount_inc(&((__ax25)->refcount))
281 if (refcount_dec_and_test(&ax25->refcount)) { in ax25_cb_put()
289 refcount_inc(&ax25_dev->refcount); in ax25_dev_hold()
294 if (refcount_dec_and_test(&ax25_dev->refcount)) { in ax25_dev_put()
/linux-6.1.9/drivers/soc/qcom/
Dsmem_state.c26 struct kref refcount; member
67 kref_get(&state->refcount); in of_node_to_state()
136 struct qcom_smem_state *state = container_of(ref, struct qcom_smem_state, refcount); in qcom_smem_state_release()
150 kref_put(&state->refcount, qcom_smem_state_release); in qcom_smem_state_put()
207 kref_init(&state->refcount); in qcom_smem_state_register()
/linux-6.1.9/drivers/misc/habanalabs/common/
Dcontext.c15 container_of(ref, struct hl_cs_encaps_sig_handle, refcount); in hl_encaps_handle_do_release()
29 container_of(ref, struct hl_cs_encaps_sig_handle, refcount); in hl_encaps_handle_do_release_sob()
64 kref_put(&handle->refcount, in hl_encaps_sig_mgr_fini()
124 ctx = container_of(ref, struct hl_ctx, refcount); in hl_ctx_do_release()
195 kref_init(&ctx->refcount); in hl_ctx_init()
281 return kref_get_unless_zero(&ctx->refcount); in hl_ctx_get_unless_zero()
286 kref_get(&ctx->refcount); in hl_ctx_get()
291 return kref_put(&ctx->refcount, hl_ctx_do_release); in hl_ctx_put()
431 kref_put(&ctx->refcount, hl_ctx_do_release); in hl_ctx_mgr_fini()
/linux-6.1.9/drivers/gpu/drm/vmwgfx/
Dttm_object.c82 struct kref refcount; member
138 kref_get(&tfile->refcount); in ttm_object_file_ref()
175 container_of(kref, struct ttm_object_file, refcount); in ttm_object_file_destroy()
186 kref_put(&tfile->refcount, ttm_object_file_destroy); in ttm_object_file_unref()
203 kref_init(&base->refcount); in ttm_base_object_init()
230 container_of(kref, struct ttm_base_object, refcount); in ttm_release_base()
254 kref_put(&base->refcount, ttm_release_base); in ttm_base_object_unref()
269 if (!kref_get_unless_zero(&base->refcount)) in ttm_base_object_lookup()
286 if (base && !kref_get_unless_zero(&base->refcount)) in ttm_base_object_lookup_for_ref()
339 kref_get(&base->refcount); in ttm_ref_object_add()
[all …]
/linux-6.1.9/drivers/net/ethernet/mellanox/mlx5/core/steering/
Ddr_table.c75 refcount_dec(&tbl->miss_action->refcount); in mlx5dr_table_set_miss_action()
80 refcount_inc(&action->refcount); in mlx5dr_table_set_miss_action()
256 refcount_inc(&dmn->refcount); in mlx5dr_table_create()
265 refcount_set(&tbl->refcount, 1); in mlx5dr_table_create()
284 refcount_dec(&dmn->refcount); in mlx5dr_table_create()
292 if (WARN_ON_ONCE(refcount_read(&tbl->refcount) > 1)) in mlx5dr_table_destroy()
303 refcount_dec(&tbl->miss_action->refcount); in mlx5dr_table_destroy()
305 refcount_dec(&tbl->dmn->refcount); in mlx5dr_table_destroy()

12345678910>>...22