diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/jffs2/nodelist.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/jffs2/nodelist.h b/fs/jffs2/nodelist.h index 0ddfd70307fb..4178b4b55948 100644 --- a/fs/jffs2/nodelist.h +++ b/fs/jffs2/nodelist.h | |||
@@ -294,23 +294,21 @@ static inline int jffs2_encode_dev(union jffs2_device_node *jdev, dev_t rdev) | |||
294 | 294 | ||
295 | static inline struct jffs2_node_frag *frag_first(struct rb_root *root) | 295 | static inline struct jffs2_node_frag *frag_first(struct rb_root *root) |
296 | { | 296 | { |
297 | struct rb_node *node = root->rb_node; | 297 | struct rb_node *node = rb_first(root); |
298 | 298 | ||
299 | if (!node) | 299 | if (!node) |
300 | return NULL; | 300 | return NULL; |
301 | while(node->rb_left) | 301 | |
302 | node = node->rb_left; | ||
303 | return rb_entry(node, struct jffs2_node_frag, rb); | 302 | return rb_entry(node, struct jffs2_node_frag, rb); |
304 | } | 303 | } |
305 | 304 | ||
306 | static inline struct jffs2_node_frag *frag_last(struct rb_root *root) | 305 | static inline struct jffs2_node_frag *frag_last(struct rb_root *root) |
307 | { | 306 | { |
308 | struct rb_node *node = root->rb_node; | 307 | struct rb_node *node = rb_last(root); |
309 | 308 | ||
310 | if (!node) | 309 | if (!node) |
311 | return NULL; | 310 | return NULL; |
312 | while(node->rb_right) | 311 | |
313 | node = node->rb_right; | ||
314 | return rb_entry(node, struct jffs2_node_frag, rb); | 312 | return rb_entry(node, struct jffs2_node_frag, rb); |
315 | } | 313 | } |
316 | 314 | ||