Add to Chrome
✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
The lines
if(ip->type != T_DIR){ iunlockput(ip); return 0; }
in namex() function
mean
No directory entry was found for the file to be opened, hence an error
ilock is held on the inode, and hence it's an error if it is a directory
One of the sub-components on the given path name, was not a directory, hence it's an error
The last path component (which is a file, and not a directory) has been resolved, so release the lock (using iunlockput) and return
There was a syntax error in the pathname specified
One of the sub-components on the given path name, was a directory, but it was not supposed to be a directory, hence an error
One of the sub-components on the given path name, did not exist, hence it's an error
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!