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

Function vop_stdadvlock

freebsd/kern/vfs_default.c:422–446  ·  view source on GitHub ↗

* Advisory record locking support */

Source from the content-addressed store, hash-verified

420 * Advisory record locking support
421 */
422int
423vop_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
448int
449vop_stdadvlockasync(struct vop_advlockasync_args *ap)

Callers

nothing calls this directly

Calls 3

vn_lockFunction · 0.85
VOP_GETATTRFunction · 0.85
lf_advlockFunction · 0.85

Tested by

no test coverage detected