Drop main() prototype. Syncs with NetBSD-8
[minix.git] / minix / fs / mfs / misc.c
blob2583681b0fe3677c443efe325001d56c6d2442ee
1 #include "fs.h"
2 #include "inode.h"
3 #include "clean.h"
5 /*===========================================================================*
6 * fs_sync *
7 *===========================================================================*/
8 void fs_sync(void)
10 /* Perform the sync() system call. Flush all the tables.
11 * The order in which the various tables are flushed is critical. The
12 * blocks must be flushed last, since rw_inode() leaves its results in
13 * the block cache.
15 struct inode *rip;
17 /* Write all the dirty inodes to the disk. */
18 for(rip = &inode[0]; rip < &inode[NR_INODES]; rip++)
19 if(rip->i_count > 0 && IN_ISDIRTY(rip)) rw_inode(rip, WRITING);
21 /* Write all the dirty blocks to the disk. */
22 lmfs_flushall();