* Like fget() but loads the underlying vnode, or returns an error if the * descriptor does not represent a vnode. Note that pipes use vnodes but * never have VM objects. The returned vnode will be vref()'d. * * XXX: what about the unused flags ? */
| 3502 | * XXX: what about the unused flags ? |
| 3503 | */ |
| 3504 | static __inline int |
| 3505 | _fgetvp(struct thread *td, int fd, int flags, cap_rights_t *needrightsp, |
| 3506 | struct vnode **vpp) |
| 3507 | { |
| 3508 | struct file *fp; |
| 3509 | int error; |
| 3510 | |
| 3511 | *vpp = NULL; |
| 3512 | error = _fget(td, fd, &fp, flags, needrightsp); |
| 3513 | if (error != 0) |
| 3514 | return (error); |
| 3515 | if (fp->f_vnode == NULL) { |
| 3516 | error = EINVAL; |
| 3517 | } else { |
| 3518 | *vpp = fp->f_vnode; |
| 3519 | vrefact(*vpp); |
| 3520 | } |
| 3521 | fdrop(fp, td); |
| 3522 | |
| 3523 | return (error); |
| 3524 | } |
| 3525 | |
| 3526 | int |
| 3527 | fgetvp(struct thread *td, int fd, cap_rights_t *rightsp, struct vnode **vpp) |
no test coverage detected