VFS_SYNC(9)

VFS_SYNC9

Flush unwritten data

Usage

#include <sys/param.h>

#include <sys/mount.h>

#include <sys/vnode.h>

int

VFS_SYNC(struct mount *mp, int waitfor);

Overview

The VFS_SYNC() macro writes out all unwritten data in the file system mounted as mp.

The arguments it expects are:

mp

The file system.

waitfor

Whether the function should wait for I/O to complete. Possible values are:

MNT_WAIT

synchronously wait for I/O to complete

MNT_NOWAIT

start all I/O, but do not wait for it

MNT_LAZY

push data not written by file system syncer

The VFS_SYNC() macro calls the vfs_sync method of the file system, which normally calls VOP_FSYNC(9) for all the vnodes in the file system.

Releases

83 releases since FreeBSD 2.2.2-RELEASE; the text changed 42 times.

  1. 2.2.2–2.2.8
  2. 2.2.9
  3. 3.0–3.2
  4. 3.3–3.5.1
  5. 4.0–4.4
  6. 4.5–4.11
  7. 5.0–5.1
  8. 5.2–5.3
  9. 5.4–5.5
  10. 6.0–6.2
  11. 6.3
  12. 6.4
  13. 7.0
  14. 7.1
  15. 7.2
  16. 7.3
  17. 7.4
  18. 8.0
  19. 8.1
  20. 8.2
  21. 8.3
  22. 8.4
  23. 9.0
  24. 9.1
  25. 9.2
  26. 9.3
  27. 10.0
  28. 10.1
  29. 10.2
  30. 10.3
  31. 10.4
  32. 11.0
  33. 11.1
  34. 11.2
  35. 11.3
  36. 11.4
  37. 12.0
  38. 12.1
  39. 12.2
  40. 12.3
  41. 12.4
  42. 13.0–13.2
  43. 13.3–16.0

Authors

This manual page was written by Doug Rabson.

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.