MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sys_fhreadlink

Function sys_fhreadlink

freebsd/kern/vfs_syscalls.c:4421–4446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4419};
4420#endif
4421int
4422sys_fhreadlink(struct thread *td, struct fhreadlink_args *uap)
4423{
4424 fhandle_t fh;
4425 struct mount *mp;
4426 struct vnode *vp;
4427 int error;
4428
4429 error = priv_check(td, PRIV_VFS_GETFH);
4430 if (error != 0)
4431 return (error);
4432 if (uap->bufsize > IOSIZE_MAX)
4433 return (EINVAL);
4434 error = copyin(uap->fhp, &fh, sizeof(fh));
4435 if (error != 0)
4436 return (error);
4437 if ((mp = vfs_busyfs(&fh.fh_fsid)) == NULL)
4438 return (ESTALE);
4439 error = VFS_FHTOVP(mp, &fh.fh_fid, LK_SHARED, &vp);
4440 vfs_unbusy(mp);
4441 if (error != 0)
4442 return (error);
4443 error = kern_readlink_vp(vp, uap->buf, UIO_USERSPACE, uap->bufsize, td);
4444 vput(vp);
4445 return (error);
4446}
4447
4448/*
4449 * syscall for the rpc.lockd to use to translate a NFS file handle into an

Callers

nothing calls this directly

Calls 6

vfs_busyfsFunction · 0.85
vfs_unbusyFunction · 0.85
kern_readlink_vpFunction · 0.85
vputFunction · 0.85
priv_checkFunction · 0.70
copyinFunction · 0.50

Tested by

no test coverage detected