@@ -862,3 +862,9 @@ int ubi_unregister_volume_notifier(struct notifier_block *nb)
return blocking_notifier_chain_unregister(&ubi_notifiers, nb);
}
EXPORT_SYMBOL_GPL(ubi_unregister_volume_notifier);
+
+inline struct cdev *ubi_get_volume_cdev(struct ubi_volume_desc *desc)
+{
+ return &(desc->vol->cdev);
+}
+EXPORT_SYMBOL_GPL(ubi_get_volume_cdev);
@@ -261,6 +261,7 @@ int ubi_leb_map(struct ubi_volume_desc *desc, int lnum);
int ubi_is_mapped(struct ubi_volume_desc *desc, int lnum);
int ubi_sync(int ubi_num);
int ubi_flush(int ubi_num, int vol_id, int lnum);
+struct cdev *ubi_get_volume_cdev(struct ubi_volume_desc *desc);
/*
* This function is the same as the 'ubi_leb_read()' function, but it does not
We want to fill the sb->s_cdev in ubifs_fill_super(), so, we need to add a interface in ubi to get the cdev of an ubi_volume. Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com> --- drivers/mtd/ubi/kapi.c | 6 ++++++ include/linux/mtd/ubi.h | 1 + 2 files changed, 7 insertions(+)