'\" t .\" Title: idr_replace .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: July 2017 .\" Manual: Basic Kernel Library Functions .\" Source: Kernel Hackers Manual 4.11.6 .\" Language: English .\" .TH "IDR_REPLACE" "9" "July 2017" "Kernel Hackers Manual 4\&.11\&" "Basic Kernel Library Functions" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" idr_replace \- replace pointer for given id .SH "SYNOPSIS" .HP \w'void\ *\ idr_replace('u .BI "void * idr_replace(struct\ idr\ *\ " "idr" ", void\ *\ " "ptr" ", int\ " "id" ");" .SH "ARGUMENTS" .PP \fIstruct idr * idr\fR .RS 4 idr handle .RE .PP \fIvoid * ptr\fR .RS 4 New pointer to associate with the ID .RE .PP \fIint id\fR .RS 4 Lookup key .RE .SH "DESCRIPTION" .PP Replace the pointer registered with an ID and return the old value\&. This function can be called under the RCU read lock concurrently with \fBidr_alloc\fR and \fBidr_remove\fR (as long as the ID being removed is not the one being replaced!)\&. .SH "RETURN" .PP 0 on success\&. \fB\-ENOENT\fR indicates that \fIid\fR was not found\&. \fB\-EINVAL\fR indicates that \fIid\fR or \fIptr\fR were not valid\&. .SH "COPYRIGHT" .br