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

Function aio_fsync_vnode

freebsd/kern/vfs_aio.c:723–746  ·  view source on GitHub ↗

* Move all data to a permanent storage device. This code * simulates the fsync and fdatasync syscalls. */

Source from the content-addressed store, hash-verified

721 * simulates the fsync and fdatasync syscalls.
722 */
723static int
724aio_fsync_vnode(struct thread *td, struct vnode *vp, int op)
725{
726 struct mount *mp;
727 int error;
728
729 if ((error = vn_start_write(vp, &mp, V_WAIT | PCATCH)) != 0)
730 goto drop;
731 vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
732 if (vp->v_object != NULL) {
733 VM_OBJECT_WLOCK(vp->v_object);
734 vm_object_page_clean(vp->v_object, 0, 0, 0);
735 VM_OBJECT_WUNLOCK(vp->v_object);
736 }
737 if (op == LIO_DSYNC)
738 error = VOP_FDATASYNC(vp, td);
739 else
740 error = VOP_FSYNC(vp, MNT_WAIT, td);
741
742 VOP_UNLOCK(vp);
743 vn_finished_write(mp);
744drop:
745 return (error);
746}
747
748/*
749 * The AIO processing activity for LIO_READ/LIO_WRITE. This is the code that

Callers 1

aio_process_syncFunction · 0.85

Calls 4

vn_start_writeFunction · 0.85
vn_lockFunction · 0.85
vm_object_page_cleanFunction · 0.85
vn_finished_writeFunction · 0.85

Tested by

no test coverage detected