[Ocfs2-devel] [PATCH 13/20] ocfs2/cluster: Track number of global heartbeat regions

Joel Becker Joel.Becker at oracle.com
Sat Sep 25 02:44:48 PDT 2010


On Sat, Sep 25, 2010 at 05:36:38PM +0800, Wengang Wang wrote:
> On 10-09-14 15:50, Sunil Mushran wrote:
> > In global heartbeat mode, we have a upper limit for the number of active regions.
> > This patch adds the facility to track the number of active global heartbeat
> > regions and fails to start heartbeat if the number exceeds the maximum.
> > 
> > Signed-of-by: Sunil Mushran <sunil.mushran at oracle.com>
> > ---
> >  fs/ocfs2/cluster/heartbeat.c |   24 ++++++++++++++++++++++--
> >  1 files changed, 22 insertions(+), 2 deletions(-)
> > 
> > diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
> > index 29b5c70..57c906b 100644
> > --- a/fs/ocfs2/cluster/heartbeat.c
> > +++ b/fs/ocfs2/cluster/heartbeat.c
> > @@ -62,6 +62,12 @@ static unsigned long o2hb_live_node_bitmap[BITS_TO_LONGS(O2NM_MAX_NODES)];
> >  static LIST_HEAD(o2hb_node_events);
> >  static DECLARE_WAIT_QUEUE_HEAD(o2hb_steady_queue);
> >  
> > +/*
> > + * In global heartbeat, we maintain a series of region bitmaps.
> > + * 	- o2hb_region_bitmap allows us to limit the region number to max region.
> > + */
> > +static unsigned long o2hb_region_bitmap[BITS_TO_LONGS(O2NM_MAX_REGIONS)];
> > +
> >  #define O2HB_DB_TYPE_LIVENODES		0
> >  struct o2hb_debug_buf {
> >  	int db_type;
> > @@ -176,6 +182,7 @@ struct o2hb_region {
> >  
> >  	/* live node map of this region */
> >  	unsigned long		hr_live_node_bitmap[BITS_TO_LONGS(O2NM_MAX_NODES)];
> > +	unsigned int		hr_region_num;
> 
> I don't remember clear the value for O2NM_MAX_REGIONS, 32? Will
> u8 be better than "unsigned int"?

	It's not an on-disk structure.  There's no need to enforce the
size.

Joel

-- 

Life's Little Instruction Book #173

	"Be kinder than necessary."

Joel Becker
Consulting Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-devel mailing list