diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2007-12-16 05:49:01 -0500 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2007-12-26 12:15:14 -0500 |
commit | 06b68ba15671f32a3aa3bbddf04b0d2dd7fbf902 (patch) | |
tree | 67024857173069023835148077775e8c9e381d8a /drivers/mtd/ubi/ubi.h | |
parent | 3a8d4642861fb69b62401949e490c0bcb19ceb40 (diff) |
UBI: create ubi_wl_entry slab on initialization
Similarly to ltree_entry_slab, it makes more sense to create
and destroy ubi_wl_entry slab on module initialization/exit.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/ubi/ubi.h')
-rw-r--r-- | drivers/mtd/ubi/ubi.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/mtd/ubi/ubi.h b/drivers/mtd/ubi/ubi.h index 0f2ea81b3122..b7c93173e77b 100644 --- a/drivers/mtd/ubi/ubi.h +++ b/drivers/mtd/ubi/ubi.h | |||
@@ -98,6 +98,22 @@ extern int ubi_devices_cnt; | |||
98 | extern struct ubi_device *ubi_devices[]; | 98 | extern struct ubi_device *ubi_devices[]; |
99 | 99 | ||
100 | /** | 100 | /** |
101 | * struct ubi_wl_entry - wear-leveling entry. | ||
102 | * @rb: link in the corresponding RB-tree | ||
103 | * @ec: erase counter | ||
104 | * @pnum: physical eraseblock number | ||
105 | * | ||
106 | * This data structure is used in the WL unit. Each physical eraseblock has a | ||
107 | * corresponding &struct wl_entry object which may be kept in different | ||
108 | * RB-trees. See WL unit for details. | ||
109 | */ | ||
110 | struct ubi_wl_entry { | ||
111 | struct rb_node rb; | ||
112 | int ec; | ||
113 | int pnum; | ||
114 | }; | ||
115 | |||
116 | /** | ||
101 | * struct ubi_ltree_entry - an entry in the lock tree. | 117 | * struct ubi_ltree_entry - an entry in the lock tree. |
102 | * @rb: links RB-tree nodes | 118 | * @rb: links RB-tree nodes |
103 | * @vol_id: volume ID of the locked logical eraseblock | 119 | * @vol_id: volume ID of the locked logical eraseblock |
@@ -382,6 +398,7 @@ struct ubi_device { | |||
382 | }; | 398 | }; |
383 | 399 | ||
384 | extern struct kmem_cache *ubi_ltree_slab; | 400 | extern struct kmem_cache *ubi_ltree_slab; |
401 | extern struct kmem_cache *ubi_wl_entry_slab; | ||
385 | extern struct file_operations ubi_cdev_operations; | 402 | extern struct file_operations ubi_cdev_operations; |
386 | extern struct file_operations ubi_vol_cdev_operations; | 403 | extern struct file_operations ubi_vol_cdev_operations; |
387 | extern struct class *ubi_class; | 404 | extern struct class *ubi_class; |