'\" t .\" Title: d_obtain_root .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: September 2017 .\" Manual: The Linux VFS .\" Source: Kernel Hackers Manual 4.12.13 .\" Language: English .\" .TH "D_OBTAIN_ROOT" "9" "September 2017" "Kernel Hackers Manual 4\&.12\&" "The Linux VFS" .\" ----------------------------------------------------------------- .\" * 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" d_obtain_root \- find or allocate a dentry for a given inode .SH "SYNOPSIS" .HP \w'struct\ dentry\ *\ d_obtain_root('u .BI "struct dentry * d_obtain_root(struct\ inode\ *\ " "inode" ");" .SH "ARGUMENTS" .PP \fIstruct inode * inode\fR .RS 4 inode to allocate the dentry for .RE .SH "DESCRIPTION" .PP Obtain an IS_ROOT dentry for the root of a filesystem\&. .PP We must ensure that directory inodes only ever have one dentry\&. If a dentry is found, that is returned instead of allocating a new one\&. .PP On successful return, the reference to the inode has been transferred to the dentry\&. In case of an error the reference on the inode is released\&. A \fBNULL\fR or IS_ERR inode may be passed in and will be the error will be propagate to the return value, with a \fBNULL\fR \fIinode\fR replaced by ERR_PTR(\-ESTALE)\&. .SH "COPYRIGHT" .br