* Check for write permissions on the specified vnode. * Prototype text segments cannot be written. * It is racy. */
| 444 | * It is racy. |
| 445 | */ |
| 446 | int |
| 447 | vn_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 |