custom message type for VM_INFO
[minix3.git] / lib / libpuffs / misc.c
blob9b80632a22dc6ec74f4379acccf97e8abadf0bd4
1 /* Created (MFS based):
2 * June 2011 (Evgeniy Ivanov)
3 */
5 #include "fs.h"
6 #include <assert.h>
7 #include <minix/vfsif.h>
9 #include "puffs.h"
10 #include "puffs_priv.h"
12 /*===========================================================================*
13 * fs_sync *
14 *===========================================================================*/
15 int fs_sync(void)
17 /* Perform the sync() system call. Flush all the tables.
18 * The order in which the various tables are flushed is critical.
20 int r;
21 PUFFS_MAKECRED(pcr, &global_kcred);
23 if (is_readonly_fs)
24 return(OK); /* nothing to sync */
26 r = global_pu->pu_ops.puffs_fs_sync(global_pu, MNT_WAIT, pcr);
27 if (r) {
28 lpuffs_debug("Warning: sync failed!\n");
31 return(OK); /* sync() can't fail */
35 /*===========================================================================*
36 * fs_flush *
37 *===========================================================================*/
38 int fs_flush(void)
40 /* Flush the blocks of a device from the cache after writing any dirty blocks
41 * to disk.
43 #if 0
44 dev_t dev = fs_m_in.m_vfs_fs_flush.device;
46 if(dev == fs_dev) return(EBUSY);
48 flushall(dev);
49 invalidate(dev);
50 #endif
52 return(OK);
56 /*===========================================================================*
57 * fs_new_driver *
58 *===========================================================================*/
59 int fs_new_driver(void)
61 /* Do not do anything. */
63 return(OK);