2011-11-14 12:53:05 +01:00
|
|
|
/* Created (MFS based):
|
|
|
|
* June 2011 (Evgeniy Ivanov)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "fs.h"
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
#include "puffs.h"
|
|
|
|
#include "puffs_priv.h"
|
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* fs_sync *
|
|
|
|
*===========================================================================*/
|
2014-08-24 11:51:35 +02:00
|
|
|
void fs_sync(void)
|
2011-11-14 12:53:05 +01:00
|
|
|
{
|
|
|
|
/* Perform the sync() system call. Flush all the tables.
|
|
|
|
* The order in which the various tables are flushed is critical.
|
|
|
|
*/
|
|
|
|
int r;
|
|
|
|
PUFFS_MAKECRED(pcr, &global_kcred);
|
|
|
|
|
|
|
|
if (is_readonly_fs)
|
2014-08-24 11:51:35 +02:00
|
|
|
return; /* nothing to sync */
|
2011-11-14 12:53:05 +01:00
|
|
|
|
|
|
|
r = global_pu->pu_ops.puffs_fs_sync(global_pu, MNT_WAIT, pcr);
|
|
|
|
if (r) {
|
|
|
|
lpuffs_debug("Warning: sync failed!\n");
|
|
|
|
}
|
2011-11-29 16:02:37 +01:00
|
|
|
}
|