diff options
Diffstat (limited to 'include/linux/mtd/ubi.h')
| -rw-r--r-- | include/linux/mtd/ubi.h | 37 |
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 | */ | ||
| 146 | enum { | ||
| 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 | */ | ||
| 163 | struct 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 */ |
| 136 | struct ubi_volume_desc; | 169 | struct ubi_volume_desc; |
| 137 | 170 | ||
| @@ -141,6 +174,10 @@ void ubi_get_volume_info(struct ubi_volume_desc *desc, | |||
| 141 | struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode); | 174 | struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode); |
| 142 | struct ubi_volume_desc *ubi_open_volume_nm(int ubi_num, const char *name, | 175 | struct ubi_volume_desc *ubi_open_volume_nm(int ubi_num, const char *name, |
| 143 | int mode); | 176 | int mode); |
| 177 | int ubi_register_volume_notifier(struct notifier_block *nb, | ||
| 178 | int ignore_existing); | ||
| 179 | int ubi_unregister_volume_notifier(struct notifier_block *nb); | ||
| 180 | |||
| 144 | void ubi_close_volume(struct ubi_volume_desc *desc); | 181 | void ubi_close_volume(struct ubi_volume_desc *desc); |
| 145 | int ubi_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset, | 182 | int ubi_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset, |
| 146 | int len, int check); | 183 | int len, int check); |
