diff options
author | Joseph Qi <joseph.qi@huawei.com> | 2013-09-11 17:20:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-11 18:56:50 -0400 |
commit | 9a239e4c68df78888f67b1d4e7d507e24ac6764f (patch) | |
tree | 5cd339c77c7aa06aa9b0cdc87259f9ce10fcdccc /fs | |
parent | 7aebff18b91ebdefe15bb7d3f5d711df8312a7fb (diff) |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/cluster/tcp.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c index d04a3c2fad3c..8c50c238577a 100644 --- a/fs/ocfs2/cluster/tcp.c +++ b/fs/ocfs2/cluster/tcp.c | |||
@@ -766,32 +766,32 @@ static struct o2net_msg_handler * | |||
766 | o2net_handler_tree_lookup(u32 msg_type, u32 key, struct rb_node ***ret_p, | 766 | o2net_handler_tree_lookup(u32 msg_type, u32 key, struct rb_node ***ret_p, |
767 | struct rb_node **ret_parent) | 767 | struct rb_node **ret_parent) |
768 | { | 768 | { |
769 | struct rb_node **p = &o2net_handler_tree.rb_node; | 769 | struct rb_node **p = &o2net_handler_tree.rb_node; |
770 | struct rb_node *parent = NULL; | 770 | struct rb_node *parent = NULL; |
771 | struct o2net_msg_handler *nmh, *ret = NULL; | 771 | struct o2net_msg_handler *nmh, *ret = NULL; |
772 | int cmp; | 772 | int cmp; |
773 | 773 | ||
774 | while (*p) { | 774 | while (*p) { |
775 | parent = *p; | 775 | parent = *p; |
776 | nmh = rb_entry(parent, struct o2net_msg_handler, nh_node); | 776 | nmh = rb_entry(parent, struct o2net_msg_handler, nh_node); |
777 | cmp = o2net_handler_cmp(nmh, msg_type, key); | 777 | cmp = o2net_handler_cmp(nmh, msg_type, key); |
778 | 778 | ||
779 | if (cmp < 0) | 779 | if (cmp < 0) |
780 | p = &(*p)->rb_left; | 780 | p = &(*p)->rb_left; |
781 | else if (cmp > 0) | 781 | else if (cmp > 0) |
782 | p = &(*p)->rb_right; | 782 | p = &(*p)->rb_right; |
783 | else { | 783 | else { |
784 | ret = nmh; | 784 | ret = nmh; |
785 | break; | 785 | break; |
786 | } | 786 | } |
787 | } | 787 | } |
788 | 788 | ||
789 | if (ret_p != NULL) | 789 | if (ret_p != NULL) |
790 | *ret_p = p; | 790 | *ret_p = p; |
791 | if (ret_parent != NULL) | 791 | if (ret_parent != NULL) |
792 | *ret_parent = parent; | 792 | *ret_parent = parent; |
793 | 793 | ||
794 | return ret; | 794 | return ret; |
795 | } | 795 | } |
796 | 796 | ||
797 | static void o2net_handler_kref_release(struct kref *kref) | 797 | static void o2net_handler_kref_release(struct kref *kref) |