.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\"
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng .
.TH "NTFS_READ_LOCKED_INODE" "9" "09 October 2005" "" ""
.SH NAME
ntfs_read_locked_inode \- read an inode from its device
.SH SYNOPSIS
"SYNOPSIS"
.sp
\fB
.sp
int ntfs_read_locked_inode (struct inode * \fIvi\fB);
\fR
.SH "ARGUMENTS"
.TP
\fB\fIvi\fB\fR
inode to read
.SH "DESCRIPTION"
.PP
\fBntfs_read_locked_inode\fR is called from \fBntfs_iget\fR to read the inode
described by \fIvi\fR into memory from the device.
.PP
The only fields in \fIvi\fR that we need to/can look at when the function is
called are i_sb, pointing to the mounted device's super block, and i_ino,
the number of the inode to load.
.PP
\fBntfs_read_locked_inode\fR maps, pins and locks the mft record number i_ino
for reading and sets up the necessary \fIvi\fR fields as well as initializing
the ntfs inode.
.SH "Q"
.PP
What locks are held when the function is called?
.SH "A"
.PP
i_state has I_LOCK set, hence the inode is locked, also
i_count is set to 1, so it is not going to go away
i_flags is set to 0 and we have no business touching it. Only an \fBioctl\fR
is allowed to write to them. We should of course be honouring them but
we need to do that using the IS_* macros defined in include/linux/fs.h.
In any case \fBntfs_read_locked_inode\fR has nothing to do with i_flags.
.PP
Return 0 on success and -errno on error. In the error case, the inode will
have had \fBmake_bad_inode\fR executed on it.