diff options
Diffstat (limited to 'fs/jffs2/nodelist.h')
-rw-r--r-- | fs/jffs2/nodelist.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/jffs2/nodelist.h b/fs/jffs2/nodelist.h index 57f675c2c97f..a65539f28b06 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.128 2005/02/27 23:01:32 dwmw2 Exp $ | 10 | * $Id: nodelist.h,v 1.130 2005/04/09 10:46:59 dedekind Exp $ |
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | 13 | ||
@@ -363,6 +363,18 @@ static inline struct jffs2_node_frag *frag_first(struct rb_root *root) | |||
363 | node = node->rb_left; | 363 | node = node->rb_left; |
364 | return rb_entry(node, struct jffs2_node_frag, rb); | 364 | return rb_entry(node, struct jffs2_node_frag, rb); |
365 | } | 365 | } |
366 | |||
367 | static inline struct jffs2_node_frag *frag_last(struct rb_root *root) | ||
368 | { | ||
369 | struct rb_node *node = root->rb_node; | ||
370 | |||
371 | if (!node) | ||
372 | return NULL; | ||
373 | while(node->rb_right) | ||
374 | node = node->rb_right; | ||
375 | return rb_entry(node, struct jffs2_node_frag, rb); | ||
376 | } | ||
377 | |||
366 | #define rb_parent(rb) ((rb)->rb_parent) | 378 | #define rb_parent(rb) ((rb)->rb_parent) |
367 | #define frag_next(frag) rb_entry(rb_next(&(frag)->rb), struct jffs2_node_frag, rb) | 379 | #define frag_next(frag) rb_entry(rb_next(&(frag)->rb), struct jffs2_node_frag, rb) |
368 | #define frag_prev(frag) rb_entry(rb_prev(&(frag)->rb), struct jffs2_node_frag, rb) | 380 | #define frag_prev(frag) rb_entry(rb_prev(&(frag)->rb), struct jffs2_node_frag, rb) |