diff options
author | David Woodhouse <dwmw2@infradead.org> | 2005-07-05 17:03:10 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@mtd.linutronix.de> | 2005-07-06 08:07:54 -0400 |
commit | 9dee7503ce3fc38911b9873216619190cf688128 (patch) | |
tree | 4a980e7afd14722a81472600ed13e147ff69f923 /fs/jffs2/nodelist.h | |
parent | 10c96f2ec37f5369a785cf8c5a065a15e323c743 (diff) |
[JFFS2] Optimise jffs2_add_tn_to_list
Use an rbtree instead of a simple linked list. We were wasting
an amazing amount of time in jffs2_add_tn_to_list().
Thanks to Artem Bityuckiy and Jarkko Jlavinen for noticing.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs/jffs2/nodelist.h')
-rw-r--r-- | fs/jffs2/nodelist.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/jffs2/nodelist.h b/fs/jffs2/nodelist.h index a65539f28b06..b34c397909ef 100644 --- a/fs/jffs2/nodelist.h +++ b/fs/jffs2/nodelist.h | |||
@@ -7,7 +7,7 @@ | |||
7 | * | 7 | * |
8 | * For licensing information, see the file 'LICENCE' in this directory. | 8 | * For licensing information, see the file 'LICENCE' in this directory. |
9 | * | 9 | * |
10 | * $Id: nodelist.h,v 1.130 2005/04/09 10:46:59 dedekind Exp $ | 10 | * $Id: nodelist.h,v 1.131 2005/07/05 21:03:07 dwmw2 Exp $ |
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
@@ -161,7 +161,7 @@ struct jffs2_full_dnode | |||
161 | */ | 161 | */ |
162 | struct jffs2_tmp_dnode_info | 162 | struct jffs2_tmp_dnode_info |
163 | { | 163 | { |
164 | struct jffs2_tmp_dnode_info *next; | 164 | struct rb_node rb; |
165 | struct jffs2_full_dnode *fn; | 165 | struct jffs2_full_dnode *fn; |
166 | uint32_t version; | 166 | uint32_t version; |
167 | }; | 167 | }; |
@@ -387,7 +387,7 @@ static inline struct jffs2_node_frag *frag_last(struct rb_root *root) | |||
387 | D2(void jffs2_print_frag_list(struct jffs2_inode_info *f)); | 387 | D2(void jffs2_print_frag_list(struct jffs2_inode_info *f)); |
388 | void jffs2_add_fd_to_list(struct jffs2_sb_info *c, struct jffs2_full_dirent *new, struct jffs2_full_dirent **list); | 388 | void jffs2_add_fd_to_list(struct jffs2_sb_info *c, struct jffs2_full_dirent *new, struct jffs2_full_dirent **list); |
389 | int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_info *f, | 389 | int jffs2_get_inode_nodes(struct jffs2_sb_info *c, struct jffs2_inode_info *f, |
390 | struct jffs2_tmp_dnode_info **tnp, struct jffs2_full_dirent **fdp, | 390 | struct rb_root *tnp, struct jffs2_full_dirent **fdp, |
391 | uint32_t *highest_version, uint32_t *latest_mctime, | 391 | uint32_t *highest_version, uint32_t *latest_mctime, |
392 | uint32_t *mctime_ver); | 392 | uint32_t *mctime_ver); |
393 | void jffs2_set_inocache_state(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic, int state); | 393 | void jffs2_set_inocache_state(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic, int state); |