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

Function vop_stdunset_text

freebsd/kern/vfs_default.c:1214–1239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1212}
1213
1214static int
1215vop_stdunset_text(struct vop_unset_text_args *ap)
1216{
1217 struct vnode *vp;
1218 int error;
1219 bool last;
1220
1221 vp = ap->a_vp;
1222 last = false;
1223 VI_LOCK(vp);
1224 if (vp->v_writecount < 0) {
1225 if ((vp->v_iflag & VI_TEXT_REF) != 0 &&
1226 vp->v_writecount == -1) {
1227 last = true;
1228 vp->v_iflag &= ~VI_TEXT_REF;
1229 }
1230 vp->v_writecount++;
1231 error = 0;
1232 } else {
1233 error = EINVAL;
1234 }
1235 VI_UNLOCK(vp);
1236 if (last)
1237 vunref(vp);
1238 return (error);
1239}
1240
1241static int
1242vop_stdadd_writecount(struct vop_add_writecount_args *ap)

Callers

nothing calls this directly

Calls 1

vunrefFunction · 0.85

Tested by

no test coverage detected