| /linux/tools/testing/radix-tree/ |
| H A 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 …]
|
| H A D | Makefile | 5 TARGETS = main idr-test multiorder xarray maple 8 regression3.o regression4.o tag_check.o multiorder.o idr-test.o \ 18 idr-test.o: ../../../lib/test_ida.c 19 idr-test: idr-test.o $(CORE_OFILES) 28 $(RM) $(TARGETS) *.o radix-tree.c idr.c generated/*
|
| H A D | .gitignore | 5 idr.c 6 idr-test
|
| /linux/include/linux/ |
| H A D | idr.h | 20 struct idr { struct 57 #define DEFINE_IDR(name) struct idr name = IDR_INIT(name) 67 static inline unsigned int idr_get_cursor(const struct idr *idr) in idr_get_cursor() argument 69 return READ_ONCE(idr->idr_next); in idr_get_cursor() 80 static inline void idr_set_cursor(struct idr *idr, unsigned int val) in idr_set_cursor() argument 82 WRITE_ONCE(idr->idr_next, val); in idr_set_cursor() 102 #define idr_lock(idr) xa_lock(&(idr)->idr_rt) argument 103 #define idr_unlock(idr) xa_unlock(&(idr)->idr_rt) argument 104 #define idr_lock_bh(idr) xa_lock_bh(&(idr)->idr_rt) argument 105 #define idr_unlock_bh(idr) xa_unlock_bh(&(idr)->idr_rt) argument [all …]
|
| /linux/lib/ |
| H A 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() 48 slot = idr_get_free(&idr->idr_rt, &iter, gfp, max - base); in idr_alloc_u32() 54 radix_tree_iter_replace(&idr->idr_rt, &iter, slot, ptr); in idr_alloc_u32() 55 radix_tree_iter_tag_clear(&idr->idr_rt, &iter, IDR_FREE); in idr_alloc_u32() 81 int idr_alloc(struct idr *idr, void *ptr, int start, int end, gfp_t gfp) in idr_alloc() argument 89 ret = idr_alloc_u32(idr, ptr, &id, end > 0 ? end - 1 : INT_MAX, gfp); in idr_alloc() 119 int idr_alloc_cyclic(struct idr *idr, void *ptr, int start, int end, gfp_t gfp) in idr_alloc_cyclic() argument [all …]
|
| /linux/Documentation/translations/zh_CN/core-api/ |
| H A D | idr.rst | 5 :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/drivers/reset/ |
| H A D | reset-ti-sci.c | 40 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/fs/notify/inotify/ |
| H A D | inotify_user.c | 346 idr_set_cursor(&data->idr, (unsigned int)arg); in inotify_ioctl() 394 static int inotify_add_to_idr(struct idr *idr, spinlock_t *idr_lock, in inotify_add_to_idr() argument 402 ret = idr_alloc_cyclic(idr, i_mark, 1, 0, GFP_NOWAIT); in inotify_add_to_idr() 417 struct idr *idr = &group->inotify_data.idr; in inotify_idr_find_locked() local 423 i_mark = idr_find(idr, wd); in inotify_idr_find_locked() 455 struct idr *idr = &group->inotify_data.idr; in inotify_remove_from_idr() local 506 idr_remove(idr, wd); in inotify_remove_from_idr() 583 struct idr *idr = &group->inotify_data.idr; in inotify_new_watch() local 595 ret = inotify_add_to_idr(idr, idr_lock, tmp_i_mark); in inotify_new_watch() 667 idr_init(&group->inotify_data.idr); in inotify_new_group()
|
| H A D | inotify_fsnotify.c | 181 idr_for_each(&group->inotify_data.idr, idr_callback, group); in inotify_free_group_priv() 182 idr_destroy(&group->inotify_data.idr); in inotify_free_group_priv()
|
| /linux/drivers/tee/optee/ |
| H A D | supp.c | 34 idr_init(&supp->idr); in optee_supp_init() 42 idr_destroy(&supp->idr); in optee_supp_uninit() 53 idr_for_each_entry(&supp->idr, req, id) { in optee_supp_release() 54 idr_remove(&supp->idr, id); in optee_supp_release() 112 req->id = idr_alloc(&supp->idr, req, 1, 0, GFP_KERNEL); in optee_supp_thrd_req() 138 idr_remove(&supp->idr, req->id); in optee_supp_thrd_req() 158 idr_replace(&supp->idr, INVALID_REQ_PTR, req->id); in optee_supp_thrd_req() 332 req = idr_find(&supp->idr, id); in supp_pop_req() 345 idr_remove(&supp->idr, id); in supp_pop_req()
|
| /linux/sound/soc/qcom/qdsp6/ |
| H A D | q6apm.h | 66 struct idr graph_idr; 67 struct idr graph_info_idr; 68 struct idr sub_graphs_idr; 69 struct idr containers_idr; 70 struct idr modules_idr;
|
| /linux/include/drm/ |
| H A D | drm_auth.h | 64 struct idr magic_map; 121 struct idr leases; 129 struct idr lessee_idr;
|
| /linux/fs/smb/server/ |
| H A D | vfs_cache.c | 125 idr_for_each_entry(global_ft.idr, fp, id) { in proc_show_files() 582 idr_remove(global_ft.idr, fp->persistent_id); in __ksmbd_remove_durable_fd() 612 idr_remove(ft->idr, fp->volatile_id); in __ksmbd_remove_fd() 815 fp = idr_find(ft->idr, id); in __ksmbd_lookup_fd() 866 fp = idr_find(ft->idr, id); in ksmbd_close_fd() 874 idr_remove(ft->idr, id); in ksmbd_close_fd() 1005 idr_for_each_entry(global_ft.idr, fp, id) { in ksmbd_lookup_fd_app_instance_id() 1043 idr_remove(ft->idr, fp->volatile_id); in ksmbd_close_fd_app_instance_id() 1103 idr_for_each_entry(global_ft.idr, fp, id) { in ksmbd_lookup_fd_cguid() 1153 idr_for_each_entry(global_ft.idr, fp, id) { in ksmbd_has_other_nonposix_open() [all …]
|
| /linux/tools/testing/shared/ |
| H A D | shared.mk | 11 SHARED_OFILES = xarray-shared.o radix-tree.o idr.o linux.o $(LIBS) 22 ../../../include/linux/idr.h \ 50 idr.c: ../../../lib/idr.c
|
| /linux/drivers/gpu/drm/vmwgfx/ |
| H A D | ttm_object.c | 97 struct idr idr; member 203 ret = idr_alloc(&tdev->idr, base, 1, 0, GFP_NOWAIT); in ttm_base_object_init() 219 idr_remove(&tdev->idr, base->handle); in ttm_base_object_init() 231 idr_remove(&tdev->idr, base->handle); in ttm_release_base() 281 base = idr_find(&tdev->idr, key); in ttm_base_object_lookup_for_ref() 440 idr_init_base(&tdev->idr, VMWGFX_NUM_MOB + 1); in ttm_object_device_init() 453 WARN_ON_ONCE(!idr_is_empty(&tdev->idr)); in ttm_object_device_release() 454 idr_destroy(&tdev->idr); in ttm_object_device_release()
|
| H A D | vmwgfx_resource.c | 105 struct idr *idr = &dev_priv->res_idr[res->func->res_type]; in vmw_resource_release_id() local 109 idr_remove(idr, res->id); in vmw_resource_release_id() 121 struct idr *idr = &dev_priv->res_idr[res->func->res_type]; in vmw_resource_release() local 164 idr_remove(idr, id); in vmw_resource_release() 189 struct idr *idr = &dev_priv->res_idr[res->func->res_type]; in vmw_resource_alloc_id() local 196 ret = idr_alloc(idr, res, 1, 0, GFP_NOWAIT); in vmw_resource_alloc_id()
|
| /linux/kernel/ |
| H A D | pid.c | 74 .idr = IDR_INIT(init_pid_ns.idr), 139 idr_remove(&ns->idr, upid->nr); in free_pid() 234 idr_set_cursor(&ns->idr, 0); in alloc_pid() 240 nr = idr_alloc(&tmp->idr, NULL, tid, in alloc_pid() 255 if (idr_get_cursor(&tmp->idr) > RESERVED_PIDS) in alloc_pid() 262 nr = idr_alloc_cyclic(&tmp->idr, NULL, pid_min, in alloc_pid() 333 idr_replace(&upid->ns->idr, pid, upid->nr); in alloc_pid() 351 idr_remove(&upid->ns->idr, upid->nr); in alloc_pid() 372 return idr_find(&ns->idr, nr); in find_pid_ns() 590 return idr_get_next(&ns->idr, &nr); in find_ge_pid() [all …]
|
| /linux/Documentation/core-api/ |
| H A D | idr.rst | 69 .. 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/drivers/tee/ |
| H A D | tee_shm.c | 145 id = idr_alloc(&teedev->idr, NULL, 1, 0, GFP_KERNEL); in tee_shm_alloc_user_buf() 153 idr_remove(&teedev->idr, id); in tee_shm_alloc_user_buf() 159 ret = idr_replace(&teedev->idr, shm, id); in tee_shm_alloc_user_buf() 223 ref->shm.id = idr_alloc(&ref->shm.ctx->teedev->idr, &ref->shm, in tee_shm_register_fd() 510 id = idr_alloc(&teedev->idr, NULL, 1, 0, GFP_KERNEL); in tee_shm_register_user_buf() 519 idr_remove(&teedev->idr, id); in tee_shm_register_user_buf() 525 ret = idr_replace(&teedev->idr, shm, id); in tee_shm_register_user_buf() 674 shm = idr_find(&teedev->idr, id); in tee_shm_get_from_id() 711 idr_remove(&teedev->idr, shm->id); in tee_shm_put()
|
| /linux/drivers/powercap/ |
| H A D | powercap_sys.c | 397 idr_destroy(&power_zone->idr); in powercap_release() 411 idr_destroy(&control_type->idr); in powercap_release() 513 power_zone->parent_idr = &control_type->idr; in powercap_register_zone() 516 power_zone->parent_idr = &parent->idr; in powercap_register_zone() 527 idr_init(&power_zone->idr); in powercap_register_zone() 626 idr_init(&control_type->idr); in powercap_register_control_type() 638 idr_destroy(&control_type->idr); in powercap_register_control_type()
|
| /linux/drivers/misc/ocxl/ |
| H A D | ocxl_internal.h | 48 struct idr contexts_idr; 81 struct idr irq_idr;
|
| /linux/drivers/counter/ |
| H A D | 104-quad-8.c | 64 u8 idr[QUAD8_NUM_COUNTERS]; member 394 synchronous_mode = u8_get_bits(priv->idr[id], INDEX_MODE) == ENABLE_INDEX_MODE; in quad8_function_write() 396 ret = quad8_control_register_update(priv->map, priv->idr, id, DISABLE_INDEX_MODE, in quad8_function_write() 603 *index_polarity = u8_get_bits(priv->idr[channel_id], INDEX_POLARITY); in quad8_index_polarity_get() 619 ret = quad8_control_register_update(priv->map, priv->idr, channel_id, index_polarity, in quad8_index_polarity_set() 666 *synchronous_mode = u8_get_bits(priv->idr[channel_id], INDEX_MODE); in quad8_synchronous_mode_get() 684 quadrature_mode = u8_get_bits(priv->idr[channel_id], QUADRATURE_MODE); in quad8_synchronous_mode_set() 690 ret = quad8_control_register_update(priv->map, priv->idr, channel_id, synchronous_mode, in quad8_synchronous_mode_set() 1278 priv->idr[channel] = SELECT_IDR | u8_encode_bits(DISABLE_INDEX_MODE, INDEX_MODE) | in quad8_init_counter() 1280 return regmap_write(priv->map, QUAD8_CONTROL(channel), priv->idr[channel]); in quad8_init_counter()
|
| /linux/sound/soc/atmel/ |
| H A D | mchp-spdiftx.c | 245 u32 sr, imr, pending, idr = 0; in mchp_spdiftx_interrupt() local 256 idr |= SPDIFTX_IR_TXUDR; in mchp_spdiftx_interrupt() 261 idr |= SPDIFTX_IR_TXOVR; in mchp_spdiftx_interrupt() 268 idr |= SPDIFTX_IR_UDRDY; in mchp_spdiftx_interrupt() 275 idr |= SPDIFTX_IR_CSRDY; in mchp_spdiftx_interrupt() 278 regmap_write(dev->regmap, SPDIFTX_IDR, idr); in mchp_spdiftx_interrupt()
|
| /linux/drivers/char/ipmi/ |
| H A D | kcs_bmc_aspeed.c | 491 { .idr = LPC_IDR1, .odr = LPC_ODR1, .str = LPC_STR1 }, 492 { .idr = LPC_IDR2, .odr = LPC_ODR2, .str = LPC_STR2 }, 493 { .idr = LPC_IDR3, .odr = LPC_ODR3, .str = LPC_STR3 }, 494 { .idr = LPC_IDR4, .odr = LPC_ODR4, .str = LPC_STR4 }, 510 ioreg.idr = be32_to_cpup(reg); in aspeed_kcs_of_get_channel()
|
| /linux/tools/testing/vma/ |
| H A D | .gitignore | 5 idr.c
|