With the changes to the vnode ops definitions the symlink operation
takes a constant string. We can thus just pass the input string on
without having to copy it.
Signed-off-by: Marc Rittinghaus <marc.rittinghaus@unikraft.io>
Reviewed-by: Sergiu Moga <sergiu.moga@protonmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #866
{
struct task *t = main_task;
int error;
- char op[PATH_MAX];
char np[PATH_MAX];
struct dentry *newdp;
struct dentry *newdirdp;
goto out;
}
- /* oldpath may not be const char * to VOP_SYMLINK - need to copy */
- size_t tocopy;
- tocopy = strlcpy(op, oldpath, PATH_MAX);
- if (tocopy >= PATH_MAX - 1) {
- error = ENAMETOOLONG;
- goto out;
- }
- error = VOP_SYMLINK(newdirdp->d_vnode, name, op);
+ error = VOP_SYMLINK(newdirdp->d_vnode, name, oldpath);
out:
if (newdirdp != NULL) {