* Move all data to a permanent storage device. This code * simulates the fsync and fdatasync syscalls. */
| 721 | * simulates the fsync and fdatasync syscalls. |
| 722 | */ |
| 723 | static int |
| 724 | aio_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); |
| 744 | drop: |
| 745 | return (error); |
| 746 | } |
| 747 | |
| 748 | /* |
| 749 | * The AIO processing activity for LIO_READ/LIO_WRITE. This is the code that |
no test coverage detected