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

Function vfs_stdsync

freebsd/kern/vfs_default.c:1343–1378  ·  view source on GitHub ↗
(mp, waitfor)

Source from the content-addressed store, hash-verified

1341}
1342
1343int
1344vfs_stdsync(mp, waitfor)
1345 struct mount *mp;
1346 int waitfor;
1347{
1348 struct vnode *vp, *mvp;
1349 struct thread *td;
1350 int error, lockreq, allerror = 0;
1351
1352 td = curthread;
1353 lockreq = LK_EXCLUSIVE | LK_INTERLOCK;
1354 if (waitfor != MNT_WAIT)
1355 lockreq |= LK_NOWAIT;
1356 /*
1357 * Force stale buffer cache information to be flushed.
1358 */
1359loop:
1360 MNT_VNODE_FOREACH_ALL(vp, mp, mvp) {
1361 if (vp->v_bufobj.bo_dirty.bv_cnt == 0) {
1362 VI_UNLOCK(vp);
1363 continue;
1364 }
1365 if ((error = vget(vp, lockreq)) != 0) {
1366 if (error == ENOENT) {
1367 MNT_VNODE_FOREACH_ALL_ABORT(mp, mvp);
1368 goto loop;
1369 }
1370 continue;
1371 }
1372 error = VOP_FSYNC(vp, waitfor, td);
1373 if (error)
1374 allerror = error;
1375 vput(vp);
1376 }
1377 return (allerror);
1378}
1379
1380int
1381vfs_stdnosync (mp, waitfor)

Callers 1

zfs_syncFunction · 0.85

Calls 2

vgetFunction · 0.85
vputFunction · 0.85

Tested by

no test coverage detected