Home
last modified time | relevance | path

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

12345678910>>...25

/linux-6.12.1/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.12.1/net/dsa/
Dtrace.h86 const struct dsa_db *db, const refcount_t *refcount),
88 TP_ARGS(dp, addr, vid, db, refcount),
97 __field(unsigned int, refcount)
107 __entry->refcount = refcount_read(refcount);
112 __entry->vid, __entry->db_buf, __entry->refcount)
119 const refcount_t *refcount),
120 TP_ARGS(dp, addr, vid, db, refcount));
125 const refcount_t *refcount),
126 TP_ARGS(dp, addr, vid, db, refcount));
134 const refcount_t *refcount),
[all …]
/linux-6.12.1/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.12.1/drivers/gpu/drm/amd/display/dc/core/
Ddc_surface.c101 kref_init(&plane_state->refcount); in dc_create_plane_state()
169 kref_get(&plane_state->refcount); in dc_plane_state_retain()
174 struct dc_plane_state *plane_state = container_of(kref, struct dc_plane_state, refcount); in dc_plane_state_free()
181 kref_put(&plane_state->refcount, dc_plane_state_free); in dc_plane_state_release()
186 kref_get(&gamma->refcount); in dc_gamma_retain()
191 struct dc_gamma *gamma = container_of(kref, struct dc_gamma, refcount); in dc_gamma_free()
197 kref_put(&(*gamma)->refcount, dc_gamma_free); in dc_gamma_release()
208 kref_init(&gamma->refcount); in dc_create_gamma()
217 kref_get(&tf->refcount); in dc_transfer_func_retain()
222 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.12.1/arch/arm64/kvm/hyp/include/nvhe/
Dmemory.h11 unsigned short refcount; member
49 return p->refcount; in hyp_page_count()
54 BUG_ON(p->refcount == USHRT_MAX); in hyp_page_ref_inc()
55 p->refcount++; in hyp_page_ref_inc()
60 BUG_ON(!p->refcount); in hyp_page_ref_dec()
61 p->refcount--; in hyp_page_ref_dec()
67 return (p->refcount == 0); in hyp_page_ref_dec_and_test()
72 BUG_ON(p->refcount); in hyp_set_page_refcounted()
73 p->refcount = 1; in hyp_set_page_refcounted()
/linux-6.12.1/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.12.1/rust/kernel/block/mq/
Drequest.rs95 if let Err(_old) = this.wrapper_ref().refcount().compare_exchange( in try_set_end()
162 refcount: AtomicU64, field
168 pub(crate) fn refcount(&self) -> &AtomicU64 { in refcount() method
169 &self.refcount in refcount()
181 unsafe { addr_of_mut!((*this).refcount) } in refcount_ptr()
226 let refcount = &self.wrapper_ref().refcount(); in inc_ref() localVariable
229 let updated = atomic_relaxed_op_unless(refcount, |x| x + 1, 0); in inc_ref()
243 let refcount = unsafe { &*RequestDataWrapper::refcount_ptr(wrapper_ptr) }; in dec_ref() localVariable
246 let new_refcount = atomic_relaxed_op_return(refcount, |x| x - 1); in dec_ref()
/linux-6.12.1/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()
828 io_log->refcount = kref_read(&io_req->refcount); in qedf_trace_io()
887 kref_put(&io_req->refcount, qedf_release_cmd); in qedf_post_io_req()
896 kref_put(&io_req->refcount, qedf_release_cmd); in qedf_post_io_req()
915 kref_put(&io_req->refcount, qedf_release_cmd); in qedf_post_io_req()
[all …]
/linux-6.12.1/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.12.1/drivers/infiniband/hw/hfi1/
Dmmu_rb.c22 static void release_immediate(struct kref *refcount);
111 kref_put(&rbnode->refcount, release_immediate); in hfi1_mmu_rb_unregister()
188 static void release_immediate(struct kref *refcount) in release_immediate() argument
191 container_of(refcount, struct mmu_rb_node, refcount); in release_immediate()
197 static void release_nolock(struct kref *refcount) in release_nolock() argument
200 container_of(refcount, struct mmu_rb_node, refcount); in release_nolock()
213 void hfi1_mmu_rb_release(struct kref *refcount) in hfi1_mmu_rb_release() argument
216 container_of(refcount, struct mmu_rb_node, refcount); in hfi1_mmu_rb_release()
241 if (kref_read(&rbnode->refcount) > 1) in hfi1_mmu_rb_evict()
257 kref_put(&rbnode->refcount, release_immediate); in hfi1_mmu_rb_evict()
[all …]
Dtrace_mmu.h22 __field(unsigned int, refcount)
26 __entry->refcount = kref_read(&node->refcount);
31 __entry->refcount
/linux-6.12.1/net/batman-adv/
Doriginator.c76 if (!kref_get_unless_zero(&orig_node->refcount)) in batadv_orig_hash_find()
123 if (!kref_get_unless_zero(&tmp->refcount)) in batadv_orig_node_vlan_get()
190 kref_init(&vlan->refcount); in batadv_orig_node_vlan_new()
193 kref_get(&vlan->refcount); in batadv_orig_node_vlan_new()
211 orig_vlan = container_of(ref, struct batadv_orig_node_vlan, refcount); in batadv_orig_node_vlan_release()
255 neigh_ifinfo = container_of(ref, struct batadv_neigh_ifinfo, refcount); in batadv_neigh_ifinfo_release()
273 refcount); in batadv_hardif_neigh_release()
294 neigh_node = container_of(ref, struct batadv_neigh_node, refcount); in batadv_neigh_node_release()
334 if (router && !kref_get_unless_zero(&router->refcount)) in batadv_orig_router_get()
389 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
1552 struct kref refcount; member
1580 struct kref refcount; member
[all …]
Doriginator.h99 kref_put(&orig_vlan->refcount, batadv_orig_node_vlan_release); in batadv_orig_node_vlan_put()
113 kref_put(&neigh_ifinfo->refcount, batadv_neigh_ifinfo_release); in batadv_neigh_ifinfo_put()
127 kref_put(&hardif_neigh->refcount, batadv_hardif_neigh_release); in batadv_hardif_neigh_put()
140 kref_put(&neigh_node->refcount, batadv_neigh_node_release); in batadv_neigh_node_put()
154 kref_put(&orig_ifinfo->refcount, batadv_orig_ifinfo_release); in batadv_orig_ifinfo_put()
167 kref_put(&orig_node->refcount, batadv_orig_node_release); in batadv_orig_node_put()
/linux-6.12.1/mm/
Dzpool.c36 atomic_set(&driver->refcount, 0); in zpool_register_driver()
54 int ret = 0, refcount; in zpool_unregister_driver() local
57 refcount = atomic_read(&driver->refcount); in zpool_unregister_driver()
58 WARN_ON(refcount < 0); in zpool_unregister_driver()
59 if (refcount > 0) in zpool_unregister_driver()
80 atomic_inc(&driver->refcount); in zpool_get_driver()
92 atomic_dec(&driver->refcount); in zpool_put_driver()
/linux-6.12.1/drivers/gpu/drm/i915/display/
Dintel_dmc_wl.c59 WARN_ON(refcount_read(&wl->refcount)); in __intel_dmc_wl_release()
76 if (!refcount_read(&wl->refcount)) in intel_dmc_wl_work()
132 refcount_set(&wl->refcount, 0); in intel_dmc_wl_init()
180 refcount_set(&wl->refcount, 0); in intel_dmc_wl_disable()
206 if (refcount_inc_not_zero(&wl->refcount)) in intel_dmc_wl_get()
209 refcount_set(&wl->refcount, 1); in intel_dmc_wl_get()
252 if (WARN_RATELIMIT(!refcount_read(&wl->refcount), in intel_dmc_wl_put()
256 if (refcount_dec_and_test(&wl->refcount)) { in intel_dmc_wl_put()
/linux-6.12.1/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.12.1/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.12.1/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()
122 if (--geneve->refcount == 0) { in mlx5_geneve_tlv_option_del()
154 if (geneve->refcount) in mlx5_geneve_destroy()
/linux-6.12.1/drivers/accel/habanalabs/common/
Dcontext.c33 container_of(ref, struct hl_cs_encaps_sig_handle, refcount); in hl_encaps_release_handle_and_put_ctx()
41 container_of(ref, struct hl_cs_encaps_sig_handle, refcount); in hl_encaps_release_handle_and_put_sob()
49 container_of(ref, struct hl_cs_encaps_sig_handle, refcount); in hl_encaps_release_handle_and_put_sob_ctx()
75 kref_put(&handle->refcount, hl_encaps_release_handle_and_put_sob); in hl_encaps_sig_mgr_fini()
135 ctx = container_of(ref, struct hl_ctx, refcount); in hl_ctx_do_release()
207 kref_init(&ctx->refcount); in hl_ctx_init()
296 return kref_get_unless_zero(&ctx->refcount); in hl_ctx_get_unless_zero()
301 kref_get(&ctx->refcount); in hl_ctx_get()
306 return kref_put(&ctx->refcount, hl_ctx_do_release); in hl_ctx_put()
446 kref_put(&ctx->refcount, hl_ctx_do_release); in hl_ctx_mgr_fini()
/linux-6.12.1/fs/smb/client/
Dcached_dir.c39 kref_get(&cfid->refcount); in find_or_create_cached_dir()
61 kref_get(&cfid->refcount); in find_or_create_cached_dir()
367 kref_put(&cfid->refcount, smb2_close_cached_fid); in open_cached_dir()
405 kref_get(&cfid->refcount); in open_cached_dir_by_dentry()
419 refcount); in smb2_close_cached_fid()
457 kref_put(&cfid->refcount, smb2_close_cached_fid); in drop_cached_dir_by_name()
466 kref_put(&cfid->refcount, smb2_close_cached_fid); in close_cached_dir()
516 kref_get(&cfid->refcount); in invalidate_all_cached_dirs()
531 kref_put(&cfid->refcount, smb2_close_cached_fid); in invalidate_all_cached_dirs()
534 kref_put(&cfid->refcount, smb2_close_cached_fid); in invalidate_all_cached_dirs()
[all …]
/linux-6.12.1/rust/kernel/sync/
Darc.rs137 refcount: Opaque<bindings::refcount_t>, field
203 refcount: Opaque::new(unsafe { bindings::REFCOUNT_INIT(1) }), in new()
311 let refcount = unsafe { me.ptr.as_ref() }.refcount.get(); in into_unique_or_drop() localVariable
318 let is_zero = unsafe { bindings::refcount_dec_and_test(refcount) }; in into_unique_or_drop()
322 unsafe { core::ptr::write(refcount, bindings::REFCOUNT_INIT(1)) }; in into_unique_or_drop()
382 unsafe { bindings::refcount_inc(self.ptr.as_ref().refcount.get()) }; in clone()
395 let refcount = unsafe { self.ptr.as_ref() }.refcount.get(); in drop() localVariable
400 let is_zero = unsafe { bindings::refcount_dec_and_test(refcount) }; in drop()
653 refcount: Opaque::new(unsafe { bindings::REFCOUNT_INIT(1) }), in new_uninit()
/linux-6.12.1/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 …]

12345678910>>...25