- inode = dentry->d_inode;
-
-
- /* Type check. The correct error return for type mismatches
- * does not seem to be generally agreed upon. SunOS seems to
- * use EISDIR if file isn't S_IFREG; a comment in the NFSv3
- * spec says this is incorrect (implementation notes for the
- * write call).
- */
-
- /* Type can be negative when creating hardlinks - not to a dir */
- if (type > 0 && (inode->i_mode & S_IFMT) != type) {
- if (rqstp->rq_vers == 4 && (inode->i_mode & S_IFMT) == S_IFLNK)
- error = nfserr_symlink;
- else if (type == S_IFDIR)
- error = nfserr_notdir;
- else if ((inode->i_mode & S_IFMT) == S_IFDIR)
- error = nfserr_isdir;
- else
- error = nfserr_inval;
- goto out;
- }
- if (type < 0 && (inode->i_mode & S_IFMT) == -type) {
- if (rqstp->rq_vers == 4 && (inode->i_mode & S_IFMT) == S_IFLNK)
- error = nfserr_symlink;
- else if (type == -S_IFDIR)
- error = nfserr_isdir;
- else
- error = nfserr_notdir;