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>
This commit is contained in:
@@ -97,6 +97,22 @@ enum {
|
||||
extern int ubi_devices_cnt;
|
||||
extern struct ubi_device *ubi_devices[];
|
||||
|
||||
/**
|
||||
* struct ubi_wl_entry - wear-leveling entry.
|
||||
* @rb: link in the corresponding RB-tree
|
||||
* @ec: erase counter
|
||||
* @pnum: physical eraseblock number
|
||||
*
|
||||
* This data structure is used in the WL unit. Each physical eraseblock has a
|
||||
* corresponding &struct wl_entry object which may be kept in different
|
||||
* RB-trees. See WL unit for details.
|
||||
*/
|
||||
struct ubi_wl_entry {
|
||||
struct rb_node rb;
|
||||
int ec;
|
||||
int pnum;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ubi_ltree_entry - an entry in the lock tree.
|
||||
* @rb: links RB-tree nodes
|
||||
@@ -382,6 +398,7 @@ struct ubi_device {
|
||||
};
|
||||
|
||||
extern struct kmem_cache *ubi_ltree_slab;
|
||||
extern struct kmem_cache *ubi_wl_entry_slab;
|
||||
extern struct file_operations ubi_cdev_operations;
|
||||
extern struct file_operations ubi_vol_cdev_operations;
|
||||
extern struct class *ubi_class;
|
||||
|
Reference in New Issue
Block a user