other versions
IDR_REPLACE(9) | Basic Kernel Library Functions | IDR_REPLACE(9) |
NAME¶
idr_replace - replace pointer for given idSYNOPSIS¶
void * idr_replace(struct idr * idr, void * ptr, int id);
ARGUMENTS¶
struct idr * idridr handle
void * ptr
New pointer to associate with the ID
int id
Lookup key
DESCRIPTION¶
Replace the pointer registered with an ID and return the old value. This function can be called under the RCU read lock concurrently with idr_alloc and idr_remove (as long as the ID being removed is not the one being replaced!).RETURN¶
0 on success. -ENOENT indicates that id was not found. -EINVAL indicates that id or ptr were not valid.COPYRIGHT¶
July 2017 | Kernel Hackers Manual 4.11 |