From 7e0a74a55ab44da04eed8d63efe9376aac49fab7 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Fri, 1 May 2015 08:57:28 +0530 Subject: arbiter: load arbiter xlator on every 3rd brick of a replica 3 AFR subvol Backport of http://review.gluster.org/10257 Logic for adding the 'glusterd_brickinfo->group' member and using it to find the brick positon has been taken from http://review.gluster.org/#/c/9919. Thanks to Jeff Darcy for that. This patch is a part of the arbiter logic implementation for 3 way AFR details of which can be found at http://review.gluster.org/#/c/9656/ Change-Id: Idbfe4f29ee8e098e0102def8f38b32314316b188 BUG: 1217689 Signed-off-by: Ravishankar N Reviewed-on: http://review.gluster.org/10479 Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri Reviewed-by: Atin Mukherjee --- libglusterfs/src/list.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libglusterfs') diff --git a/libglusterfs/src/list.h b/libglusterfs/src/list.h index a860275a91e..875594136a2 100644 --- a/libglusterfs/src/list.h +++ b/libglusterfs/src/list.h @@ -256,4 +256,18 @@ static inline void list_replace_init(struct list_head *old, &pos->member != (head); \ pos = n, n = list_entry(n->member.prev, typeof(*n), member)) +/* + * This list implementation has some advantages, but one disadvantage: you + * can't use NULL to check whether you're at the head or tail. Thus, the + * address of the head has to be an argument for these macros. + */ + +#define list_next(ptr, head, type, member) \ + (((ptr)->member.next == head) ? NULL \ + : list_entry((ptr)->member.next, type, member)) + +#define list_prev(ptr, head, type, member) \ + (((ptr)->member.prev == head) ? NULL \ + : list_entry((ptr)->member.prev, type, member)) + #endif /* _LLIST_H */ -- cgit