提交 ea7415cc 编写于 作者: A Akinobu Mita 提交者: David Woodhouse

[JFFS2] Use rb_first() and rb_last() cleanup

Use rb_first() and rb_last() to implement frag_first() and frag_last().
Signed-off-by: NAkinbou Mita <akinobu.mita@gmail.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
上级 29175778
......@@ -294,23 +294,21 @@ static inline int jffs2_encode_dev(union jffs2_device_node *jdev, dev_t rdev)
static inline struct jffs2_node_frag *frag_first(struct rb_root *root)
{
struct rb_node *node = root->rb_node;
struct rb_node *node = rb_first(root);
if (!node)
return NULL;
while(node->rb_left)
node = node->rb_left;
return rb_entry(node, struct jffs2_node_frag, rb);
}
static inline struct jffs2_node_frag *frag_last(struct rb_root *root)
{
struct rb_node *node = root->rb_node;
struct rb_node *node = rb_last(root);
if (!node)
return NULL;
while(node->rb_right)
node = node->rb_right;
return rb_entry(node, struct jffs2_node_frag, rb);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册