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

Function vn_writechk

freebsd/kern/vfs_vnops.c:446–460  ·  view source on GitHub ↗

* Check for write permissions on the specified vnode. * Prototype text segments cannot be written. * It is racy. */

Source from the content-addressed store, hash-verified

444 * It is racy.
445 */
446int
447vn_writechk(struct vnode *vp)
448{
449
450 ASSERT_VOP_LOCKED(vp, "vn_writechk");
451 /*
452 * If there's shared text associated with
453 * the vnode, try to free it up once. If
454 * we fail, we can't allow writing.
455 */
456 if (VOP_IS_TEXT(vp))
457 return (ETXTBSY);
458
459 return (0);
460}
461
462/*
463 * Vnode close call

Callers 1

vn_accessFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected