ocfs2: adjust code style for o2net_handler_tree_lookup()
Code in o2net_handler_tree_lookup() may be corrupted by mistake. So adjust it to promote readability. Signed-off-by: Joseph Qi <joseph.qi@huawei.com> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Joel Becker <jlbec@evilplan.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
7aebff18b9
commit
9a239e4c68
@@ -766,32 +766,32 @@ static struct o2net_msg_handler *
|
|||||||
o2net_handler_tree_lookup(u32 msg_type, u32 key, struct rb_node ***ret_p,
|
o2net_handler_tree_lookup(u32 msg_type, u32 key, struct rb_node ***ret_p,
|
||||||
struct rb_node **ret_parent)
|
struct rb_node **ret_parent)
|
||||||
{
|
{
|
||||||
struct rb_node **p = &o2net_handler_tree.rb_node;
|
struct rb_node **p = &o2net_handler_tree.rb_node;
|
||||||
struct rb_node *parent = NULL;
|
struct rb_node *parent = NULL;
|
||||||
struct o2net_msg_handler *nmh, *ret = NULL;
|
struct o2net_msg_handler *nmh, *ret = NULL;
|
||||||
int cmp;
|
int cmp;
|
||||||
|
|
||||||
while (*p) {
|
while (*p) {
|
||||||
parent = *p;
|
parent = *p;
|
||||||
nmh = rb_entry(parent, struct o2net_msg_handler, nh_node);
|
nmh = rb_entry(parent, struct o2net_msg_handler, nh_node);
|
||||||
cmp = o2net_handler_cmp(nmh, msg_type, key);
|
cmp = o2net_handler_cmp(nmh, msg_type, key);
|
||||||
|
|
||||||
if (cmp < 0)
|
if (cmp < 0)
|
||||||
p = &(*p)->rb_left;
|
p = &(*p)->rb_left;
|
||||||
else if (cmp > 0)
|
else if (cmp > 0)
|
||||||
p = &(*p)->rb_right;
|
p = &(*p)->rb_right;
|
||||||
else {
|
else {
|
||||||
ret = nmh;
|
ret = nmh;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret_p != NULL)
|
if (ret_p != NULL)
|
||||||
*ret_p = p;
|
*ret_p = p;
|
||||||
if (ret_parent != NULL)
|
if (ret_parent != NULL)
|
||||||
*ret_parent = parent;
|
*ret_parent = parent;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void o2net_handler_kref_release(struct kref *kref)
|
static void o2net_handler_kref_release(struct kref *kref)
|
||||||
|
Reference in New Issue
Block a user