Home
last modified time | relevance | path

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

12345678910>>...32

/openbmc/linux/include/linux/
H A Dkref.h19 struct kref { struct
29 static inline void kref_init(struct kref *kref) in kref_init() argument
34 static inline unsigned int kref_read(const struct kref *kref) in kref_read() argument
43 static inline void kref_get(struct kref *kref) in kref_get() argument
62 static inline int kref_put(struct kref *kref, void (*release)(struct kref *kref)) in kref_put() argument
65 release(kref); in kref_put()
71 static inline int kref_put_mutex(struct kref *kref, in kref_put_mutex() argument
72 void (*release)(struct kref *kref), in kref_put_mutex() argument
76 release(kref); in kref_put_mutex()
82 static inline int kref_put_lock(struct kref *kref, in kref_put_lock() argument
[all …]
/openbmc/linux/drivers/target/iscsi/cxgbit/
H A 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()
260 kref_get(&csk->kref); in cxgbit_get_csk()
265 kref_put(&csk->kref, _cxgbit_free_csk); in cxgbit_put_csk()
270 kref_get(&cnp->kref); in cxgbit_get_cnp()
[all …]
/openbmc/linux/Documentation/translations/zh_CN/core-api/
H A 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,你必须遵循以下规则:
80 在没有已经持有有效指针的情况下获得一个kref-ed结构体的有效指针,那么在没
89 void data_release(struct kref *ref)
176 struct kref refcount;
[all …]
/openbmc/linux/include/linux/ceph/
H A 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()
H A 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)) \
/openbmc/linux/drivers/gpu/drm/i915/
H A 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()
H A Di915_drm_client.c28 kref_init(&client->kref); in i915_drm_client_alloc()
35 void __i915_drm_client_free(struct kref *kref) in __i915_drm_client_free() argument
38 container_of(kref, typeof(*client), kref); in __i915_drm_client_free()
/openbmc/linux/arch/powerpc/platforms/cell/spufs/
H A 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()
H A 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()
/openbmc/linux/drivers/gpu/drm/amd/display/dc/core/
H A Ddc_surface.c181 static void dc_plane_state_free(struct kref *kref) in dc_plane_state_free() argument
183 struct dc_plane_state *plane_state = container_of(kref, struct dc_plane_state, refcount); in dc_plane_state_free()
198 static void dc_gamma_free(struct kref *kref) in dc_gamma_free() argument
200 struct dc_gamma *gamma = container_of(kref, struct dc_gamma, refcount); in dc_gamma_free()
229 static void dc_transfer_func_free(struct kref *kref) in dc_transfer_func_free() argument
231 struct dc_transfer_func *tf = container_of(kref, struct dc_transfer_func, refcount); in dc_transfer_func_free()
255 static void dc_3dlut_func_free(struct kref *kref) in dc_3dlut_func_free() argument
257 struct dc_3dlut *lut = container_of(kref, struct dc_3dlut, refcount); in dc_3dlut_func_free()
/openbmc/linux/security/integrity/
H A 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()
/openbmc/linux/drivers/gpu/drm/nouveau/nvkm/engine/fifo/
H A 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()
/openbmc/linux/drivers/gpu/drm/msm/
H A 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()
/openbmc/linux/drivers/gpu/drm/vmwgfx/
H A 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
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()
378 kref_put(&ref->kref, ttm_ref_object_release); in ttm_ref_object_base_unref()
[all …]
/openbmc/linux/include/drm/
H A Ddrm_syncobj.h43 struct kref refcount;
70 void drm_syncobj_free(struct kref *kref);
129 void drm_syncobj_free(struct kref *kref);
/openbmc/linux/net/ceph/
H A 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()
/openbmc/linux/drivers/acpi/
H A 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()
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()
228 kref_get(&tx_msg->kref); in acpi_ipmi_msg_get()
[all …]
/openbmc/linux/include/net/
H A Dtls_toe.h68 void (*release)(struct kref *kref);
69 struct kref kref; member
/openbmc/linux/drivers/gpu/drm/nouveau/nvkm/core/
H A 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()
/openbmc/linux/drivers/misc/eeprom/
H A Dee1004.c44 struct kref kref; member
179 static void ee1004_bus_release(struct kref *kref) in ee1004_bus_release() argument
181 struct ee1004_bus *bus = container_of(kref, struct ee1004_bus, kref); in ee1004_bus_release()
210 kref_init(&bus->kref); in ee1004_bus_initialize()
234 kref_get(&bus->kref); in ee1004_probe()
269 kref_put(&bus->kref, ee1004_bus_release); in ee1004_remove()
/openbmc/linux/drivers/media/cec/core/
H A 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()
/openbmc/linux/net/batman-adv/
H A 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);
H A 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 …]
/openbmc/linux/arch/s390/pci/
H A 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()
/openbmc/linux/drivers/misc/vmw_vmci/
H A Dvmci_resource.c124 kref_init(&resource->kref); in vmci_resource_add()
186 kref_get(&resource->kref); in vmci_resource_get()
191 static void vmci_release_resource(struct kref *kref) in vmci_release_resource() argument
194 container_of(kref, struct vmci_resource, kref); in vmci_release_resource()
215 return kref_put(&resource->kref, vmci_release_resource) ? in vmci_resource_put()

12345678910>>...32