Home
last modified time | relevance | path

Searched refs:kref (Results 1 – 25 of 794) sorted by relevance

12345678910>>...32

/linux-6.6.21/include/linux/
Dkref.h19 struct kref { struct
29 static inline void kref_init(struct kref *kref) in kref_init() argument
31 refcount_set(&kref->refcount, 1); in kref_init()
34 static inline unsigned int kref_read(const struct kref *kref) in kref_read() argument
36 return refcount_read(&kref->refcount); in kref_read()
43 static inline void kref_get(struct kref *kref) in kref_get() argument
45 refcount_inc(&kref->refcount); in kref_get()
62 static inline int kref_put(struct kref *kref, void (*release)(struct kref *kref)) in kref_put() argument
64 if (refcount_dec_and_test(&kref->refcount)) { in kref_put()
65 release(kref); in kref_put()
[all …]
/linux-6.6.21/drivers/target/iscsi/cxgbit/
Dcxgbit.h140 struct kref kref; member
185 struct kref kref; member
211 struct kref kref; member
244 void _cxgbit_free_cdev(struct kref *kref);
245 void _cxgbit_free_csk(struct kref *kref);
246 void _cxgbit_free_cnp(struct kref *kref);
250 kref_get(&cdev->kref); in cxgbit_get_cdev()
255 kref_put(&cdev->kref, _cxgbit_free_cdev); in cxgbit_put_cdev()
260 kref_get(&csk->kref); in cxgbit_get_csk()
265 kref_put(&csk->kref, _cxgbit_free_csk); in cxgbit_put_csk()
[all …]
/linux-6.6.21/Documentation/translations/zh_CN/core-api/
Dkref.rst3 :Original: Documentation/core-api/kref.rst
35 要使用kref,请在你的数据结构中添加一个,如::
41 struct kref refcount;
46 kref可以出现在数据结构体中的任何地方。
51 你必须在分配kref之后初始化它。 要做到这一点,可以这样调用kref_init::
60 这将kref中的refcount设置为1。
65 一旦你有一个初始化的kref,你必须遵循以下规则:
72 如果你已经有了一个指向kref-ed结构体的有效指针(refcount不能为零),你
80 在没有已经持有有效指针的情况下获得一个kref-ed结构体的有效指针,那么在没
83 3) 如果代码试图获得对一个kref-ed结构体的引用,而不持有一个有效的指针,它必
[all …]
/linux-6.6.21/include/linux/ceph/
Dbuffer.h17 struct kref kref; member
23 extern void ceph_buffer_release(struct kref *kref);
27 kref_get(&b->kref); in ceph_buffer_get()
34 kref_put(&b->kref, ceph_buffer_release); in ceph_buffer_put()
Dstring_table.h11 struct kref kref; member
20 extern void ceph_release_string(struct kref *ref);
27 kref_get(&str->kref); in ceph_get_string()
35 kref_put(&str->kref, ceph_release_string); in ceph_put_string()
56 kref_get_unless_zero(&___str->kref)) \
/linux-6.6.21/drivers/gpu/drm/i915/
Di915_drm_client.h21 struct kref kref; member
37 kref_get(&client->kref); in i915_drm_client_get()
41 void __i915_drm_client_free(struct kref *kref);
45 kref_put(&client->kref, __i915_drm_client_free); in i915_drm_client_put()
/linux-6.6.21/drivers/gpu/drm/amd/display/dc/core/
Ddc_surface.c180 static void dc_plane_state_free(struct kref *kref) in dc_plane_state_free() argument
182 struct dc_plane_state *plane_state = container_of(kref, struct dc_plane_state, refcount); in dc_plane_state_free()
197 static void dc_gamma_free(struct kref *kref) in dc_gamma_free() argument
199 struct dc_gamma *gamma = container_of(kref, struct dc_gamma, refcount); in dc_gamma_free()
228 static void dc_transfer_func_free(struct kref *kref) in dc_transfer_func_free() argument
230 struct dc_transfer_func *tf = container_of(kref, struct dc_transfer_func, refcount); in dc_transfer_func_free()
254 static void dc_3dlut_func_free(struct kref *kref) in dc_3dlut_func_free() argument
256 struct dc_3dlut *lut = container_of(kref, struct dc_3dlut, refcount); in dc_3dlut_func_free()
/linux-6.6.21/arch/powerpc/platforms/cell/spufs/
Dgang.c23 kref_init(&gang->kref); in alloc_spu_gang()
33 static void destroy_spu_gang(struct kref *kref) in destroy_spu_gang() argument
36 gang = container_of(kref, struct spu_gang, kref); in destroy_spu_gang()
43 kref_get(&gang->kref); in get_spu_gang()
49 return kref_put(&gang->kref, &destroy_spu_gang); in put_spu_gang()
Dcontext.c39 kref_init(&ctx->kref); in alloc_spu_context()
69 void destroy_spu_context(struct kref *kref) in destroy_spu_context() argument
72 ctx = container_of(kref, struct spu_context, kref); in destroy_spu_context()
90 kref_get(&ctx->kref); in get_spu_context()
96 return kref_put(&ctx->kref, &destroy_spu_context); in put_spu_context()
/linux-6.6.21/security/integrity/
Ddigsig_asymmetric.c33 key_ref_t kref; in request_asymmetric_key() local
35 kref = keyring_search(make_key_ref(key, 1), in request_asymmetric_key()
37 if (!IS_ERR(kref)) { in request_asymmetric_key()
45 key_ref_t kref; in request_asymmetric_key() local
47 kref = keyring_search(make_key_ref(keyring, 1), in request_asymmetric_key()
49 if (IS_ERR(kref)) in request_asymmetric_key()
50 key = ERR_CAST(kref); in request_asymmetric_key()
52 key = key_ref_to_ptr(kref); in request_asymmetric_key()
/linux-6.6.21/drivers/gpu/drm/nouveau/nvkm/engine/fifo/
Dchid.c54 nvkm_chid_del(struct kref *kref) in nvkm_chid_del() argument
56 struct nvkm_chid *chid = container_of(kref, typeof(*chid), kref); in nvkm_chid_del()
72 kref_put(&chid->kref, nvkm_chid_del); in nvkm_chid_unref()
80 kref_get(&chid->kref); in nvkm_chid_ref()
95 kref_init(&chid->kref); in nvkm_chid_new()
/linux-6.6.21/drivers/gpu/drm/msm/
Dmsm_gem_vma.c13 msm_gem_address_space_destroy(struct kref *kref) in msm_gem_address_space_destroy() argument
15 struct msm_gem_address_space *aspace = container_of(kref, in msm_gem_address_space_destroy()
16 struct msm_gem_address_space, kref); in msm_gem_address_space_destroy()
29 kref_put(&aspace->kref, msm_gem_address_space_destroy); in msm_gem_address_space_put()
36 kref_get(&aspace->kref); in msm_gem_address_space_get()
148 kref_get(&aspace->kref); in msm_gem_vma_init()
174 kref_init(&aspace->kref); in msm_gem_address_space_create()
/linux-6.6.21/drivers/gpu/drm/vmwgfx/
Dttm_object.c82 struct kref refcount;
128 struct kref kref; member
172 static void ttm_object_file_destroy(struct kref *kref) in ttm_object_file_destroy() argument
175 container_of(kref, struct ttm_object_file, refcount); in ttm_object_file_destroy()
227 static void ttm_release_base(struct kref *kref) in ttm_release_base() argument
230 container_of(kref, struct ttm_base_object, refcount); in ttm_release_base()
314 if (kref_get_unless_zero(&ref->kref)) { in ttm_ref_object_add()
332 kref_init(&ref->kref); in ttm_ref_object_add()
349 ttm_ref_object_release(struct kref *kref) in ttm_ref_object_release() argument
352 container_of(kref, struct ttm_ref_object, kref); in ttm_ref_object_release()
[all …]
/linux-6.6.21/drivers/acpi/
Dacpi_ipmi.c40 struct kref kref; member
83 struct kref kref; member
121 kref_init(&ipmi_device->kref); in ipmi_dev_alloc()
148 static void ipmi_dev_release_kref(struct kref *kref) in ipmi_dev_release_kref() argument
151 container_of(kref, struct acpi_ipmi_device, kref); in ipmi_dev_release_kref()
176 kref_get(&ipmi_device->kref); in acpi_ipmi_dev_get()
185 kref_put(&ipmi_device->kref, ipmi_dev_release_kref); in acpi_ipmi_dev_put()
203 kref_init(&ipmi_msg->kref); in ipmi_msg_alloc()
218 static void ipmi_msg_release_kref(struct kref *kref) in ipmi_msg_release_kref() argument
221 container_of(kref, struct acpi_ipmi_msg, kref); in ipmi_msg_release_kref()
[all …]
/linux-6.6.21/drivers/gpu/drm/nouveau/nvkm/core/
Dmemory.c104 kref_init(&memory->kref); in nvkm_memory_ctor()
108 nvkm_memory_del(struct kref *kref) in nvkm_memory_del() argument
110 struct nvkm_memory *memory = container_of(kref, typeof(*memory), kref); in nvkm_memory_del()
123 kref_put(&memory->kref, nvkm_memory_del); in nvkm_memory_unref()
132 kref_get(&memory->kref); in nvkm_memory_ref()
/linux-6.6.21/drivers/media/cec/core/
Dcec-notifier.c25 struct kref kref; member
61 kref_get(&n->kref); in cec_notifier_get_conn()
81 kref_init(&n->kref); in cec_notifier_get_conn()
88 static void cec_notifier_release(struct kref *kref) in cec_notifier_release() argument
91 container_of(kref, struct cec_notifier, kref); in cec_notifier_release()
101 kref_put(&n->kref, cec_notifier_release); in cec_notifier_put()
/linux-6.6.21/net/batman-adv/
Dtypes.h190 struct kref refcount;
274 struct kref refcount;
344 struct kref refcount;
497 struct kref refcount;
572 struct kref refcount;
631 struct kref refcount;
666 struct kref refcount;
735 struct kref refcount;
1482 struct kref refcount;
1510 struct kref refcount;
[all …]
Doriginator.h24 void batadv_orig_node_release(struct kref *ref);
30 void batadv_hardif_neigh_release(struct kref *ref);
35 void batadv_neigh_node_release(struct kref *ref);
45 void batadv_neigh_ifinfo_release(struct kref *ref);
55 void batadv_orig_ifinfo_release(struct kref *ref);
64 void batadv_orig_node_vlan_release(struct kref *ref);
/linux-6.6.21/include/drm/
Ddrm_syncobj.h43 struct kref refcount;
70 void drm_syncobj_free(struct kref *kref);
129 void drm_syncobj_free(struct kref *kref);
/linux-6.6.21/net/ceph/
Dbuffer.c26 kref_init(&b->kref); in ceph_buffer_new()
34 void ceph_buffer_release(struct kref *kref) in ceph_buffer_release() argument
36 struct ceph_buffer *b = container_of(kref, struct ceph_buffer, kref); in ceph_buffer_release()
/linux-6.6.21/include/net/
Dtls_toe.h68 void (*release)(struct kref *kref);
69 struct kref kref; member
/linux-6.6.21/drivers/usb/misc/
Dusblcd.c51 struct kref kref; member
60 #define to_lcd_dev(d) container_of(d, struct usb_lcd, kref)
67 static void lcd_delete(struct kref *kref) in lcd_delete() argument
69 struct usb_lcd *dev = to_lcd_dev(kref); in lcd_delete()
95 kref_get(&dev->kref); in lcd_open()
100 kref_put(&dev->kref, lcd_delete); in lcd_open()
120 kref_put(&dev->kref, lcd_delete); in lcd_release()
330 kref_init(&dev->kref); in lcd_probe()
388 kref_put(&dev->kref, lcd_delete); in lcd_probe()
431 kref_put(&dev->kref, lcd_delete); in lcd_disconnect()
/linux-6.6.21/drivers/misc/vmw_vmci/
Dvmci_resource.c124 kref_init(&resource->kref); in vmci_resource_add()
185 kref_get(&resource->kref); in vmci_resource_get()
190 static void vmci_release_resource(struct kref *kref) in vmci_release_resource() argument
193 container_of(kref, struct vmci_resource, kref); in vmci_release_resource()
214 return kref_put(&resource->kref, vmci_release_resource) ? in vmci_resource_put()
/linux-6.6.21/arch/s390/pci/
Dpci_bus.h19 void zpci_release_device(struct kref *kref);
23 kref_put(&zdev->kref, zpci_release_device); in zpci_zdev_put()
28 kref_get(&zdev->kref); in zpci_zdev_get()
/linux-6.6.21/drivers/hid/
Dhid-cougar.c70 struct kref kref; member
126 kref_get(&shared->kref); in cougar_get_shared_data()
133 static void cougar_release_shared_data(struct kref *kref) in cougar_release_shared_data() argument
135 struct cougar_shared *shared = container_of(kref, in cougar_release_shared_data()
136 struct cougar_shared, kref); in cougar_release_shared_data()
150 kref_put(&cougar->shared->kref, cougar_release_shared_data); in cougar_remove_shared_data()
175 kref_init(&shared->kref); in cougar_bind_shared_data()

12345678910>>...32