aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/kapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/ubi/kapi.c')
-rw-r--r--drivers/mtd/ubi/kapi.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c
index d76fe47477e5..3aac1acceeb4 100644
--- a/drivers/mtd/ubi/kapi.c
+++ b/drivers/mtd/ubi/kapi.c
@@ -551,7 +551,7 @@ int ubi_leb_erase(struct ubi_volume_desc *desc, int lnum)
551 if (err) 551 if (err)
552 return err; 552 return err;
553 553
554 return ubi_wl_flush(ubi); 554 return ubi_wl_flush(ubi, vol->vol_id, lnum);
555} 555}
556EXPORT_SYMBOL_GPL(ubi_leb_erase); 556EXPORT_SYMBOL_GPL(ubi_leb_erase);
557 557
@@ -704,6 +704,33 @@ int ubi_sync(int ubi_num)
704} 704}
705EXPORT_SYMBOL_GPL(ubi_sync); 705EXPORT_SYMBOL_GPL(ubi_sync);
706 706
707/**
708 * ubi_flush - flush UBI work queue.
709 * @ubi_num: UBI device to flush work queue
710 * @vol_id: volume id to flush for
711 * @lnum: logical eraseblock number to flush for
712 *
713 * This function executes all pending works for a particular volume id / logical
714 * eraseblock number pair. If either value is set to %UBI_ALL, then it acts as
715 * a wildcard for all of the corresponding volume numbers or logical
716 * eraseblock numbers. It returns zero in case of success and a negative error
717 * code in case of failure.
718 */
719int ubi_flush(int ubi_num, int vol_id, int lnum)
720{
721 struct ubi_device *ubi;
722 int err = 0;
723
724 ubi = ubi_get_device(ubi_num);
725 if (!ubi)
726 return -ENODEV;
727
728 err = ubi_wl_flush(ubi, vol_id, lnum);
729 ubi_put_device(ubi);
730 return err;
731}
732EXPORT_SYMBOL_GPL(ubi_flush);
733
707BLOCKING_NOTIFIER_HEAD(ubi_notifiers); 734BLOCKING_NOTIFIER_HEAD(ubi_notifiers);
708 735
709/** 736/**