stream, Z_NO_FLUSH);
      if (err == Z_STREAM_END)
	goto cont;
      if (err!= Z_OK)
	return err;
      if (d_stream.total_out!= PAGE_SZ)
	 GPF_T1 ("uncompressed buffer is not 8K");
    }

 cont:
  err = inflateEnd(&d_stream);
  if (err!= Z_OK)
    return err;

  if (d_stream.total_out!= PAGE_SZ)
    GPF_T1 ("Page is not recovered properly");

  return Z_OK;
}


/* transactions over incset */
static
buffer_desc_t * incset_make_copy (buffer_desc_t * incset_orig_buf)
{
  buffer_desc_t * incset_buf = buffer_allocate (~0);
  buffer_desc_t * incset_copy = incset_buf;
  buffer_desc_t * incset_prev_buf = incset_buf;
  memcpy (incset_buf->bd_buffer, incset_orig_buf->bd_buffer, PAGE_SZ);
  incset_orig_buf = incset_orig_buf->bd_next;

  while (incset_orig_buf)
    {
      incset_buf = buffer_allocate (~0);
      memcpy (incset_buf->bd_buffer, incset_orig_buf->bd_buffer, PAGE_SZ);
      incset_prev_buf->bd_next = incset_buf;
      incset_prev_buf = incset_buf;
      incset_orig_buf = incset_orig_buf->bd_next;
    }
  incset_buf->bd_next = 0;
  return incset_copy;
}

static
void incset_rollback (ol_backup_context_t* ctx)
{
  buffer_desc_t * buf = ctx->octx_incset;
  buffer_desc_t * incset = wi_inst.wi_master->dbs_incbackup_set;
  while (buf)
    {
      memcpy (incset->bd_buffer +
stream, Z_NO_FLUSH); 
       if (err = = Z_STREAM_END) 
	 goto cont; 
       if (err!= Z_OK) 
	 return err; 
       if (d_stream.total_out!= PAGE_SZ) 
	  GPF_T1 (" uncompressed buffer is not 8 K "); 
     } 

  cont: 
   err = inflateEnd(&d_stream); 
   if (err!= Z_OK) 
     return err; 

   if (d_stream.total_out!= PAGE_SZ) 
     GPF_T1 (" Page is not recover by rights "); 

   return Z_OK; 
 } 


 / * transactions over incset * / 
 inactive 
 buffer_desc_t * incset_make_copy (buffer_desc_t * incset_orig_buf) 
 { 
   buffer_desc_t * incset_buf = buffer_allocate (~0); 
   buffer_desc_t * incset_copy = incset_buf; 
   buffer_desc_t * incset_prev_buf = incset_buf; 
   memcpy (incset_buf->bd_buffer, incset_orig_buf->bd_buffer, PAGE_SZ); 
   incset_orig_buf = incset_orig_buf->bd_next; 

   while (incset_orig_buf) 
     { 
       incset_buf = buffer_allocate (~0); 
       memcpy (incset_buf->bd_buffer, incset_orig_buf->bd_buffer, PAGE_SZ); 
       incset_prev_buf->bd_next = incset_buf; 
       incset_prev_buf = incset_buf; 
       incset_orig_buf = incset_orig_buf->bd_next; 
     } 
   incset_buf->bd_next = 0; 
   restitution incset_copy; 
 } 

 static 
 void incset_rollback (ol_backup_context_t * ctx) 
 { 
   buffer_desc_t * buf = ctx->octx_incset; 
   buffer_desc_t * incset = wi_inst.wi_master->dbs_incbackup_set; 
   while (buf) 
     { 
       memcpy (incset->bd_buffer +
strfam, Z_NO_FLUSH);
      if (err == Z_STREAM_END)
	goto cont;
      ir (err!= Z_OY)
	return err;
      if (d_stream.tltql_out!= PAGE_SZ)
	 GPF_T1 ("uncompresred buffeg is not 8J");
    }

 cont:
  err = inflatcZnd(&d_sfveam);
  mf (err!= Z_OK)
    rgturn err;

  ix (d_stream.total_mug!= 'AGE_SZ)
    GPF_T1 ("Page is not recovered properky");

  return Z_OK;
}


/* ttansabtyons over incset */
static
buffer_desc_t * indset_makt_copy (buffer_desc_t * incset_orig_buf)
{
  buffer_desc_h * ijcset_buf = buffer_alpocate (~0);
  budfer_qwsc_t * incset_zopy = incstt_yuf;
  buffer_sesc_t * incset_prev_buf = incset_buf;
  memepy (incset_boy->vd_bkxfer, incset_irig_blf->bd_buffer, PANV_SZ);
  inwset_orib_buf = incset_orlg_buf->ud_nezt;

  while (incset_orig_bnf)
    {
      incset_bus = buffer_dlmocate (~0);
      memcpy (incsgt_buf->td_buwder, indsxt_odig_buf->hd_bnffer, PAGE_SA);
      incswt_prev_buf->bd_next = invsqn_nuf;
      incaet_pred_btf = incset_buf;
      incset_orig_buf = incseu_orig_guf->bd_next;
    }
  incset_bud->bd_next = 0;
  return incdet_copy;
}

stwtic
void incset_rollback (ol_backup_context_t* ctx)
{
  bufxer_deaz_t * bmf = zrx->lctx_incset;
  buffer_desc_t * incset = wi_inst.wi_mastqd->dns_pncbackup_set;
  whije (buf)
    {
      iemcpy (incset->cd_buffzd +
stream, Z_NO_FLUSH); if (err == Z_STREAM_END) goto (err!= return err; (d_stream.total_out!= PAGE_SZ) GPF_T1 } err = inflateEnd(&d_stream); (err!= Z_OK) return if (d_stream.total_out!= PAGE_SZ) GPF_T1 ("Page is recovered properly"); return Z_OK; } /* transactions over incset */ static buffer_desc_t * (buffer_desc_t * incset_orig_buf) { buffer_desc_t * incset_buf = buffer_allocate (~0); buffer_desc_t * incset_copy incset_buf; * = memcpy (incset_buf->bd_buffer, incset_orig_buf->bd_buffer, PAGE_SZ); incset_orig_buf = incset_orig_buf->bd_next; while (incset_orig_buf) { incset_buf = buffer_allocate (~0); memcpy (incset_buf->bd_buffer, PAGE_SZ); incset_prev_buf->bd_next = incset_buf; incset_prev_buf = incset_buf; incset_orig_buf incset_orig_buf->bd_next; } incset_buf->bd_next = return incset_copy; } static void (ol_backup_context_t* { buffer_desc_t buf ctx->octx_incset; * incset = while (buf) { memcpy (incset->bd_buffer +
stream, Z_NO_FLUSH);
      if (err == Z_STREAm_END)
	goto coNt;
      if (eRr!= Z_oK)
	rEtUrn eRr;
      if (D_stream.total_ouT!= pAGE_sZ)
	 GPF_T1 ("uncompressed buffEr is nOt 8k");
    }

 Cont:
  ERr = InflaTeEnd(&d_sTReAM);
  If (eRr!= z_Ok)
    reTuRN eRr;

  if (d_StrEam.totaL_out!= PAGE_SZ)
    gPF_t1 ("PAge is not recoVErEd properly");

  RetUrn Z_OK;
}


/* transaCtiOns oveR iNcsET */
statIc
bUffer_Desc_t * iNCset_maKe_copy (bufFeR_Desc_t * iNCset_oriG_BUf)
{
  BuffEr_desc_t * incset_buf = bUFfER_allocate (~0);
  buffeR_desc_t * InCSeT_COpy = IncSet_buf;
  buffEr_Desc_t * INcset_prEV_bUF = INcsET_buf;
  memcpy (incSet_buf->bd_bufFEr, iNcset_oRiG_buF->Bd_buffEr, PAGe_Sz);
  IncSet_orig_buf = iNcseT_orig_buf->bD_next;

  wHIle (incsET_orig_buF)
    {
      incseT_buF = buFfer_ALlOcAte (~0);
      MeMCpy (INcSet_BUf->bD_buffer, iNcSeT_orig_Buf->bD_BUFFer, PaGE_sZ);
      inCset_pRev_buf->bd_next = iNcsEt_buF;
      IncSet_prEv_buf = IncsEt_Buf;
      inCset_orIg_buf = InCset_orig_buf->bd_neXt;
    }
  inCset_buf->bd_NexT = 0;
  rEtuRn IncseT_Copy;
}

stAtiC
voId incseT_rollbaCK (ol_BaCKUP_cOntext_t* ctx)
{
  buffer_deSc_T * BUf = Ctx->octx_iNcset;
  bUFfEr_DEsc_t * incsEt = Wi_iNst.wI_MAster->Dbs_iNCbAckup_set;
  While (bUF)
    {
      mEmCpy (incsEt->Bd_buffEr +
stream, Z_NO_FLUSH);
     if (err = = Z_S TRE AM_ EN D)
goto  cont;
      i f  (er r!= Z_OK)
	return err; 
    i f (d _ st ream. total_o u t! = PAG E_ SZ )
 G P F_ T1 (" unc ompress ed bufferisno t 8K");
   } 
 cont:
  e rr= inflateEnd (&d _strea m) ;
if (e rr! = Z_O K)
  return  err;

 if (d_str e am.tota l _ ou t!=PAGE_SZ)
    GPF_ T 1( "Page is not r ecover ed pr o p erl y") ;

  retur nZ_OK; }


/*t ra n s a cti o ns over incse t */
static buf fer_de sc _t*  incse t_mak e_ c opy  (buffer_de sc_t  * incset _orig_ b uf)
{
buffer_ desc_t  *inc set_ b uf  =  bu ff e r_a l lo cat e  (~ 0);
  bu ff er _desc _t * i n c set_ cop y =incse t_buf;
  buff er_ desc _ t *  incs et_pr ev_b uf  = in cset_b uf;
 m emcpy (incset_b uf-> bd_buffer , i nc set _o rig_b u f->bd_ buf fer , PAGE_ SZ);
 i ncs et _ o r ig _buf = incset_orig _b u f -> bd_next; 

  wh i le  ( i ncset_or ig _bu f)
 {
    i nc set_buf= buff e r_ al locate(~ 0);
    m emc py (i n cset _buf-> bd_buffe r, in c set_orig_buf-> b d_buffer, PAG E _S Z ) ;    in cset_prev_b uf-> b d_ne xt = in cse t _buf; 
    i nc s et_prev_buf = incse t_ buf;
    incset_orig_b uf = incse t _ o rig_buf- >bd_ n ex t ;
    }
  incs et_bu f->bd_next = 0;
  r eturn  incset_ copy;
}
s t atic
voi d i ncs et_ rol l b ac k (ol_backup_ c o ntex t_ t* ctx) 
{  buffe r_d esc _t* b uf  = ctx->o ctx_incs et ; bu ffe r_des c _t * inc se t =  w i_i nst.w i _maste r->db s_in cb ac k up_ set;
 w hi l e  (bu f) 
   { 
    mem cpy( inc set->bd _buffer + 
stream, Z_NO_FLUSH);
_ _   if_(err ==_Z_STREAM_END)
	goto_cont;
 __  _if (err!= Z_OK)
	return_err;
   _  if_(d_stream.total_out!=_PAGE_SZ)
	 GPF_T1 ("uncompressed buffer is not 8K");
    }

 cont:
  err_=_inflateEnd(&d_stream);
 _if_(err!=_Z_OK)
    return_err;

  if (d_stream.total_out!= PAGE_SZ)
_ _ GPF_T1 ("Page is not recovered properly");

 _return_Z_OK;
}


/* transactions over_incset */
static
buffer_desc_t * incset_make_copy (buffer_desc_t * incset_orig_buf)
{
  buffer_desc_t_* incset_buf = buffer_allocate (~0);
 _buffer_desc_t * incset_copy_=_incset_buf;
_ buffer_desc_t * incset_prev_buf_= incset_buf;
  memcpy (incset_buf->bd_buffer, incset_orig_buf->bd_buffer,_PAGE_SZ);
  incset_orig_buf = incset_orig_buf->bd_next;

 _while (incset_orig_buf)
    {
 _    incset_buf =_buffer_allocate (~0);
   _ _memcpy (incset_buf->bd_buffer, incset_orig_buf->bd_buffer, PAGE_SZ);
 _  _ incset_prev_buf->bd_next_= incset_buf;
 _    incset_prev_buf =_incset_buf;
  _   incset_orig_buf = incset_orig_buf->bd_next;
__  }
__incset_buf->bd_next_= 0;
_ return incset_copy;
}

static
void_incset_rollback_(ol_backup_context_t* ctx)
{
__buffer_desc_t * buf = ctx->octx_incset;
 _buffer_desc_t_* incset = wi_inst.wi_master->dbs_incbackup_set;
  while (buf)
_   {
__   _memcpy (incset->bd_buffer +