aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-17 12:48:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-17 12:48:30 -0400
commitb069e8ed4d5054b1fcd31a98bb2053bde645202f (patch)
tree69d6691c02220e8d1979683fd1b0dc2efbf4e5c5 /include
parentb7c142dbf1e7422d0be7f7faa3f1163ad9da9788 (diff)
parentd9dd0887cc5c6df0dbbe5a307284610607eea7ab (diff)
Merge branch 'linux-next' of git://git.infradead.org/ubi-2.6
* 'linux-next' of git://git.infradead.org/ubi-2.6: (21 commits) UBI: add reboot notifier UBI: handle more error codes UBI: fix multiple spelling typos UBI: fix kmem_cache_free on error patch UBI: print amount of reserved PEBs UBI: improve messages in the WL worker UBI: make gluebi a separate module UBI: remove built-in gluebi UBI: add notification API UBI: do not switch to R/O mode on read errors UBI: fix and clean-up error paths in WL worker UBI: introduce new constants UBI: fix race condition UBI: minor serialization fix UBI: do not panic if volume check fails UBI: add dump_stack in checking code UBI: fix races in I/O debugging checks UBI: small debugging code optimization UBI: improve debugging messages UBI: re-name volumes_mutex to device_mutex ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/mtd/ubi.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h
index 6316fafe5c2a..6913b71d9ab2 100644
--- a/include/linux/mtd/ubi.h
+++ b/include/linux/mtd/ubi.h
@@ -132,6 +132,39 @@ struct ubi_device_info {
132 dev_t cdev; 132 dev_t cdev;
133}; 133};
134 134
135/*
136 * enum - volume notification types.
137 * @UBI_VOLUME_ADDED: volume has been added
138 * @UBI_VOLUME_REMOVED: start volume volume
139 * @UBI_VOLUME_RESIZED: volume size has been re-sized
140 * @UBI_VOLUME_RENAMED: volume name has been re-named
141 * @UBI_VOLUME_UPDATED: volume name has been updated
142 *
143 * These constants define which type of event has happened when a volume
144 * notification function is invoked.
145 */
146enum {
147 UBI_VOLUME_ADDED,
148 UBI_VOLUME_REMOVED,
149 UBI_VOLUME_RESIZED,
150 UBI_VOLUME_RENAMED,
151 UBI_VOLUME_UPDATED,
152};
153
154/*
155 * struct ubi_notification - UBI notification description structure.
156 * @di: UBI device description object
157 * @vi: UBI volume description object
158 *
159 * UBI notifiers are called with a pointer to an object of this type. The
160 * object describes the notification. Namely, it provides a description of the
161 * UBI device and UBI volume the notification informs about.
162 */
163struct ubi_notification {
164 struct ubi_device_info di;
165 struct ubi_volume_info vi;
166};
167
135/* UBI descriptor given to users when they open UBI volumes */ 168/* UBI descriptor given to users when they open UBI volumes */
136struct ubi_volume_desc; 169struct ubi_volume_desc;
137 170
@@ -141,6 +174,10 @@ void ubi_get_volume_info(struct ubi_volume_desc *desc,
141struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode); 174struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode);
142struct ubi_volume_desc *ubi_open_volume_nm(int ubi_num, const char *name, 175struct ubi_volume_desc *ubi_open_volume_nm(int ubi_num, const char *name,
143 int mode); 176 int mode);
177int ubi_register_volume_notifier(struct notifier_block *nb,
178 int ignore_existing);
179int ubi_unregister_volume_notifier(struct notifier_block *nb);
180
144void ubi_close_volume(struct ubi_volume_desc *desc); 181void ubi_close_volume(struct ubi_volume_desc *desc);
145int ubi_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset, 182int ubi_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset,
146 int len, int check); 183 int len, int check);