@@ -280,6 +280,19 @@ static int gluebi_erase(struct mtd_info *mtd, struct erase_info *instr)
}
/**
+ * gluebi_sync - sync operation of emulated MTD devices.
+ * @mtd: the MTD device description object
+ *
+ * This function syncs the underlying UBI device when the MTD device is synced.
+ */
+static void gluebi_sync(struct mtd_info *mtd)
+{
+ struct gluebi_device *gluebi;
+ gluebi = container_of(mtd, struct gluebi_device, mtd);
+ ubi_sync(gluebi->ubi_num);
+}
+
+/**
* gluebi_create - create a gluebi device for an UBI volume.
* @di: UBI device description object
* @vi: UBI volume description object
@@ -318,6 +331,7 @@ static int gluebi_create(struct ubi_device_info *di,
mtd->_erase = gluebi_erase;
mtd->_get_device = gluebi_get_device;
mtd->_put_device = gluebi_put_device;
+ mtd->_sync = gluebi_sync;
/*
* In case of dynamic a volume, MTD device size is just volume size. In
Adding sync function to sync the underlying ubi device when a mtd sync is called. This is being used to ensure a JFFS2 file system running on top of the UBI volume is able to sync the underlying device. Signed-off-by: Clayton Shotwell <clayton.shotwell@rockwellcollins.com> --- drivers/mtd/ubi/gluebi.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)