| 4419 | }; |
| 4420 | #endif |
| 4421 | int |
| 4422 | sys_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 |
nothing calls this directly
no test coverage detected