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

Function vop_stdadd_writecount

freebsd/kern/vfs_default.c:1241–1265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1239}
1240
1241static int
1242vop_stdadd_writecount(struct vop_add_writecount_args *ap)
1243{
1244 struct vnode *vp;
1245 struct mount *mp;
1246 int error;
1247
1248 vp = ap->a_vp;
1249 VI_LOCK_FLAGS(vp, MTX_DUPOK);
1250 if (vp->v_writecount < 0) {
1251 error = ETXTBSY;
1252 } else {
1253 VNASSERT(vp->v_writecount + ap->a_inc >= 0, vp,
1254 ("neg writecount increment %d", ap->a_inc));
1255 if (vp->v_writecount == 0) {
1256 mp = vp->v_mount;
1257 if (mp != NULL && (mp->mnt_kern_flag & MNTK_NOMSYNC) == 0)
1258 vlazy(vp);
1259 }
1260 vp->v_writecount += ap->a_inc;
1261 error = 0;
1262 }
1263 VI_UNLOCK(vp);
1264 return (error);
1265}
1266
1267int
1268vop_stdneed_inactive(struct vop_need_inactive_args *ap)

Callers

nothing calls this directly

Calls 1

vlazyFunction · 0.85

Tested by

no test coverage detected