int ntfs_read_locked_inode (struct inode * vi);
ntfs_read_locked_inode is called from ntfs_iget to read the inode described by vi into memory from the device.
The only fields in vi 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. If this is a fake inode, i.e. NInoAttr, then the fields type, name, and name_len are also valid, and describe the attribute which this fake inode represents.
ntfs_read_locked_inode maps, pins and locks the mft record number i_ino for reading and sets up the necessary vi fields as well as initializing the ntfs inode.
What locks are held when the function is called?
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 ioctl 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 ntfs_read_locked_inode has nothing to do with i_flags.
Return 0 on success and -errno on error. In the error case, the inode will have had make_bad_inode executed on it.