Home
last modified time | relevance | path

Searched refs:idr (Results 1 – 25 of 177) sorted by relevance

12345678

/linux-6.6.21/tools/testing/radix-tree/
Didr-test.c25 void item_idr_remove(struct idr *idr, int id) in item_idr_remove() argument
27 struct item *item = idr_find(idr, id); in item_idr_remove()
29 idr_remove(idr, id); in item_idr_remove()
36 DEFINE_IDR(idr); in idr_alloc_test()
38 assert(idr_alloc_cyclic(&idr, DUMMY_PTR, 0, 0x4000, GFP_KERNEL) == 0); in idr_alloc_test()
39 assert(idr_alloc_cyclic(&idr, DUMMY_PTR, 0x3ffd, 0x4000, GFP_KERNEL) == 0x3ffd); in idr_alloc_test()
40 idr_remove(&idr, 0x3ffd); in idr_alloc_test()
41 idr_remove(&idr, 0); in idr_alloc_test()
52 id = idr_alloc_cyclic(&idr, item, 1, 0x4000, GFP_KERNEL); in idr_alloc_test()
56 idr_for_each(&idr, item_idr_free, &idr); in idr_alloc_test()
[all …]
DMakefile7 TARGETS = main idr-test multiorder xarray maple
8 CORE_OFILES := xarray.o radix-tree.o idr.o linux.o test.o find_bit.o bitmap.o \
11 regression4.o tag_check.o multiorder.o idr-test.o iteration_check.o \
32 idr-test.o: ../../../lib/test_ida.c
33 idr-test: idr-test.o $(CORE_OFILES)
42 $(RM) $(TARGETS) *.o radix-tree.c idr.c generated/map-shift.h generated/bit-length.h
53 ../../../include/linux/idr.h
58 idr.c: ../../../lib/idr.c
D.gitignore4 idr.c
5 idr-test
/linux-6.6.21/include/linux/
Didr.h19 struct idr { struct
56 #define DEFINE_IDR(name) struct idr name = IDR_INIT(name)
66 static inline unsigned int idr_get_cursor(const struct idr *idr) in idr_get_cursor() argument
68 return READ_ONCE(idr->idr_next); in idr_get_cursor()
79 static inline void idr_set_cursor(struct idr *idr, unsigned int val) in idr_set_cursor() argument
81 WRITE_ONCE(idr->idr_next, val); in idr_set_cursor()
101 #define idr_lock(idr) xa_lock(&(idr)->idr_rt) argument
102 #define idr_unlock(idr) xa_unlock(&(idr)->idr_rt) argument
103 #define idr_lock_bh(idr) xa_lock_bh(&(idr)->idr_rt) argument
104 #define idr_unlock_bh(idr) xa_unlock_bh(&(idr)->idr_rt) argument
[all …]
Dpowercap.h66 struct idr idr; member
143 struct idr idr; member
144 struct idr *parent_idr;
Dpid_namespace.h27 struct idr idr; member
/linux-6.6.21/lib/
Didr.c33 int idr_alloc_u32(struct idr *idr, void *ptr, u32 *nextid, in idr_alloc_u32() argument
38 unsigned int base = idr->idr_base; in idr_alloc_u32()
41 if (WARN_ON_ONCE(!(idr->idr_rt.xa_flags & ROOT_IS_IDR))) in idr_alloc_u32()
42 idr->idr_rt.xa_flags |= IDR_RT_MARKER; in idr_alloc_u32()
46 slot = idr_get_free(&idr->idr_rt, &iter, gfp, max - base); in idr_alloc_u32()
52 radix_tree_iter_replace(&idr->idr_rt, &iter, slot, ptr); in idr_alloc_u32()
53 radix_tree_iter_tag_clear(&idr->idr_rt, &iter, IDR_FREE); in idr_alloc_u32()
79 int idr_alloc(struct idr *idr, void *ptr, int start, int end, gfp_t gfp) in idr_alloc() argument
87 ret = idr_alloc_u32(idr, ptr, &id, end > 0 ? end - 1 : INT_MAX, gfp); in idr_alloc()
117 int idr_alloc_cyclic(struct idr *idr, void *ptr, int start, int end, gfp_t gfp) in idr_alloc_cyclic() argument
[all …]
/linux-6.6.21/Documentation/translations/zh_CN/core-api/
Didr.rst5 :Original: Documentation/core-api/idr.rst
66 IDR同步的相关内容请见include/linux/idr.h文件中的“DOC: idr sync”。
71 IDA的用法的相关内容请见lib/idr.c文件中的“DOC: IDA description”。
78 include/linux/idr.h
80 lib/idr.c
/linux-6.6.21/drivers/reset/
Dreset-ti-sci.c40 struct idr idr; member
72 control = idr_find(&data->idr, id); in ti_sci_reset_set()
153 control = idr_find(&data->idr, id); in ti_sci_reset_status()
201 return idr_alloc(&data->idr, control, 0, 0, GFP_KERNEL); in ti_sci_reset_of_xlate()
231 idr_init(&data->idr); in ti_sci_reset_probe()
244 idr_destroy(&data->idr); in ti_sci_reset_remove()
/linux-6.6.21/fs/smb/server/
Dvfs_cache.c283 idr_remove(global_ft.idr, fp->persistent_id); in __ksmbd_remove_durable_fd()
297 idr_remove(ft->idr, fp->volatile_id); in __ksmbd_remove_fd()
354 fp = idr_find(ft->idr, id); in __ksmbd_lookup_fd()
390 fp = idr_find(ft->idr, id); in ksmbd_close_fd()
479 idr_for_each_entry(global_ft.idr, fp, id) { in ksmbd_lookup_fd_cguid()
542 ret = idr_alloc_cyclic(ft->idr, fp, 0, INT_MAX - 1, GFP_NOWAIT); in __open_id()
628 idr_for_each_entry(ft->idr, fp, id) { in __close_file_table_ids()
682 idr_for_each_entry(global_ft.idr, fp, id) { in ksmbd_free_global_file_table()
692 ft->idr = kzalloc(sizeof(struct idr), GFP_KERNEL); in ksmbd_init_file_table()
693 if (!ft->idr) in ksmbd_init_file_table()
[all …]
/linux-6.6.21/fs/notify/inotify/
Dinotify_user.c347 idr_set_cursor(&data->idr, (unsigned int)arg); in inotify_ioctl()
395 static int inotify_add_to_idr(struct idr *idr, spinlock_t *idr_lock, in inotify_add_to_idr() argument
403 ret = idr_alloc_cyclic(idr, i_mark, 1, 0, GFP_NOWAIT); in inotify_add_to_idr()
418 struct idr *idr = &group->inotify_data.idr; in inotify_idr_find_locked() local
424 i_mark = idr_find(idr, wd); in inotify_idr_find_locked()
456 struct idr *idr = &group->inotify_data.idr; in inotify_remove_from_idr() local
507 idr_remove(idr, wd); in inotify_remove_from_idr()
597 struct idr *idr = &group->inotify_data.idr; in inotify_new_watch() local
609 ret = inotify_add_to_idr(idr, idr_lock, tmp_i_mark); in inotify_new_watch()
680 idr_init(&group->inotify_data.idr); in inotify_new_group()
/linux-6.6.21/drivers/gpu/drm/v3d/
Dv3d_perfmon.c90 perfmon = idr_find(&v3d_priv->perfmon.idr, id); in v3d_perfmon_find()
100 idr_init_base(&v3d_priv->perfmon.idr, 1); in v3d_perfmon_open_file()
115 idr_for_each(&v3d_priv->perfmon.idr, v3d_perfmon_idr_del, NULL); in v3d_perfmon_close_file()
116 idr_destroy(&v3d_priv->perfmon.idr); in v3d_perfmon_close_file()
155 ret = idr_alloc(&v3d_priv->perfmon.idr, perfmon, V3D_PERFMONID_MIN, in v3d_perfmon_create_ioctl()
178 perfmon = idr_remove(&v3d_priv->perfmon.idr, req->id); in v3d_perfmon_destroy_ioctl()
202 perfmon = idr_find(&v3d_priv->perfmon.idr, req->id); in v3d_perfmon_get_values_ioctl()
/linux-6.6.21/sound/soc/qcom/qdsp6/
Dq6apm.h64 struct idr graph_idr;
65 struct idr graph_info_idr;
66 struct idr sub_graphs_idr;
67 struct idr containers_idr;
68 struct idr modules_idr;
/linux-6.6.21/drivers/gpu/drm/vc4/
Dvc4_perfmon.c97 perfmon = idr_find(&vc4file->perfmon.idr, id); in vc4_perfmon_find()
112 idr_init_base(&vc4file->perfmon.idr, VC4_PERFMONID_MIN); in vc4_perfmon_open_file()
133 idr_for_each(&vc4file->perfmon.idr, vc4_perfmon_idr_del, NULL); in vc4_perfmon_close_file()
134 idr_destroy(&vc4file->perfmon.idr); in vc4_perfmon_close_file()
182 ret = idr_alloc(&vc4file->perfmon.idr, perfmon, VC4_PERFMONID_MIN, in vc4_perfmon_create_ioctl()
212 perfmon = idr_remove(&vc4file->perfmon.idr, req->id); in vc4_perfmon_destroy_ioctl()
240 perfmon = idr_find(&vc4file->perfmon.idr, req->id); in vc4_perfmon_get_values_ioctl()
/linux-6.6.21/include/drm/
Ddrm_auth.h82 struct idr magic_map;
139 struct idr leases;
147 struct idr lessee_idr;
Ddrm_device.h288 struct idr object_name_idr;
350 struct idr ctx_idr;
/linux-6.6.21/kernel/
Dpid.c77 .idr = IDR_INIT(init_pid_ns.idr),
155 idr_remove(&ns->idr, upid->nr); in free_pid()
215 nr = idr_alloc(&tmp->idr, NULL, tid, in alloc_pid()
229 if (idr_get_cursor(&tmp->idr) > RESERVED_PIDS) in alloc_pid()
236 nr = idr_alloc_cyclic(&tmp->idr, NULL, pid_min, in alloc_pid()
277 idr_replace(&upid->ns->idr, pid, upid->nr); in alloc_pid()
292 idr_remove(&upid->ns->idr, upid->nr); in alloc_pid()
297 idr_set_cursor(&ns->idr, 0); in alloc_pid()
314 return idr_find(&ns->idr, nr); in find_pid_ns()
523 return idr_get_next(&ns->idr, &nr); in find_ge_pid()
[all …]
Dpid_namespace.c96 idr_init(&ns->idr); in create_pid_namespace()
119 idr_destroy(&ns->idr); in create_pid_namespace()
141 idr_destroy(&ns->idr); in destroy_pid_namespace()
205 idr_for_each_entry_continue(&pid_ns->idr, pid, nr) { in zap_pid_ns_processes()
295 next = idr_get_cursor(&pid_ns->idr) - 1; in pid_ns_ctl_handler()
300 idr_set_cursor(&pid_ns->idr, next + 1); in pid_ns_ctl_handler()
/linux-6.6.21/drivers/tee/optee/
Dsupp.c27 idr_init(&supp->idr); in optee_supp_init()
35 idr_destroy(&supp->idr); in optee_supp_uninit()
47 idr_for_each_entry(&supp->idr, req, id) { in optee_supp_release()
48 idr_remove(&supp->idr, id); in optee_supp_release()
175 *id = idr_alloc(&supp->idr, req, 1, 0, GFP_KERNEL); in supp_pop_entry()
315 req = idr_find(&supp->idr, id); in supp_pop_req()
322 idr_remove(&supp->idr, id); in supp_pop_req()
/linux-6.6.21/drivers/gpu/drm/vmwgfx/
Dttm_object.c100 struct idr idr; member
206 ret = idr_alloc(&tdev->idr, base, 1, 0, GFP_NOWAIT); in ttm_base_object_init()
222 idr_remove(&tdev->idr, base->handle); in ttm_base_object_init()
234 idr_remove(&tdev->idr, base->handle); in ttm_release_base()
284 base = idr_find(&tdev->idr, key); in ttm_base_object_lookup_for_ref()
444 idr_init_base(&tdev->idr, VMWGFX_NUM_MOB + 1); in ttm_object_device_init()
457 WARN_ON_ONCE(!idr_is_empty(&tdev->idr)); in ttm_object_device_release()
458 idr_destroy(&tdev->idr); in ttm_object_device_release()
/linux-6.6.21/drivers/tee/
Dtee_shm.c148 id = idr_alloc(&teedev->idr, NULL, 1, 0, GFP_KERNEL); in tee_shm_alloc_user_buf()
156 idr_remove(&teedev->idr, id); in tee_shm_alloc_user_buf()
162 ret = idr_replace(&teedev->idr, shm, id); in tee_shm_alloc_user_buf()
317 id = idr_alloc(&teedev->idr, NULL, 1, 0, GFP_KERNEL); in tee_shm_register_user_buf()
325 idr_remove(&teedev->idr, id); in tee_shm_register_user_buf()
331 ret = idr_replace(&teedev->idr, shm, id); in tee_shm_register_user_buf()
471 shm = idr_find(&teedev->idr, id); in tee_shm_get_from_id()
504 idr_remove(&teedev->idr, shm->id); in tee_shm_put()
Dtee_private.h46 struct idr idr; member
/linux-6.6.21/drivers/infiniband/core/
Drdma_core.c303 return xa_alloc(&uobj->ufile->idr, &uobj->id, NULL, xa_limit_32b, in idr_add_uobj()
325 uobj = xa_load(&ufile->idr, id); in lookup_get_idr_uobject()
446 xa_erase(&attrs->ufile->idr, uobj->id); in alloc_begin_idr_uobject()
528 xa_erase(&uobj->ufile->idr, uobj->id); in alloc_abort_idr_uobject()
554 xa_erase(&uobj->ufile->idr, uobj->id); in remove_handle_idr_uobject()
594 old = xa_store(&ufile->idr, uobj->id, uobj, GFP_KERNEL); in alloc_commit_idr_uobject()
608 old = xa_cmpxchg(&ufile->idr, obj_old->id, obj_old, XA_ZERO_ENTRY, in swap_idr_uobjects()
615 old = xa_cmpxchg(&ufile->idr, obj_old->id, NULL, obj_old, GFP_KERNEL); in swap_idr_uobjects()
768 xa_init_flags(&ufile->idr, XA_FLAGS_ALLOC); in setup_ufile_idr_uobject()
784 xa_for_each(&ufile->idr, id, entry) { in release_ufile_idr_uobject()
[all …]
/linux-6.6.21/Documentation/core-api/
Didr.rst69 .. kernel-doc:: include/linux/idr.h
70 :doc: idr sync
75 .. kernel-doc:: lib/idr.c
81 .. kernel-doc:: include/linux/idr.h
83 .. kernel-doc:: lib/idr.c
/linux-6.6.21/drivers/scsi/cxlflash/
Docxl_hw.h39 struct idr idr; /* IDR to manage contexts */ member

12345678