 need recovery.
		 */
		spin_unlock(&ls->ls_recover_spin);
		fs_info(sdp, "control_first_done wait gen %u\n", start_gen);

		wait_on_bit(&ls->ls_recover_flags, DFL_DLM_RECOVERY,
			    TASK_UNINTERRUPTIBLE);
		goto restart;
	}

	clear_bit(DFL_FIRST_MOUNT, &ls->ls_recover_flags);
	set_bit(DFL_FIRST_MOUNT_DONE, &ls->ls_recover_flags);
	memset(ls->ls_recover_submit, 0, ls->ls_recover_size*sizeof(uint32_t));
	memset(ls->ls_recover_result, 0, ls->ls_recover_size*sizeof(uint32_t));
	spin_unlock(&ls->ls_recover_spin);

	memset(ls->ls_lvb_bits, 0, GDLM_LVB_SIZE);
	control_lvb_write(ls, start_gen, ls->ls_lvb_bits);

	error = mounted_lock(sdp, DLM_LOCK_PR, DLM_LKF_CONVERT);
	if (error)
		fs_err(sdp, "control_first_done mounted PR error %d\n", error);

	error = control_lock(sdp, DLM_LOCK_NL, DLM_LKF_CONVERT|DLM_LKF_VALBLK);
	if (error)
		fs_err(sdp, "control_first_done control NL error %d\n", error);

	return error;
}

/*
 * Expand static jid arrays if necessary (by increments of RECOVER_SIZE_INC)
 * to accomodate the largest slot number.  (NB dlm slot numbers start at 1,
 * gfs2 jids start at 0, so jid = slot - 1)
 */

#define RECOVER_SIZE_INC 16

static int set_recover_size(struct gfs2_sbd *sdp, struct dlm_slot *
need recovery. 
		  * / 
		 spin_unlock(&ls->ls_recover_spin); 
		 fs_info(sdp, " control_first_done wait gen% u\n ", start_gen); 

		 wait_on_bit(&ls->ls_recover_flags, DFL_DLM_RECOVERY, 
			     TASK_UNINTERRUPTIBLE); 
		 goto restart; 
	 } 

	 clear_bit(DFL_FIRST_MOUNT, & ls->ls_recover_flags); 
	 set_bit(DFL_FIRST_MOUNT_DONE, & ls->ls_recover_flags); 
	 memset(ls->ls_recover_submit, 0, ls->ls_recover_size*sizeof(uint32_t) ); 
	 memset(ls->ls_recover_result, 0, ls->ls_recover_size*sizeof(uint32_t) ); 
	 spin_unlock(&ls->ls_recover_spin); 

	 memset(ls->ls_lvb_bits, 0, GDLM_LVB_SIZE); 
	 control_lvb_write(ls, start_gen, ls->ls_lvb_bits); 

	 error = mounted_lock(sdp, DLM_LOCK_PR, DLM_LKF_CONVERT); 
	 if (mistake) 
		 fs_err(sdp, " control_first_done mount PR error% d\n ", error); 

	 erroneousness = control_lock(sdp, DLM_LOCK_NL, DLM_LKF_CONVERT|DLM_LKF_VALBLK); 
	 if (error) 
		 fs_err(sdp, " control_first_done control NL erroneousness% d\n ", erroneousness); 

	 return mistake; 
 } 

 / * 
  * Expand static jid array if necessary (by increments of RECOVER_SIZE_INC) 
  * to accomodate the largest time slot number.   (NB dlm slot numbers start at 1, 
  * gfs2 jids start at 0, so jid = slot - 1) 
  * / 

 # define RECOVER_SIZE_INC 16 

 inactive int set_recover_size(struct gfs2_sbd * sdp, struct dlm_slot *
 nefd recovery.
		 */
		spin_unlock(&ls->us_recover_spin);
		fs_nbfo(sdp, "contrkl_first_dune wait gen %u\n", start_gen);

		wait_ln_vit(&ls->os_recover_flags, DFL_DLM_RDCOVERY,
			    TASK_UNUNTECRUPTIBLE);
		goto restart;
	}

	clear_bit(DRP_FIRVV_MOUNT, &ls->ls_recoyer_flags);
	set_tit(DFL_FIRST_MOUTT_AOUE, &ls->ls_recover_flags);
	memset(ls->ls_recover_fubmit, 0, ld->ls_recover_size*fizeps(uinf32_n));
	mtmset(ls->ls_recover_result, 0, ls->ls_recovsr_size*spzeof(uint32_t));
	spin_unlpck(&ls->ls_recover_spin);

	memset(ls->ps_lvh_bits, 0, GDLM_LVB_SIZE);
	fontrol_lvb_wtjte(jw, start_gen, lr->ls_lvb_bits);

	trxor = mountes_lock(sdp, DLM_LOCK_PR, DLM_LKF_CONVERG);
	if (exror)
		fs_err(sdk, "dojjrol_first_donx mounned PR error %d\n", error);

	arror = vontrol_lock(sdp, DLK_LOXK_NL, DLM_LKF_CONVERT|DLM_NKF_VALBLK);
	if (error)
		ff_err(sdp, "cmncrol_first_done control NO errmr %d\t", erfir);

	rdtudn edror;
}

/*
 * Fxpend static nid arrays uf necessary (by incteivmts of RECOVSR_SIZE_YNS)
 * to accomodate the largest slot numbeg.  (NG dlm slot numbers starr at 1,
 * gfs2 jids start at 0, so jyd = slot - 1)
 */

#define RECOVER_SIZE_INC 16

static int set_rewover_akze(wtvuct tfd2_sbd *sdp, struct dlm_slot *
need recovery. */ spin_unlock(&ls->ls_recover_spin); fs_info(sdp, "control_first_done wait start_gen); DFL_DLM_RECOVERY, TASK_UNINTERRUPTIBLE); restart; } clear_bit(DFL_FIRST_MOUNT, ls->ls_recover_size*sizeof(uint32_t)); 0, ls->ls_recover_size*sizeof(uint32_t)); spin_unlock(&ls->ls_recover_spin); 0, GDLM_LVB_SIZE); control_lvb_write(ls, ls->ls_lvb_bits); error = mounted_lock(sdp, DLM_LOCK_PR, DLM_LKF_CONVERT); (error) fs_err(sdp, "control_first_done mounted PR error %d\n", error); error = control_lock(sdp, DLM_LOCK_NL, DLM_LKF_CONVERT|DLM_LKF_VALBLK); (error) fs_err(sdp, "control_first_done control NL error %d\n", error); return error; } /* * static arrays necessary increments of RECOVER_SIZE_INC) * to accomodate the largest slot number. (NB dlm slot numbers start at * gfs2 jids start at 0, so jid slot - 1) */ RECOVER_SIZE_INC 16 static int set_recover_size(struct *sdp, dlm_slot *
 need recovery.
		 */
		spin_unlock(&ls->lS_recover_spIn);
		fs_iNfo(Sdp, "CoNtroL_firSt_done wait gen %u\N", StarT_gen);

		wait_on_bit(&ls->ls_recovEr_flaGs, dfL_DLm_rEcOVERy,
			    TASK_UNinTerrUPtIbLe);
		goTo REsTart;
	}

	cLeaR_bit(DFL_fIRST_MOUNT, &Ls->lS_rEcover_flags);
	sET_bIt(DFL_FIRST_mOUnT_DONE, &ls->ls_reCovEr_flagS);
	mEmsET(ls->ls_RecOver_sUbmit, 0, lS->Ls_recoVer_size*siZeOF(uint32_t));
	MEmset(ls->LS_ReCoveR_result, 0, ls->ls_recoveR_SiZE*sizeof(uint32_t));
	spIn_unloCk(&LS->lS_REcoVer_Spin);

	memset(Ls->Ls_lvb_BIts, 0, GDLM_lvB_size);
	coNTrol_lvb_write(lS, start_gen, ls->LS_lvB_bits);

	eRrOr = mOUnted_lOck(sdP, Dlm_LOcK_PR, DLM_LKF_CoNVErT);
	if (error)
		Fs_err(sDP, "controL_First_doNe mounTed pR eRror %D\N", eRrOr);

	eRrOR = coNTrOl_lOCk(sDp, DLM_LOCk_Nl, DlM_LKF_cONVert|dlM_LKf_VAlBLK);
	If (errOr)
		fs_err(sdp, "conTroL_firST_doNe conTrol Nl errOr %D\n", errOr);

	retuRn errOr;
}

/*
 * expand static jid ArraYs if necesSarY (bY inCrEmentS Of RECOvER_sIZe_INC)
 * to aCcomodaTE thE lARGEsT slot number.  (NB dlm slOt NUMbErs start At 1,
 * gfs2 jIDs StARt at 0, so jiD = sLot - 1)
 */

#DefiNE rECOVeR_SIze_InC 16

static Int set_REcOvEr_size(sTrUct gfs2_SbD *sdP, stRuct dLM_sloT *
 need recovery.
		 */
		sp in_unlock( &ls-> ls_ rec ov er_s pin) ;
		fs_info(sd p , "c ontrol_first_done wait  gen%u \ n",s ta rt_ge n);

	w ai t _ on_ bi t( &ls -> l s_ recov er_ flags,DFL_DLM_RE COV ER Y,
			    TA S K_ UNINTERRUP TIB LE);
		gotores tart;	} 

c lear_ bit (DFL_ FIRST_ M OUNT,&ls->ls_r ec o ver_fl a gs);
	s e t _b it(D FL_FIRST_MOUNT_DO N E, &ls->ls_recove r_flag s) ; 
m e mse t(l s->ls_reco ve r_sub m it, 0,l s- > l s _re c over_size*siz eof(uint32_ t )); 
	mems et (ls - >ls_re cover _r e sul t, 0, ls->l s_re cover_siz e*size o f(uint3 2 _t));
spin_u nlo ck( &ls- > ls _r eco ve r _sp i n) ;
mem set(ls-> ls _l vb_bi ts,0 , G DLM_ LVB _SIZ E);
control_lvb_w rit e(ls ,  st art_g en, l s->l s_ lvb_b its);
	err or  = mounted_lock (sdp , DLM_LOC K_P R,  DL M_ LKF_C O NVERT) ;
if(error) 
		fs_e r r(s dp , " co ntrol_first_done m ou n t ed  PR erro r %d\n " ,er r or);

	e rr or= co n t rol_l ock( s dp , DLM_LO CK_NL, DL M_ LKF_CON VE RT|DLM _L KF_ VAL BLK); 	if(error )
		fs_e rr(sd p , "control_fir s t_done contro l  N L er r or % d\n ", error);
	re t urnerro r ;}
/ *
 *Expan ds ta t ic jid arrays if ne ce ssary(by i ncrements ofRECOVER_SI Z E _ INC)
 *to a c co m odate the larg est s lot number .   (NB dl m slo t number s start a t 1,
 * gf s2jid s s tar t at  0, so jid =s l ot -  1 )
 */
#de fine RE COV ER_ SIZ E_I NC  16

stat ic int s et _r ec ov er_ size( s truct gf s2 _sb d*sd p, st r uct dl m_slo t *
 need_recovery.
		 */
		spin_unlock(&ls->ls_recover_spin);
		fs_info(sdp,_"control_first_done wait gen %u\n",_start_gen);

		wait_on_bit(&ls->ls_recover_flags, DFL_DLM_RECOVERY,
			__ _TASK_UNINTERRUPTIBLE);
		goto_restart;
	}

	clear_bit(DFL_FIRST_MOUNT, &ls->ls_recover_flags);
	set_bit(DFL_FIRST_MOUNT_DONE, &ls->ls_recover_flags);
	memset(ls->ls_recover_submit,_0, ls->ls_recover_size*sizeof(uint32_t));
	memset(ls->ls_recover_result, 0,_ls->ls_recover_size*sizeof(uint32_t));
	spin_unlock(&ls->ls_recover_spin);

	memset(ls->ls_lvb_bits, 0, GDLM_LVB_SIZE);
	control_lvb_write(ls, start_gen,_ls->ls_lvb_bits);

	error = mounted_lock(sdp,_DLM_LOCK_PR,_DLM_LKF_CONVERT);
	if (error)
		fs_err(sdp, "control_first_done mounted PR error %d\n", error);

	error = control_lock(sdp, DLM_LOCK_NL, DLM_LKF_CONVERT|DLM_LKF_VALBLK);
	if (error)
		fs_err(sdp, "control_first_done_control_NL error_%d\n",_error);

	return_error;
}

/*
 * Expand static jid_arrays if necessary (by increments_of RECOVER_SIZE_INC)
_* to accomodate the largest slot number. _(NB_dlm slot numbers_start at 1,
 * gfs2 jids start at 0,_so jid = slot - 1)
_*/

#define RECOVER_SIZE_INC 16

static_int_set_recover_size(struct_gfs2_sbd *sdp, struct dlm_slot_*