* Advisory record locking support */
| 420 | * Advisory record locking support |
| 421 | */ |
| 422 | int |
| 423 | vop_stdadvlock(struct vop_advlock_args *ap) |
| 424 | { |
| 425 | struct vnode *vp; |
| 426 | struct vattr vattr; |
| 427 | int error; |
| 428 | |
| 429 | vp = ap->a_vp; |
| 430 | if (ap->a_fl->l_whence == SEEK_END) { |
| 431 | /* |
| 432 | * The NFSv4 server must avoid doing a vn_lock() here, since it |
| 433 | * can deadlock the nfsd threads, due to a LOR. Fortunately |
| 434 | * the NFSv4 server always uses SEEK_SET and this code is |
| 435 | * only required for the SEEK_END case. |
| 436 | */ |
| 437 | vn_lock(vp, LK_SHARED | LK_RETRY); |
| 438 | error = VOP_GETATTR(vp, &vattr, curthread->td_ucred); |
| 439 | VOP_UNLOCK(vp); |
| 440 | if (error) |
| 441 | return (error); |
| 442 | } else |
| 443 | vattr.va_size = 0; |
| 444 | |
| 445 | return (lf_advlock(ap, &(vp->v_lockf), vattr.va_size)); |
| 446 | } |
| 447 | |
| 448 | int |
| 449 | vop_stdadvlockasync(struct vop_advlockasync_args *ap) |
nothing calls this directly
no test coverage detected