vfs: replace calling i_op->readlink with vfs_readlink()

Also check d_is_symlink() in callers instead of inode->i_op->readlink
because following patches will allow NULL ->readlink for symlinks.

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
This commit is contained in:
Miklos Szeredi
2016-12-09 16:45:04 +01:00
parent 2a07a1f5ab
commit fd4a0edf2a
6 changed files with 35 additions and 13 deletions

View File

@@ -287,7 +287,7 @@ xfs_readlink_by_handle(
return PTR_ERR(dentry);
/* Restrict this handle operation to symlinks only. */
if (!d_inode(dentry)->i_op->readlink) {
if (!d_is_symlink(dentry)) {
error = -EINVAL;
goto out_dput;
}
@@ -297,7 +297,7 @@ xfs_readlink_by_handle(
goto out_dput;
}
error = d_inode(dentry)->i_op->readlink(dentry, hreq->ohandle, olen);
error = vfs_readlink(dentry, hreq->ohandle, olen);
out_dput:
dput(dentry);