| 4383 | } |
| 4384 | |
| 4385 | static int |
| 4386 | kern_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_ |
| 4415 | struct fhreadlink_args { |
no test coverage detected