diff options
Diffstat (limited to 'include/linux/idr.h')
-rw-r--r-- | include/linux/idr.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/idr.h b/include/linux/idr.h index 762c3f2c631d..fa035f96f2a3 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h | |||
@@ -79,6 +79,22 @@ struct idr { | |||
79 | 79 | ||
80 | #define _idr_rc_to_errno(rc) ((rc) == -1 ? -EAGAIN : -ENOSPC) | 80 | #define _idr_rc_to_errno(rc) ((rc) == -1 ? -EAGAIN : -ENOSPC) |
81 | 81 | ||
82 | /** | ||
83 | * idr synchronization (stolen from radix-tree.h) | ||
84 | * | ||
85 | * idr_find() is able to be called locklessly, using RCU. The caller must | ||
86 | * ensure calls to this function are made within rcu_read_lock() regions. | ||
87 | * Other readers (lock-free or otherwise) and modifications may be running | ||
88 | * concurrently. | ||
89 | * | ||
90 | * It is still required that the caller manage the synchronization and | ||
91 | * lifetimes of the items. So if RCU lock-free lookups are used, typically | ||
92 | * this would mean that the items have their own locks, or are amenable to | ||
93 | * lock-free access; and that the items are freed by RCU (or only freed after | ||
94 | * having been deleted from the idr tree *and* a synchronize_rcu() grace | ||
95 | * period). | ||
96 | */ | ||
97 | |||
82 | /* | 98 | /* |
83 | * This is what we export. | 99 | * This is what we export. |
84 | */ | 100 | */ |