Lines Matching refs:root
84 struct rb_root *root; member
98 struct rb_root root; member
175 #define TREE_ROOT(d, name) (&d->trees[MTDSWAP_ ## name].root)
209 if (eb->root) { in mtdswap_eb_detach()
210 tp = container_of(eb->root, struct mtdswap_tree, root); in mtdswap_eb_detach()
214 rb_erase(&eb->rb, eb->root); in mtdswap_eb_detach()
218 static void __mtdswap_rb_add(struct rb_root *root, struct swap_eb *eb) in __mtdswap_rb_add() argument
223 p = &root->rb_node; in __mtdswap_rb_add()
234 rb_insert_color(&eb->rb, root); in __mtdswap_rb_add()
239 struct rb_root *root; in mtdswap_rb_add() local
241 if (eb->root == &d->trees[idx].root) in mtdswap_rb_add()
245 root = &d->trees[idx].root; in mtdswap_rb_add()
246 __mtdswap_rb_add(root, eb); in mtdswap_rb_add()
247 eb->root = root; in mtdswap_rb_add()
251 static struct rb_node *mtdswap_rb_index(struct rb_root *root, unsigned int idx) in mtdswap_rb_index() argument
256 p = rb_first(root); in mtdswap_rb_index()
274 eb->root = NULL; in mtdswap_handle_badblock()
627 eb->root = NULL; in mtdswap_map_free_block()
816 if (d->trees[idx].root.rb_node != NULL) in __mtdswap_choose_gc_tree()
854 struct rb_root *root; in mtdswap_choose_wl_tree() local
858 root = &d->trees[i].root; in mtdswap_choose_wl_tree()
859 if (root->rb_node == NULL) in mtdswap_choose_wl_tree()
862 wear = d->max_erase_count - MTDSWAP_ECNT_MIN(root); in mtdswap_choose_wl_tree()
909 rp = &d->trees[idx].root; in mtdswap_pick_gc_eblk()
913 eb->root = NULL; in mtdswap_pick_gc_eblk()
1234 struct rb_root *root = &d->trees[i].root; in mtdswap_show() local
1236 if (root->rb_node) { in mtdswap_show()
1238 min[i] = rb_entry(rb_first(root), struct swap_eb, in mtdswap_show()
1240 max[i] = rb_entry(rb_last(root), struct swap_eb, in mtdswap_show()
1323 struct dentry *root; in mtdswap_add_debugfs() local
1326 root = debugfs_create_dir(gd->disk_name, NULL); in mtdswap_add_debugfs()
1327 if (IS_ERR(root)) in mtdswap_add_debugfs()
1330 if (!root) { in mtdswap_add_debugfs()
1335 d->debugfs_root = root; in mtdswap_add_debugfs()
1337 dent = debugfs_create_file("stats", S_IRUSR, root, d, in mtdswap_add_debugfs()
1341 debugfs_remove_recursive(root); in mtdswap_add_debugfs()
1365 d->trees[i].root = RB_ROOT; in mtdswap_init()