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@xxxxxxxxxxxxxxxxxxx> --- drivers/mtd/ubi/gluebi.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/mtd/ubi/gluebi.c b/drivers/mtd/ubi/gluebi.c index 6b655a5..b7d1d7c 100644 --- a/drivers/mtd/ubi/gluebi.c +++ b/drivers/mtd/ubi/gluebi.c @@ -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 -- 1.9.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/