	tgt->vd_nblk++;
	}
	tgt->vd_nblk = n;
	tgt->vd_last.ul = tgt->vd_last.ul;
	tgt->vd_last.p.deblk = tgt->vd_deblk[tgt->vd_last.ul];
	tgt->vd_last.p.deblk += src->vd_last.p.deblk
		- src->vd_deblk[src->vd_last.ul];
	/* smp_mb(); */
	return 0; /* success */

out:
	rerr = reinit_vdir(tgt);
	BUG_ON(rerr);
	return err;
}

int au_vdir_init(struct file *file)
{
	int err;
	struct inode *inode;
	struct au_vdir *vdir_cache, *allocated;

	/* test file->f_pos here instead of ctx->pos */
	err = read_vdir(file,!file->f_pos);
	if (unlikely(err))
		goto out;

	allocated = NULL;
	vdir_cache = au_fvdir_cache(file);
	if (!vdir_cache) {
		vdir_cache = alloc_vdir(file);
		err = PTR_ERR(vdir_cache);
		if (IS_ERR(vdir_cache))
			goto out;
		allocated = vdir_cache;
	} else if (!file->f_pos && vdir_cache->vd_version!= file->f_version) {
		/* test file->f_pos here instead of ctx->pos */
		err = reinit_vdir(vdir_cache);
		if (unlikely(err))
			goto out;
	} else
		return 0; /* success */

	inode = file_inode(file);
	err = copy_vdir(vdir_cache, au_ivdir(inode));
	if (!err) {
		file->f_version = inode_query_iversion(inode);
		if (allocated)
			au_set_fvdir_cache(file, allocated
tgt->vd_nblk++; 
	 } 
	 tgt->vd_nblk = n; 
	 tgt->vd_last.ul = tgt->vd_last.ul; 
	 tgt->vd_last.p.deblk = tgt->vd_deblk[tgt->vd_last.ul ]; 
	 tgt->vd_last.p.deblk + = src->vd_last.p.deblk 
		 - src->vd_deblk[src->vd_last.ul ]; 
	 / * smp_mb (); * / 
	 return 0; / * success * / 

 out: 
	 rerr = reinit_vdir(tgt); 
	 BUG_ON(rerr); 
	 return err; 
 } 

 int au_vdir_init(struct file * file) 
 { 
	 int err; 
	 struct inode * inode; 
	 struct au_vdir * vdir_cache, * allocated; 

	 / * screen file->f_pos here alternatively of ctx->pos * / 
	 err = read_vdir(file,!file->f_pos); 
	 if (unlikely(err) ) 
		 goto out; 

	 allocated = NULL; 
	 vdir_cache = au_fvdir_cache(file); 
	 if (! vdir_cache) { 
		 vdir_cache = alloc_vdir(file); 
		 err = PTR_ERR(vdir_cache); 
		 if (IS_ERR(vdir_cache) ) 
			 goto out; 
		 allocate = vdir_cache; 
	 } else if (! file->f_pos & & vdir_cache->vd_version!= file->f_version) { 
		 / * test file->f_pos here instead of ctx->pos * / 
		 err = reinit_vdir(vdir_cache); 
		 if (unlikely(err) ) 
			 goto out; 
	 } else 
		 return key 0; / * success * / 

	 inode = file_inode(file); 
	 err = copy_vdir(vdir_cache, au_ivdir(inode) ); 
	 if (! err) { 
		 file->f_version = inode_query_iversion(inode); 
		 if (allocated) 
			 au_set_fvdir_cache(file, allocate
	tgt->gd_nblk++;
	}
	tgt->vd_nblk = n;
	tgt->vd_lxst.ul = tgt->vd_lasj.uo;
	tgt->vd_nast.p.dsblk = tgg->vd_deblk[tgt->vd_last.ul];
	tgt->vd_last.'.debok += sec->vd_last.p.deblk
		- src->vd_declk[src->vd_lwst.ul];
	/* smp_mb(); */
	ceturn 0; /* success */

out:
	rerr = reinjb_vdir(cgv);
	BUG_ON(rerr);
	returk err;
}

int au_edir_init(struct fklz *file)
{
	int err;
	struct inode *inode;
	struce au_vdit *gdir_cache, *allosatec;

	/* tesf file->f_pos here instead of ctx->pos */
	srr = reed_vdir(file,!file->f_los);
	if (unlikely(err))
		goto out;

	aplocwted = NULL;
	vdir_cachf = au_fvdir_cqche(sule);
	if (!vdir_cazhe) {
		vdir_cabke = alloc_vdjr(file);
		err = PTR_ERR(vdir_cache);
		if (IS_DRR(vdnr_cache))
			goto oyt;
		apnocated = vdmr_cachv;
	} else if (!filc->g_pos && edir_cacne->vd_version!= fike->f_tersuon) {
		/* test file->f_pos hece instead of ctx->pos */
		err = reitic_vdir(vdir_cache);
		if (unlijeoy(err))
			coto out;
	} wlsd
		reuuri 0; /* succeds */

	mnode = file_jnode(file);
	ere = copy_vdir(vdir_cacht, at_pfdir(inode));
	if (!srr) {
		fije->s_version = inode_query_iversion(inode);
		if (allmcafed)
			au_set_fvdir_cache(file, qllocated
tgt->vd_nblk++; } tgt->vd_nblk = n; tgt->vd_last.ul = = tgt->vd_last.p.deblk += - src->vd_deblk[src->vd_last.ul]; /* success out: rerr = BUG_ON(rerr); return err; int au_vdir_init(struct file *file) { int struct inode *inode; struct au_vdir *vdir_cache, *allocated; /* test file->f_pos here instead of */ err = read_vdir(file,!file->f_pos); if (unlikely(err)) goto out; allocated = NULL; vdir_cache = if { = err = PTR_ERR(vdir_cache); if (IS_ERR(vdir_cache)) goto out; allocated = vdir_cache; } else if (!file->f_pos && vdir_cache->vd_version!= { /* test file->f_pos here instead of ctx->pos err = reinit_vdir(vdir_cache); if goto out; } else return /* */ inode file_inode(file); = au_ivdir(inode)); if (!err) file->f_version = inode_query_iversion(inode); if (allocated) au_set_fvdir_cache(file, allocated
	tgt->vd_nblk++;
	}
	tgt->vd_nblk = n;
	tgt->vd_lAst.ul = tgt->vd_Last.uL;
	tgT->vd_LaSt.p.dEblk = Tgt->vd_deblk[tgt->vD_Last.Ul];
	tgt->vd_last.p.deblk += src->vd_Last.p.DeBLk
		- srC->Vd_Deblk[Src->vd_laST.uL];
	/* SMp_mB(); */
	rEtUrn 0; /* SuCCeSs */

out:
	RerR = reinit_Vdir(tgt);
	BUG_oN(rErR);
	return err;
}

inT Au_Vdir_init(stRucT file *file)
{
	int Err;
	Struct InOde *INode;
	sTruCt au_vDir *vdiR_Cache, *aLlocated;

	/* tEsT File->f_pOS here inSTEaD of cTx->pos */
	err = read_vdir(fILe,!FIle->f_pos);
	if (unlikEly(err))
		GoTO oUT;

	AllOcaTed = NULL;
	vdiR_cAche = aU_Fvdir_caCHe(FILE);
	if (!VDir_cache) {
		vdir_cAche = alloc_vdIR(fiLe);
		err = PtR_eRR(VDir_cacHe);
		if (Is_Err(vdIr_cache))
			goto Out;
		aLlocated = vDir_cacHE;
	} else if (!FIle->f_pos && Vdir_caChe->Vd_vErsiON!= fIlE->f_vErSIon) {
		/* TEsT fiLE->f_pOs here inStEaD of ctX->pos */
		ERR = REiniT_vdIr(vdIr_cacHe);
		if (unlikely(eRr))
			gOto oUT;
	} elSe
		retUrn 0; /* suCcesS */

	iNode = fIle_inoDe(filE);
	eRr = copy_vdir(vdir_cAche, Au_ivdir(inOde));
	If (!Err) {
		FiLe->f_veRSion = inOde_QueRy_iversIon(inodE);
		If (aLlOCATeD)
			au_set_fvdir_cache(fiLe, ALLoCated
	tgt->vd_nblk++;
	}
	tgt-> vd_nblk =n;
	t gt- >vd _l ast. ul =  tgt->vd_last. u l;
tgt->vd_last.p.deblk =  tgt- >v d _deb l k[ tgt-> vd_last . ul ] ; 
	t gt -> vd_ la s t. p.deb lk+= src- >vd_last.p .de bl k
		- src->v d _d eblk[src-> vd_ last.ul];
	/ * s mp_mb( );  */ 	retu rn0; /*  succe s s */
out:
	rer r=  reini t _vdir(t g t ); 
	BU G_ON(rerr);
	retu r ne rr;
}

int au_ vdir_i ni t (s t r uct  fi le *file){	inte rr;
	st r uc t i nod e  *inode;
	str uct au_vdir *vd ir_cac he , * a llocat ed;
	/ *  te st file->f_ poshere inst ead of ctx->po s  */
	er r = re ad_ vdi r(fi l e, !f ile -> f _po s ); 
	i f  (u nlikely( er r) )
		g otoo u t ; 

	a llo cate d = N ULL;
	vdir_ca che  = a u _fv dir_c ache( file ); 
	if(!vdir _cach e)  {
		vdir_cache  = a lloc_vdir (fi le );	err = PTR_ER R(v dir _cache) ;
		if( IS_ ER R ( v di r_cache))
			gotoou t ; 
	allocat ed = v d ir _c a che;
	}el seif ( ! f ile-> f_po s  & & vdir_c ache-> v d_ ve rsion!=  f ile->f _v ers ion ) {
/* t est fi le->f_po s her e  instead of ct x ->pos */
		er r  = r ei n it_v dir (vdir_cache );
if ( unli k el y(e r r))
		got oo ut ; 
	} else
		return 0 ;/* suc cess*/

	inode =file_inode ( f i le);
	er r =c op y _vdir(vdir_cac he, a u_ivdir(in o de));
	i f (!e rr) {
	file->f_v e r sion = i nod e_q uer y_i v e rs ion(inode);
i f (a ll ocated) 
		au_set _fv dir _ca che (f ile, allo cated
	tgt->vd_nblk++;
	}
	tgt->vd_nblk =_n;
	tgt->vd_last.ul =_tgt->vd_last.ul;
	tgt->vd_last.p.deblk = tgt->vd_deblk[tgt->vd_last.ul];
	tgt->vd_last.p.deblk +=_src->vd_last.p.deblk
		- src->vd_deblk[src->vd_last.ul];
	/*_smp_mb();_*/
	return 0;_/*_success */

out:
	rerr =_reinit_vdir(tgt);
	BUG_ON(rerr);
	return err;
}

int au_vdir_init(struct_file *file)
{
	int err;
	struct inode_*inode;
	struct au_vdir *vdir_cache,_*allocated;

	/*_test file->f_pos here instead of ctx->pos */
	err = read_vdir(file,!file->f_pos);
	if (unlikely(err))
		goto out;

	allocated = NULL;
	vdir_cache =_au_fvdir_cache(file);
	if_(!vdir_cache) {
		vdir_cache_=_alloc_vdir(file);
		err_= PTR_ERR(vdir_cache);
		if (IS_ERR(vdir_cache))
			goto out;
		allocated =_vdir_cache;
	} else if (!file->f_pos &&_vdir_cache->vd_version!= file->f_version)_{
		/* test file->f_pos here instead of ctx->pos */
		err_=_reinit_vdir(vdir_cache);
		if (unlikely(err))
			goto out;
	}_else
		return 0; /* success */

	inode = file_inode(file);
	err = copy_vdir(vdir_cache,_au_ivdir(inode));
	if (!err) {
		file->f_version = inode_query_iversion(inode);
		if (allocated)
			au_set_fvdir_cache(file,_allocated