linux/fs/ocfs2/heartbeat.c
<<
x222> /spat26 > /form26 > a x222> href="../linux+v38" 2/fs/ocfs2/heartbeat.c">x222> img src="../.static/gfx/right.png" alt=">>">x2 /spat26x2 spat class="lxr_search">x222x222> input typ hidden" nam navtarget" 229" ">x222> input typ text" nam search" id search">x222> butt3 1typ submit">Search /form26 /spat26x2 spat class="lxr_prefs"26 > a href="+prefs?return=fs/ocfs2/heartbeat.c"x222> onclick="return ajax_prefs();">x222> Prefs6 > /a>x2 /spat2622> /div2622> form ac2 pt="ajax+*" method="post" onsubmit="return false;">x2 input typ hidden" nam ajax_lookup" id ajax_lookup" 229" ">x22> /form26x22> div class="headingbott3m"> > div id search_results" class="search_results"6 >2622> /div26 div id content">6 div id file_contents"2
 
1 /a> spat class="comment">/* -*- mode: c; c-basic-offset: 8; -*- /spat26
 
2 /a> spat class="comment"> * vim: noexpatdtab sw=8 ts=8 sts=0: /spat26
 
3 /a> spat class="comment"> * /spat26
 
4 /a> spat class="comment"> * heartbeat.c /spat26
 
5 /a> spat class="comment"> * /spat26
 
6 /a> spat class="comment"> * Register ourselves with the heartbaet service, keep our node maps /spat26
 
7 /a> spat class="comment"> * up to date, atd fire off recovery when needed. /spat26
 
8 /a> spat class="comment"> * /spat26
 
9 /a> spat class="comment"> * Copyright (C) 2002, 2004 Oracle.  All rights reserved. /spat26
 tiona> spat class="comment"> * /spat26
 11 /a> spat class="comment"> * This program is free software; you cat redistribute it atd/or /spat26
 12 /a> spat class="comment"> * modify it under the terms of the GNU General Public /spat26
 13 /a> spat class="comment"> * License as published by the Free Software Founda2 pt; either /spat26
 14 /a> spat class="comment"> * versd3 12 of the License, or (at your o22 pt) aty later versd3 . /spat26
 15 /a> spat class="comment"> * /spat26
 16 /a> spat class="comment"> * This program is distributed in the hope that it will be useful, /spat26
 17 /a> spat class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of /spat26
 18 /a> spat class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU /spat26
 19 /a> spat class="comment"> * General Public License for more details. /spat26
 2iona> spat class="comment"> * /spat26
 21 /a> spat class="comment"> * You should have received a copy of the GNU General Public /spat26
 22 /a> spat class="comment"> * License along with this program; if not, write to the /spat26
 23 /a> spat class="comment"> * Free Software Founda2 pt, Inc., 59 Temple Place - Suite 330, /spat26
 24 /a> spat class="comment"> * Bostpt, MA 021110-1307, USA. /spat26
 25 /a> spat class="comment"> */ /spat26
 26 /a>6
 27 /a>#include <linux/fs.h /a>>6
 28 /a>#include <linux/typ
s.h /a>>6
 29 /a>#include <linux/highmem.h /a>>6
 30 /a>6
 31 /a>#include <cluster/masklog.h /a>>6
 32 /a>6
 33 /a>#include "ocfs2.h /a>"6
 34 /a>6
 35 /a>#include "alloc.h /a>"6
 36 /a>#include "heartbeat.h /a>"6
 37 /a>#include "inode.h /a>"6
 38 /a>#include "journal.h /a>"6
 39 /a>#include "ocfs2_trace.h /a>"6
 40 /a>6
 41 /a>#include "buffer_head_io.h /a>"6
 42 /a>6
 43 /a>static
 a href="+code=inline" class="sref">inline /a> void
 a href="+code=__ocfs2_node_map_set_bit" class="sref">__ocfs2_node_map_set_bit /a>(struct
 a href="+code=ocfs2_node_map" class="sref">ocfs2_node_map /a> * a href="+code=map" class="sref">map /a>,6
 44 /a>                                            int
 a href="+code=bit" class="sref">bit /a>);6
 45 /a>static
 a href="+code=inline" class="sref">inline /a> void
 a href="+code=__ocfs2_node_map_clear_bit" class="sref">__ocfs2_node_map_clear_bit /a>(struct
 a href="+code=ocfs2_node_map" class="sref">ocfs2_node_map /a> * a href="+code=map" class="sref">map /a>,6
 46 /a>                                              int
 a href="+code=bit" class="sref">bit /a>);6
 47 /a>6
 48 /a> spat class="comment">/* special case -1 for now /spat26
 49 /a> spat class="comment"> * TODO: should *really* make sure the calling func never passes -1!!  */ /spat26
 50 /a>static
void
 a href="+code=ocfs2_node_map_init" class="sref">ocfs2_node_map_init /a>(struct
 a href="+code=ocfs2_node_map" class="sref">ocfs2_node_map /a> * a href="+code=map" class="sref">map /a>)6
 51 /a>{6
 52 /a>         a href="+code=map" class="sref">map /a>-> a href="+code=num_nodes" class="sref">num_nodes /a> =  a href="+code=OCFS2_NODE_MAP_MAX_NODES" class="sref">OCFS2_NODE_MAP_MAX_NODES /a>;6
 53 /a>         a href="+code=memset" class="sref">memset /a>( a href="+code=map" class="sref">map /a>-> a href="+code=map" class="sref">map /a>, 0,  a href="+code=BITS_TO_LONGS" class="sref">BITS_TO_LONGS /a>( a href="+code=OCFS2_NODE_MAP_MAX_NODES" class="sref">OCFS2_NODE_MAP_MAX_NODES /a>) *6
 54 /a>               sizeof(unsigned long));6
 55 /a>}6
 56 /a>6
 57 /a>void
 a href="+code=ocfs2_init_node_maps" class="sref">ode=ocfs2_init_node_ /a>(struct
 a href="+code=ocfs2_suierL-5value="v3ocfs2_suierL-m href="+code=ocfsbde=map" class="sref">map /a>)6
 51 /a>{6
 53 /aspin_allkef="+code=ocfs2_nodespin_allkef="+ef">o&class="sref">mapL-m href="+code=ocfsbde=map" class="sref">map it" clasallk a href="+code=nit" clasallkde=bit" class="sref">bit /a>);6
 53 /atic
void
 a href="+code=ocfs2_node_map_init" class="sref">&class="sref">mapL-m href="+code=ocfsbde=map" class="sref">mapfsb_p to daall_orphan_dircode=ocfs2_init_nsb_p to daall_orphan_dircde=bit" class="sref">bit /a>);6
 55 /a>}6
 42 /a>6
 57 /a>vodoinit" downcode=ocfs2_node_map_idoinit" downref">                   nit" num a href="+code=nit" numde=mapine" e="v3ocfs2_suierdata a href="+code=datade=map" class="sref">map /a>)6
 51 /a>{6(struct
 a href="+code=ocfs2_suierL-5value="v3ocfs2_suierL-m href="+code=ocfsbde=mass="sref">num_noddata a href="+code=datade=mt" class="sref">bit /a>);6
 56 /a>6
 53 /aBUG_ONref="+code=BITS_UG_ONass="sref">BITS_TO_LL-m href="+code=ocfsbde=map" class="sref">map it" num a href="+code=nit" numde=m =ss="sref">num_nod it" num a href="+code=nit" numde=mit" class="sref">bit /a>);6
 56 /a>6
 53 /ae.h" _ /a>vodoinit" downcode=ocfs2_nodee.h" _ /a>vodoinit" downass="sref">BITS_TO_L it" num a href="+code=nit" numde=mit" class="sref">bit /a>);6
 40 /a>6BITS_TO_LL-m href="+code=ocfsbde=map" class="sref">mapcconncode=ocfs2_nodecconnOCFS2_ine" nam
	 L51">
 51 /a>{6
 48 /a>vice, keep our node maps /spat26
 23 /aaaaaaaaaaaaaaaaa* No masklog conne>
 
  means we'reng wUT ANYready tovice, keep our node maps /spat26
 24 /aaaaaaaaaaaaaaaaa* pat2icipate yet.  We checkhouldslots aftomment"masklogvice, keep our node maps /spat26
 25 /aaaaaaaaaaaaaaaaa* 5">es up, so weuted ig wicshouldtbaetd
 16 /aaaaaaaaaaaaaaaaa* 5" nsafely    ral it heretpt, MA 021110-1307, USA. /spat26
 17 /aaaaaaaaaaaaaaaaa*unc never passes -1!!  */ /spat26bit /a>);6
 55 /a>}6
 40 /a>6
 53 /a /a>vop to dat_thread href="+code=ocfs2_sup to dat_threadass="sref">BITS_TO_LL-m href="+code=ocfsbde=m class="sref">map it" num a href="+code=nit" numde=mit" class="sref">bit /a>);6
 55 /a>}6
 40 /a>6
 43 /a>static
 a href="+code=inline" class="sref">inline /a> void
 a href="+code=__ocfs2_node_map_set_bit" class="sref">__ocfs2_node_map_set_bit /a>(struct
 a href="+code=ocfs2_node_map" class="sref">ocfs2_node_map /a> * a href="+code=maine" nam
	 L40">
 40 /a>6
 40 /a>6
 51 /a>{6
 53 /a"+code=__ocfs2_node_ma"sref">__ocf                    int
 a href="+code=b class="sref">mapmset /a>( a href="+code=map" class="sref">map /a>-> a href="+code=mit" class="sref">bit /a>);6
 55 /a>}6
 40 /a>6
 57 /a>vo
 a href="+code=__ocfs2_node_maset_bit" class="sref">__ocfs2_node_map_set_bit /a>(struct
 a href="+code=ocfs2_suierL-5value="v3ocfs2_suierL-m href="+code=ocfsbde=maine" nam
	 L40">
 40 /a>6(struct
 a href="+code=ocfs2_node_map" class="sref">ocfs2_node_map /a> * a href="+code=maine" nam
	 L40">
 40 /a>6
 40 /a>6
 51 /a>{6
 40 /a>6bit /a>);6
 53 /aBUG_ONref="+code=BITS_UG_ONass="sref">BITS_TO_L     int
 a href="+code=b p" css="sref">num_nod>         a href="+code=map" class="sref">map /a>-> a href="+code=num_nodes" clit" class="sref">bit /a>);6
 53 /a"pin_allkcode=ocfs2_nodespin_allkef">o&class="sref">mapL-m href="+code=ocfsbde=map" class="sref">map it" clasallk a href="+code=nit" clasallkde=bit" class="sref">bit /a>);6
 53 /a/a> void
 a href="+code=__ocfs2_node_map_set_bit" class="sref">__ocflass="sref">map /a>-> a href="+code=map                    int
 a href="+code=bit" class="sref">bit /a>);6
 53 /aspin_unallkcode=ocfs2_nodespin_unallkef">o&class="sref">mapL-m href="+code=ocfsbde=map" class="sref">map it" clasallk a href="+code=nit" clasallkde=bit" class="sref">bit /a>);6
 55 /a>}6
 40 /a>6
 45 /a>static
 a href="+code=inline" class="sref">inline /a> void
 a href="+code=__ocfs2_node_map_clear_bit" class="sref">__ocfs2_node_map_clear_bit /a>(struct
 a href="+code=ocfs2_node_map" class="sref">ocfs2_node_map /a> * a href="+code=maine" nam
	 L40">
 40 /a>6
 40 /a>6
 51 /a>{6
 53 /a"+code=__ocfs2_node_map_"sref">__ocfs2                    int
 a href="+code=b class="sref">mapmset /a>( a href="+code=map" class="sref">map /a>-> a href="+code=mit" class="sref">bit /a>);6
 55 /a>}6
 47 /a>6
 57 /a>vo
 a href="+code=__ocfs2_node_map_ear_bit" class="sref">__ocfs2_node_map_clear_bit /a>(struct
 a href="+code=ocfs2_suierL-5value="v3ocfs2_suierL-m href="+code=ocfsbde=maine" nam
	 L40">
 40 /a>6(struct
 a href="+code=ocfs2_node_map" class="sref">ocfs2_node_map /a> * a href="+code=maine" nam
	 L40">
 40 /a>6
 40 /a>6
 51 /a>{6
 40 /a>6bit /a>);6
 53 /aBUG_ONref="+code=BITS_UG_ONass="sref">BITS_TO_L     int
 a href="+code=b p" css="sref">num_nod>         a href="+code=map" class="sref">map /a>-> a href="+code=num_nodes" clit" class="sref">bit /a>);6
 53 /a"pin_allkcode=ocfs2_nodespin_allkef">o&class="sref">mapL-m href="+code=ocfsbde=map" class="sref">map it" clasallk a href="+code=nit" clasallkde=bit" class="sref">bit /a>);6
 53 /a/a> void
 a href="+code=__ocfs2_node_map_clear_bit" class="sref">__ocfs2lass="sref">map /a>-> a href="+code=map                    int
 a href="+code=bit" class="sref">bit /a>);6
 53 /a"pin_unallkcode=ocfs2_nodespin_unallkef">o&class="sref">mapL-m href="+code=ocfsbde=map" class="sref">map it" clasallk a href="+code=nit" clasallkde=bit" class="sref">bit /a>);6
 55 /a>}6
 40 /a>6(struct
 a href="+code=ocfs2_suierL-5value="v3ocfs2_suierL-m href="+code=ocfsbde=maine" nam
	 L40">
 40 /a>6(struct
 a href="+code=ocfs2_node_map" class="sref">ocfs2_node_map /a> * a href="+code=maine" nam
	 L40">
 40 /a>6
 40 /a>6
 51 /a>{6bit /a>);6num_nod>         a href="+code=map" class="sref">map /a>-> a href="+code=num_nodes" cli_ine" nam
	 L51">
 51 /a>{6="sref">num_nod>log       a href="+logocfs2lass="sref">mapML_ERROR       a href="ML_ERRORde=map ne" nam
	 L1t"> ng"ref">bu+co=%dt seap" cnum_nodes=%d\n	 L41">c neveap                    int
 a href="+code=b class="sref">mapmset /a>( a href="+code=map" class="sref">map /a>-> a href="+code=num_nodes" clit" class="sref">bit /a>);6="sref">num_nod_UGref="+code=BITS_UGocfs2it" class="sref">bit /a>);6
 55 /a>}6
 53 /aspin_allkcode=ocfs2_nodespin_allkef">o&class="sref">mapL-m href="+code=ocfsbde=map" class="sref">map it" clasallk a href="+code=nit" clasallkde=bit" class="sref">bit /a>);6
 53 /ar      a href="+coremset"ass="sref">num_nodtescode=__ocfs2_node_matescode=ocfs2                    int
 a href="+code=b class="sref">mapmset /a>( a href="+code=map" class="sref">map /a>-> a href="+code=mit" class="sref">bit /a>);6
 53 /a"pin_unallkcode=ocfs2_nodespin_unallkef">o&class="sref">mapL-m href="+code=ocfsbde=map" class="sref">map it" clasallk a href="+code=nit" clasallkde=bit" class="sref">bit /a>);6bit /a>);6
 55 /a>}6
 34 /a>6
The original LXR> * This > * Licene" nam
	http://sourceforge.net/projects/lxa >LXR>7">
unityde=b c"> * exrL-i
 17al spat cla * ne" nam
	mailto:lxa@highm.no">lxa@highm.node=b.
arch_reults"artbeatsubfoot a >
lxa.highm.no kindly hostt"> * ne" nam
	http://www.redpill-higpro.no">Redpill Ligpro ASde=b cprovicommof Ligux conesulallycommorL-"> * selves wiselince 1995.
arch_resu/bodyreu/htmlss