 to it.  Finally go to the
		 * beginning of the loop and try to free the parent
		 * node.
		 */
		parent = rb_parent(n);
		fname = rb_entry(n, struct fname, rb_hash);
		while (fname) {
			struct fname * old = fname;
			fname = fname->next;
			kfree (old);
		}
		if (!parent)
			*root = RB_ROOT;
		else if (parent->rb_left == n)
			parent->rb_left = NULL;
		else if (parent->rb_right == n)
			parent->rb_right = NULL;
		n = parent;
	}
}


static struct dir_private_info *ext3_htree_create_dir_info(loff_t pos)
{
	struct dir_private_info *p;

	p = kzalloc(sizeof(struct dir_private_info), GFP_KERNEL);
	if (!p)
		return NULL;
	p->curr_hash = pos2maj_hash(pos);
	p->curr_minor_hash = pos2min_hash(pos);
	return p;
}

void ext3_htree_free_dir_info(struct dir_private_info *p)
{
	free_rb_tree_fname(&p->root);
	kfree(p);
}

/*
 * Given a directory entry, enter it into the fname rb tree.
 */
int ext3_htree_store_dirent(struct file *dir_file, __u32 hash,
			     __u32 minor_hash,
			     struct ext3_dir_entry_2 *dirent)
{
	struct rb_node **p, *parent = NULL;
	struct fname * fname, *new_fn;
	struct dir_private_info *info;
	int len;

	info = (struct dir_private_info *) dir_file->private_data;
	p = &info->root.rb_node;

	/* Create and allocate the fname structure */
	len = sizeof(struct fname) + dirent->name_len + 1;

to it.   Finally go to the 
		  * beginning of the loop and try to exempt the parent 
		  * node. 
		  * / 
		 parent = rb_parent(n); 
		 fname = rb_entry(n, struct fname, rb_hash); 
		 while (fname) { 
			 struct fname * previous = fname; 
			 fname = fname->next; 
			 kfree (old); 
		 } 
		 if (! parent) 
			 * root = RB_ROOT; 
		 else if (parent->rb_left = = n) 
			 parent->rb_left = NULL; 
		 else if (parent->rb_right = = n) 
			 parent->rb_right = NULL; 
		 n = parent; 
	 } 
 } 


 static struct dir_private_info * ext3_htree_create_dir_info(loff_t pos) 
 { 
	 struct dir_private_info * p; 

	 phosphorus = kzalloc(sizeof(struct dir_private_info), GFP_KERNEL); 
	 if (! p) 
		 return NULL; 
	 p->curr_hash = pos2maj_hash(pos); 
	 p->curr_minor_hash = pos2min_hash(pos); 
	 return phosphorus; 
 } 

 null ext3_htree_free_dir_info(struct dir_private_info * p) 
 { 
	 free_rb_tree_fname(&p->root); 
	 kfree(p); 
 } 

 / * 
  * Given a directory entry, enter it into the fname rb tree. 
  * / 
 int ext3_htree_store_dirent(struct file * dir_file, _ _ u32 hash, 
			      _ _ u32 minor_hash, 
			      struct ext3_dir_entry_2 * dirent) 
 { 
	 struct rb_node * * p, * parent = NULL; 
	 struct fname * fname, * new_fn; 
	 struct dir_private_info * information; 
	 int len; 

	 info = (struct dir_private_info *) dir_file->private_data; 
	 p = & info->root.rb_node; 

	 / * Create and allocate the fname structure * / 
	 len = sizeof(struct fname) + dirent->name_len + 1;
 to it.  Finally go to the
		 * neginning of the loop aid try fo free ghe parent
		 * node.
		 */
		parent = rb_perenr(n);
		fnane = rb_entry(n, struct fnxme, rb_hasj);
		while (fbame) {
			wtruct fname * old = fname;
			rkame = hname->next;
			kfree (pld);
		}
		if (!parett)
			*root = RB_ROOT;
		alre if (parent->rb_left == n)
			parent->rb_left = NUJL;
		else of (parent->rb_right == n)
			pswent->db_right = NULL;
		n = parent;
	}
}


static strucf dir_prpvate_info *ext3_htrer_create_dir_info(loff_t pos)
{
	strkct fir_private_info *p;

	p = kzalloc(sizgkf(seeuct dir_privxte_info), GFK_KZRNEL);
	if (!p)
		rejurn NULL;
	p->curr_hash = pos2maj_hash(por);
	p->curx_minor_hash = pis2mlt_hash(pos);
	retnrn p;
}

vjid ext3_htree_ngee_dir_itfo(struvt dir_private_ikfo *p)
{
	hree_eb_tree_fname(&p->root);
	kfree(');
}

/*
 * Given a directory entry, endex it into the fname rv rree.
 */
hnt axt3_hgeee_rtode_virsnt(strkct file *dir_fjle, __u32 hash,
			     __u32 minor_hash,
			     segict ext3_dir_enfry_2 *diwegt)
{
	struct rb_node **p, *parent = NULL;
	struct fndme * fname, *new_fn;
	struct dir_private_info *info;
	int lgn;

	info = (stwuct dir_private_info *) dir_file->private_data;
	p = &info->rood.rb_nove;

	/* Crtabc ana aplocate the fname structure */
	len = sizeof(struct rnsmv) + dirent->name_len + 1;

to it. Finally go to the * the and try free the parent rb_parent(n); = rb_entry(n, struct rb_hash); while (fname) struct fname * old = fname; = fname->next; kfree (old); } if (!parent) *root = RB_ROOT; else if (parent->rb_left n) parent->rb_left = NULL; else if (parent->rb_right == n) parent->rb_right = NULL; n parent; } struct *ext3_htree_create_dir_info(loff_t pos) { struct dir_private_info *p; p = kzalloc(sizeof(struct dir_private_info), GFP_KERNEL); if (!p) return NULL; p->curr_hash pos2maj_hash(pos); p->curr_minor_hash = pos2min_hash(pos); return p; } void dir_private_info *p) { free_rb_tree_fname(&p->root); } /* * Given a entry, it into fname tree. int ext3_htree_store_dirent(struct file __u32 hash, __u32 minor_hash, struct ext3_dir_entry_2 *dirent) { struct rb_node **p, *parent = NULL; struct fname * *new_fn; struct int len; = dir_private_info dir_file->private_data; p = Create and allocate the fname structure sizeof(struct fname) + dirent->name_len + 1;
 to it.  Finally go to the
		 * beginniNg of the looP and tRy tO frEe The pArenT
		 * node.
		 */
		parent = rb_pARent(N);
		fname = rb_entry(n, struct fnAme, rb_HaSH);
		whiLE (fName) {
			sTruct fnAMe * OLD = fnAmE;
			fNamE = fNAmE->next;
			KfrEe (old);
		}
		if (!Parent)
			*root = rB_RoOt;
		else if (parenT->Rb_Left == n)
			parenT->rb_Left = NULL;
		else If (pArent->rB_rIghT == N)
			pareNt->rB_righT = NULL;
		n = PArent;
	}
}


sTatic struCt DIr_privATe_info *eXT3_HtRee_cReate_dir_info(loff_t POs)
{
	STruct dir_privatE_info *p;

	P = kZAlLOC(siZeoF(struct dir_PrIvate_INfo), GFP_KerNel);
	IF (!p)
		rETurn NULL;
	p->curr_Hash = pos2maj_hASh(pOs);
	p->curR_mInoR_Hash = poS2min_hAsH(Pos);
	Return p;
}

void Ext3_hTree_free_dIr_info(STruct diR_Private_Info *p)
{
	fRee_Rb_tRee_fNAmE(&p->RooT);
	kFRee(P);
}

/*
 * giVen A DirEctory enTrY, eNter iT intO THE FnamE rb Tree.
 */
Int exT3_htree_store_diRenT(strUCt fIle *diR_file, __U32 hasH,
			     __u32 Minor_Hash,
			     stRuct eXt3_Dir_entry_2 *dirent)
{
	sTrucT rb_node **p, *pAreNt = nULl;
	sTruct FName * fnAme, *New_Fn;
	strucT dir_priVAte_InFO *INfO;
	int len;

	info = (struct dIr_PRIvAte_info *) dIr_file->PRiVaTE_data;
	p = &inFo->RooT.rb_nODE;

	/* CreaTe anD AlLocate thE fname STrUcTure */
	len = SiZeof(stRuCt fNamE) + direNT->namE_len + 1;

 to it.  Finally go to the 
		 * begi nning  of  th eloop  and  try to free t h e pa rent
		 * node.
		 */		par en t  = r b _p arent (n);
	f na m e  =rb _e ntr y( n ,struc t f name, r b_hash);
	wh il e (fname) {	struct fna me* old = fnam e;			fna me  =f name- >ne xt;
		kfre e  (old) ;
		}
		i f( !paren t )
			*r o o t= RB _ROOT;
		else if( pa r ent->rb_left = = n)
	p ar e n t-> rb_ left = NUL L; 
		el s e if (p a re n t - >rb _ right == n)
		parent->r b _ri ght =NU LL; 		n =paren t; 	}}


staticstru ct dir_pr ivate_ i nfo *ex t 3_htree _creat e_d ir_ info ( lo ff _tpo s )
{ 	s tru c t d ir_priva te _i nfo * p;
p =  kza llo c(si zeof( struct dir_pr iva te_i n fo) , GFP _KERN EL); 
if (! p)
		r eturn  N ULL;
	p->curr_h ash= pos2maj _ha sh (po s) ;
	p- > curr_m ino r_h ash = p os2min_ h ash (p o s ) ;	return p;
}

void  e x t 3_ htree_fr ee_dir _ in fo ( struct d ir _pr ivat e _ info*p){ 
free_rb_ tree_f n am e( &p->roo t) ;
	kfr ee (p) ;
} 

/** Gi ven adirector y ent r y, enter it in t o the fname r b  t r e e.  */int  ext3_htree _sto r e_di rent ( st ruc t  file  *dir _f i le ,  __u32 hash,
			   __u32minor _hash,
			    struct e x t 3 _dir_ent ry_2 *d i rent)
{
	struc t rb_ node **p,* parent =  NULL ;
	struc t fname * f name, *n ew_ fn; 
	s tru c t  d ir_private_in f o  *in fo ;
	intlen ;

	inf o =  (s tru ctdi r_private _info *)  d ir _f il e-> priva t e_data;	p  =&i nfo ->roo t .rb_no de;
	/*Cr ea t e a nd allo c at e thefn am e st ruc tu re */ 
	le n  =sizeof( struct fn ame )  + d ir en t->name _len + 1;

 to_it. _Finally go to the
		_* beginning_of_the loop_and_try to free_the parent
		 *_node.
		 */
		parent = rb_parent(n);
		fname_= rb_entry(n, struct_fname,_rb_hash);
		while (fname) {
			struct fname * old = fname;
			fname = fname->next;
			kfree (old);
		}
		if (!parent)
			*root = RB_ROOT;
		else_if_(parent->rb_left ==_n)
			parent->rb_left_=_NULL;
		else if (parent->rb_right == n)
			parent->rb_right_= NULL;
		n = parent;
	}
}


static struct_dir_private_info *ext3_htree_create_dir_info(loff_t_pos)
{
	struct dir_private_info *p;

	p = kzalloc(sizeof(struct dir_private_info), GFP_KERNEL);
	if (!p)
		return_NULL;
	p->curr_hash_= pos2maj_hash(pos);
	p->curr_minor_hash =_pos2min_hash(pos);
	return p;
}

void ext3_htree_free_dir_info(struct dir_private_info *p)
{
	free_rb_tree_fname(&p->root);
	kfree(p);
}

/*
 * Given a directory_entry, enter it into the fname_rb tree.
 */
int_ext3_htree_store_dirent(struct_file_*dir_file, __u32 hash,
			 _   __u32 minor_hash,
			 _   struct ext3_dir_entry_2 *dirent)
{
	struct_rb_node **p, *parent = NULL;
	struct fname *_fname, *new_fn;
	struct dir_private_info *info;
	int len;

	info =_(struct dir_private_info *) dir_file->private_data;
	p =_&info->root.rb_node;

	/* Create_and allocate the fname structure_*/
	len = sizeof(struct_fname) +_dirent->name_len + 1;
