示例#1
0
文件: uffs_fs.c 项目: wuliaodew/RTT
static URET do_FlushObject(uffs_Object *obj)
{
	uffs_Device *dev;
	URET ret = U_SUCC;

	dev = obj->dev;
	if (obj->node) {
		if (obj->type == UFFS_TYPE_DIR)
			ret = uffs_BufFlushGroup(dev, obj->node->u.dir.parent, obj->node->u.dir.serial);
		else {
			ret = (
				uffs_BufFlushGroupMatchParent(dev, obj->node->u.file.serial) == U_SUCC &&
				uffs_BufFlushGroup(dev, obj->node->u.file.parent, obj->node->u.file.serial) == U_SUCC
				) ? U_SUCC : U_FAIL;
		}
	}

	return ret;
}
示例#2
0
文件: uffs_fs.c 项目: mazj/uffs
static URET do_FlushObject(uffs_Object *obj)
{
	uffs_Device *dev;
	URET ret = U_SUCC;
	TreeNode *node = NULL;

	dev = obj->dev;
	if (obj->node) {
		node = obj->node;
		if (obj->type == UFFS_TYPE_DIR)
			ret = uffs_BufFlushGroup(dev, obj->node->u.dir.parent,
										obj->node->u.dir.serial);
		else {
			ret = (
				uffs_BufFlushGroupMatchParent(dev, obj->node->u.file.serial) == U_SUCC &&
				uffs_BufFlushGroup(dev, obj->node->u.file.parent, obj->node->u.file.serial) == U_SUCC
				) ? U_SUCC : U_FAIL;
		}
		uffs_Assert(node == obj->node, "obj->node change!\n");
	}

	return ret;
}