aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/ubi.h
diff options
context:
space:
mode:
authorDmitry Pervushin <dpervushin@embeddedalley.com>2009-04-29 11:29:38 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-06-02 06:53:35 -0400
commit0e0ee1cc33de8f0cc603269b354085dee340afa0 (patch)
tree5dfd658b85eabadfbf0c94bee94d46f8d74b839b /drivers/mtd/ubi/ubi.h
parentb86a2c56e512f46d140a4bcb4e35e8a7d4a99a4b (diff)
UBI: add notification API
UBI volume notifications are intended to create the API to get clients notified about volume creation/deletion, renaming and re-sizing. A client can subscribe to these notifications using 'ubi_volume_register()' and cancel the subscription using 'ubi_volume_unregister()'. When UBI volumes change, a blocking notifier is called. Clients also can request "added" events on all volumes that existed before client subscribed to the notifications. If we use notifications instead of calling functions like 'ubi_gluebi_xxx()', we can make the MTD emulation layer to be more flexible: build it as a separate module and load/unload it on demand. [Artem: many cleanups, rework locking, add "updated" event, provide device/volume info in notifiers] Signed-off-by: Dmitry Pervushin <dpervushin@embeddedalley.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/ubi.h')
-rw-r--r--drivers/mtd/ubi/ubi.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h
index 6d929329a8d5..86e1a4e0ab01 100644
--- a/drivers/mtd/ubi/ubi.h
+++ b/drivers/mtd/ubi/ubi.h
@@ -38,6 +38,7 @@
38#include <linux/vmalloc.h> 38#include <linux/vmalloc.h>
39#include <linux/mtd/mtd.h> 39#include <linux/mtd/mtd.h>
40#include <linux/mtd/ubi.h> 40#include <linux/mtd/ubi.h>
41#include <linux/notifier.h>
41 42
42#include "ubi-media.h" 43#include "ubi-media.h"
43#include "scan.h" 44#include "scan.h"
@@ -483,6 +484,7 @@ extern const struct file_operations ubi_cdev_operations;
483extern const struct file_operations ubi_vol_cdev_operations; 484extern const struct file_operations ubi_vol_cdev_operations;
484extern struct class *ubi_class; 485extern struct class *ubi_class;
485extern struct mutex ubi_devices_mutex; 486extern struct mutex ubi_devices_mutex;
487extern struct blocking_notifier_head ubi_notifiers;
486 488
487/* vtbl.c */ 489/* vtbl.c */
488int ubi_change_vtbl_record(struct ubi_device *ubi, int idx, 490int ubi_change_vtbl_record(struct ubi_device *ubi, int idx,
@@ -575,6 +577,16 @@ struct ubi_device *ubi_get_device(int ubi_num);
575void ubi_put_device(struct ubi_device *ubi); 577void ubi_put_device(struct ubi_device *ubi);
576struct ubi_device *ubi_get_by_major(int major); 578struct ubi_device *ubi_get_by_major(int major);
577int ubi_major2num(int major); 579int ubi_major2num(int major);
580int ubi_volume_notify(struct ubi_device *ubi, struct ubi_volume *vol,
581 int ntype);
582int ubi_notify_all(struct ubi_device *ubi, int ntype,
583 struct notifier_block *nb);
584int ubi_enumerate_volumes(struct notifier_block *nb);
585
586/* kapi.c */
587void ubi_do_get_device_info(struct ubi_device *ubi, struct ubi_device_info *di);
588void ubi_do_get_volume_info(struct ubi_device *ubi, struct ubi_volume *vol,
589 struct ubi_volume_info *vi);
578 590
579/* 591/*
580 * ubi_rb_for_each_entry - walk an RB-tree. 592 * ubi_rb_for_each_entry - walk an RB-tree.