/Linux-v5.15/tools/testing/radix-tree/ |
D | idr-test.c | 25 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 …]
|
D | Makefile | 7 TARGETS = main idr-test multiorder xarray 8 CORE_OFILES := xarray.o radix-tree.o idr.o linux.o test.o find_bit.o bitmap.o 10 regression4.o tag_check.o multiorder.o idr-test.o iteration_check.o \ 26 idr-test.o: ../../../lib/test_ida.c 27 idr-test: idr-test.o $(CORE_OFILES) 34 $(RM) $(TARGETS) *.o radix-tree.c idr.c generated/map-shift.h 43 ../../../include/linux/idr.h 48 idr.c: ../../../lib/idr.c
|
D | .gitignore | 3 idr.c 4 idr-test
|
/Linux-v5.15/include/linux/ |
D | idr.h | 19 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 …]
|
D | powercap.h | 66 struct idr idr; member 143 struct idr idr; member 144 struct idr *parent_idr;
|
D | pid_namespace.h | 20 struct idr idr; member
|
/Linux-v5.15/lib/ |
D | idr.c | 33 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-v5.15/drivers/reset/ |
D | reset-ti-sci.c | 48 struct idr idr; member 80 control = idr_find(&data->idr, id); in ti_sci_reset_set() 161 control = idr_find(&data->idr, id); in ti_sci_reset_status() 209 return idr_alloc(&data->idr, control, 0, 0, GFP_KERNEL); in ti_sci_reset_of_xlate() 239 idr_init(&data->idr); in ti_sci_reset_probe() 252 idr_destroy(&data->idr); in ti_sci_reset_remove()
|
/Linux-v5.15/fs/ksmbd/ |
D | vfs_cache.c | 284 idr_remove(global_ft.idr, fp->persistent_id); in __ksmbd_remove_durable_fd() 298 idr_remove(ft->idr, fp->volatile_id); in __ksmbd_remove_fd() 353 fp = idr_find(ft->idr, id); in __ksmbd_lookup_fd() 390 fp = idr_find(ft->idr, id); in ksmbd_close_fd() 474 idr_for_each_entry(global_ft.idr, fp, id) { in ksmbd_lookup_fd_cguid() 533 ret = idr_alloc_cyclic(ft->idr, fp, 0, INT_MAX - 1, GFP_NOWAIT); in __open_id() 607 idr_for_each_entry(ft->idr, fp, id) { in __close_file_table_ids() 661 idr_for_each_entry(global_ft.idr, fp, id) { in ksmbd_free_global_file_table() 671 ft->idr = kzalloc(sizeof(struct idr), GFP_KERNEL); in ksmbd_init_file_table() 672 if (!ft->idr) in ksmbd_init_file_table() [all …]
|
/Linux-v5.15/drivers/gpu/drm/vc4/ |
D | vc4_perfmon.c | 70 perfmon = idr_find(&vc4file->perfmon.idr, id); in vc4_perfmon_find() 80 idr_init_base(&vc4file->perfmon.idr, VC4_PERFMONID_MIN); in vc4_perfmon_open_file() 95 idr_for_each(&vc4file->perfmon.idr, vc4_perfmon_idr_del, NULL); in vc4_perfmon_close_file() 96 idr_destroy(&vc4file->perfmon.idr); in vc4_perfmon_close_file() 139 ret = idr_alloc(&vc4file->perfmon.idr, perfmon, VC4_PERFMONID_MIN, in vc4_perfmon_create_ioctl() 166 perfmon = idr_remove(&vc4file->perfmon.idr, req->id); in vc4_perfmon_destroy_ioctl() 191 perfmon = idr_find(&vc4file->perfmon.idr, req->id); in vc4_perfmon_get_values_ioctl()
|
/Linux-v5.15/fs/notify/inotify/ |
D | inotify_user.c | 324 idr_set_cursor(&data->idr, (unsigned int)arg); in inotify_ioctl() 372 static int inotify_add_to_idr(struct idr *idr, spinlock_t *idr_lock, in inotify_add_to_idr() argument 380 ret = idr_alloc_cyclic(idr, i_mark, 1, 0, GFP_NOWAIT); in inotify_add_to_idr() 395 struct idr *idr = &group->inotify_data.idr; in inotify_idr_find_locked() local 401 i_mark = idr_find(idr, wd); in inotify_idr_find_locked() 433 struct idr *idr = &group->inotify_data.idr; in inotify_remove_from_idr() local 484 idr_remove(idr, wd); in inotify_remove_from_idr() 576 struct idr *idr = &group->inotify_data.idr; in inotify_new_watch() local 589 ret = inotify_add_to_idr(idr, idr_lock, tmp_i_mark); in inotify_new_watch() 659 idr_init(&group->inotify_data.idr); in inotify_new_group()
|
/Linux-v5.15/drivers/gpu/drm/v3d/ |
D | v3d_perfmon.c | 87 perfmon = idr_find(&v3d_priv->perfmon.idr, id); in v3d_perfmon_find() 97 idr_init(&v3d_priv->perfmon.idr); in v3d_perfmon_open_file() 112 idr_for_each(&v3d_priv->perfmon.idr, v3d_perfmon_idr_del, NULL); in v3d_perfmon_close_file() 113 idr_destroy(&v3d_priv->perfmon.idr); in v3d_perfmon_close_file() 151 ret = idr_alloc(&v3d_priv->perfmon.idr, perfmon, V3D_PERFMONID_MIN, in v3d_perfmon_create_ioctl() 173 perfmon = idr_remove(&v3d_priv->perfmon.idr, req->id); in v3d_perfmon_destroy_ioctl() 197 perfmon = idr_find(&v3d_priv->perfmon.idr, req->id); in v3d_perfmon_get_values_ioctl()
|
/Linux-v5.15/include/drm/ |
D | drm_auth.h | 82 struct idr magic_map; 139 struct idr leases; 147 struct idr lessee_idr;
|
D | drm_device.h | 275 struct idr object_name_idr; 322 struct idr ctx_idr;
|
/Linux-v5.15/kernel/ |
D | pid.c | 77 .idr = IDR_INIT(init_pid_ns.idr), 152 idr_remove(&ns->idr, upid->nr); in free_pid() 212 nr = idr_alloc(&tmp->idr, NULL, tid, in alloc_pid() 226 if (idr_get_cursor(&tmp->idr) > RESERVED_PIDS) in alloc_pid() 233 nr = idr_alloc_cyclic(&tmp->idr, NULL, pid_min, in alloc_pid() 274 idr_replace(&upid->ns->idr, pid, upid->nr); in alloc_pid() 289 idr_remove(&upid->ns->idr, upid->nr); in alloc_pid() 294 idr_set_cursor(&ns->idr, 0); in alloc_pid() 311 return idr_find(&ns->idr, nr); in find_pid_ns() 520 return idr_get_next(&ns->idr, &nr); in find_ge_pid() [all …]
|
D | pid_namespace.c | 95 idr_init(&ns->idr); in create_pid_namespace() 116 idr_destroy(&ns->idr); in create_pid_namespace() 138 idr_destroy(&ns->idr); in destroy_pid_namespace() 202 idr_for_each_entry_continue(&pid_ns->idr, pid, nr) { in zap_pid_ns_processes() 275 next = idr_get_cursor(&pid_ns->idr) - 1; in pid_ns_ctl_handler() 280 idr_set_cursor(&pid_ns->idr, next + 1); in pid_ns_ctl_handler()
|
/Linux-v5.15/drivers/tee/optee/ |
D | supp.c | 27 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-v5.15/drivers/infiniband/core/ |
D | rdma_core.c | 303 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-v5.15/drivers/firmware/arm_scmi/ |
D | driver.c | 145 struct idr tx_idr; 146 struct idr rx_idr; 147 struct idr protocols; 151 struct idr active_protocols; 1474 struct idr *idr; in scmi_chan_setup() local 1478 idr = tx ? &info->tx_idr : &info->rx_idr; in scmi_chan_setup() 1481 cinfo = idr_find(idr, prot_id); in scmi_chan_setup() 1486 cinfo = idr_find(idr, SCMI_PROTOCOL_BASE); in scmi_chan_setup() 1503 ret = idr_alloc(idr, cinfo, prot_id, prot_id + 1, GFP_KERNEL); in scmi_chan_setup() 1793 struct idr *idr = &info->tx_idr; in scmi_cleanup_txrx_channels() local [all …]
|
/Linux-v5.15/Documentation/core-api/ |
D | idr.rst | 66 .. kernel-doc:: include/linux/idr.h 67 :doc: idr sync 72 .. kernel-doc:: lib/idr.c 78 .. kernel-doc:: include/linux/idr.h 80 .. kernel-doc:: lib/idr.c
|
/Linux-v5.15/drivers/tee/ |
D | tee_private.h | 57 struct idr idr; member
|
D | tee_shm.c | 37 idr_remove(&teedev->idr, shm->id); in tee_shm_release() 158 shm->id = idr_alloc(&teedev->idr, shm, 1, 0, GFP_KERNEL); in tee_shm_alloc() 183 idr_remove(&teedev->idr, shm->id); in tee_shm_alloc() 291 shm->id = idr_alloc(&teedev->idr, shm, 1, 0, GFP_KERNEL); in tee_shm_register() 327 idr_remove(&teedev->idr, shm->id); in tee_shm_register() 480 shm = idr_find(&teedev->idr, id); in tee_shm_get_from_id()
|
/Linux-v5.15/drivers/gpu/drm/vmwgfx/ |
D | ttm_object.c | 97 struct idr idr; member 177 ret = idr_alloc(&tdev->idr, base, 1, 0, GFP_NOWAIT); in ttm_base_object_init() 193 idr_remove(&tdev->idr, base->handle); in ttm_base_object_init() 205 idr_remove(&tdev->idr, base->handle); in ttm_release_base() 290 base = idr_find(&tdev->idr, key); in ttm_base_object_lookup_for_ref() 543 idr_init_base(&tdev->idr, 1); in ttm_object_device_init() 562 WARN_ON_ONCE(!idr_is_empty(&tdev->idr)); in ttm_object_device_release() 563 idr_destroy(&tdev->idr); in ttm_object_device_release()
|
/Linux-v5.15/drivers/net/ethernet/mellanox/mlx5/core/fpga/ |
D | tls.h | 48 struct idr tx_idr; 49 struct idr rx_idr;
|
/Linux-v5.15/drivers/scsi/cxlflash/ |
D | ocxl_hw.h | 39 struct idr idr; /* IDR to manage contexts */ member
|