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

Function kern_fhlinkat

freebsd/kern/vfs_syscalls.c:4385–4412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4383}
4384
4385static int
4386kern_fhlinkat(struct thread *td, int fd, const char *path,
4387 enum uio_seg pathseg, fhandle_t *fhp)
4388{
4389 fhandle_t fh;
4390 struct mount *mp;
4391 struct vnode *vp;
4392 int error;
4393
4394 error = priv_check(td, PRIV_VFS_GETFH);
4395 if (error != 0)
4396 return (error);
4397 error = copyin(fhp, &fh, sizeof(fh));
4398 if (error != 0)
4399 return (error);
4400 do {
4401 bwillwrite();
4402 if ((mp = vfs_busyfs(&fh.fh_fsid)) == NULL)
4403 return (ESTALE);
4404 error = VFS_FHTOVP(mp, &fh.fh_fid, LK_SHARED, &vp);
4405 vfs_unbusy(mp);
4406 if (error != 0)
4407 return (error);
4408 VOP_UNLOCK(vp);
4409 error = kern_linkat_vp(td, vp, fd, path, pathseg);
4410 } while (error == EAGAIN || error == ERELOOKUP);
4411 return (error);
4412}
4413
4414#ifndef _SYS_SYSPROTO_H_
4415struct fhreadlink_args {

Callers 2

sys_fhlinkFunction · 0.85
sys_fhlinkatFunction · 0.85

Calls 6

vfs_busyfsFunction · 0.85
vfs_unbusyFunction · 0.85
kern_linkat_vpFunction · 0.85
priv_checkFunction · 0.70
bwillwriteFunction · 0.70
copyinFunction · 0.50

Tested by

no test coverage detected