mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-04 08:08:54 +00:00
Kill 9p readlink()
For symlinks generic_readlink() will work just fine and for directories we don't want ->readlink() at all. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
86acdca1b6
commit
204f2f0e82
1 changed files with 1 additions and 40 deletions
|
@ -1000,44 +1000,6 @@ static int v9fs_readlink(struct dentry *dentry, char *buffer, int buflen)
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* v9fs_vfs_readlink - read a symlink's location
|
|
||||||
* @dentry: dentry for symlink
|
|
||||||
* @buffer: buffer to load symlink location into
|
|
||||||
* @buflen: length of buffer
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
static int v9fs_vfs_readlink(struct dentry *dentry, char __user * buffer,
|
|
||||||
int buflen)
|
|
||||||
{
|
|
||||||
int retval;
|
|
||||||
int ret;
|
|
||||||
char *link = __getname();
|
|
||||||
|
|
||||||
if (unlikely(!link))
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
if (buflen > PATH_MAX)
|
|
||||||
buflen = PATH_MAX;
|
|
||||||
|
|
||||||
P9_DPRINTK(P9_DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_name.name,
|
|
||||||
dentry);
|
|
||||||
|
|
||||||
retval = v9fs_readlink(dentry, link, buflen);
|
|
||||||
|
|
||||||
if (retval > 0) {
|
|
||||||
if ((ret = copy_to_user(buffer, link, retval)) != 0) {
|
|
||||||
P9_DPRINTK(P9_DEBUG_ERROR,
|
|
||||||
"problem copying to user: %d\n", ret);
|
|
||||||
retval = ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
__putname(link);
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* v9fs_vfs_follow_link - follow a symlink path
|
* v9fs_vfs_follow_link - follow a symlink path
|
||||||
* @dentry: dentry for symlink
|
* @dentry: dentry for symlink
|
||||||
|
@ -1230,7 +1192,6 @@ static const struct inode_operations v9fs_dir_inode_operations_ext = {
|
||||||
.rmdir = v9fs_vfs_rmdir,
|
.rmdir = v9fs_vfs_rmdir,
|
||||||
.mknod = v9fs_vfs_mknod,
|
.mknod = v9fs_vfs_mknod,
|
||||||
.rename = v9fs_vfs_rename,
|
.rename = v9fs_vfs_rename,
|
||||||
.readlink = v9fs_vfs_readlink,
|
|
||||||
.getattr = v9fs_vfs_getattr,
|
.getattr = v9fs_vfs_getattr,
|
||||||
.setattr = v9fs_vfs_setattr,
|
.setattr = v9fs_vfs_setattr,
|
||||||
};
|
};
|
||||||
|
@ -1253,7 +1214,7 @@ static const struct inode_operations v9fs_file_inode_operations = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct inode_operations v9fs_symlink_inode_operations = {
|
static const struct inode_operations v9fs_symlink_inode_operations = {
|
||||||
.readlink = v9fs_vfs_readlink,
|
.readlink = generic_readlink,
|
||||||
.follow_link = v9fs_vfs_follow_link,
|
.follow_link = v9fs_vfs_follow_link,
|
||||||
.put_link = v9fs_vfs_put_link,
|
.put_link = v9fs_vfs_put_link,
|
||||||
.getattr = v9fs_vfs_getattr,
|
.getattr = v9fs_vfs_getattr,
|
||||||
|
|
Loading…
Reference in a new issue