xref: /minix/minix/lib/libpuffs/misc.c (revision ebfedea0)
1 /* Created (MFS based):
2  *   June 2011 (Evgeniy Ivanov)
3  */
4 
5 #include "fs.h"
6 
7 /*===========================================================================*
8  *				fs_sync					     *
9  *===========================================================================*/
10 void fs_sync(void)
11 {
12 /* Perform the sync() system call.  Flush all the tables.
13  * The order in which the various tables are flushed is critical.
14  */
15   int r;
16   PUFFS_MAKECRED(pcr, &global_kcred);
17 
18   if (is_readonly_fs)
19 	return; /* nothing to sync */
20 
21   r = global_pu->pu_ops.puffs_fs_sync(global_pu, MNT_WAIT, pcr);
22   if (r) {
23 	lpuffs_debug("Warning: sync failed!\n");
24   }
25 }
26