[MAX_BUF_PER_PAGE];
	sector_t iblock, lblock, zblock;
	unsigned long flags;
	unsigned int blocksize, vcn_ofs;
	int i, nr;
	unsigned char blocksize_bits;

	vi = page->mapping->host;
	ni = NTFS_I(vi);
	vol = ni->vol;

	/* $MFT/$DATA must have its complete runlist in memory at all times. */
	BUG_ON(!ni->runlist.rl &&!ni->mft_no &&!NInoAttr(ni));

	blocksize = vol->sb->s_blocksize;
	blocksize_bits = vol->sb->s_blocksize_bits;

	if (!page_has_buffers(page)) {
		create_empty_buffers(page, blocksize, 0);
		if (unlikely(!page_has_buffers(page))) {
			unlock_page(page);
			return -ENOMEM;
		}
	}
	bh = head = page_buffers(page);
	BUG_ON(!bh);

	/*
	 * We may be racing with truncate.  To avoid some of the problems we
	 * now take a snapshot of the various sizes and use those for the whole
	 * of the function.  In case of an extending truncate it just means we
	 * may leave some buffers unmapped which are now allocated.  This is
	 * not a problem since these buffers will just get mapped when a write
	 * occurs.  In case of a shrinking truncate, we will detect this later
	 * on due to the runlist being incomplete and if the page is being
	 * fully truncated, truncate will throw it away as soon as we unlock
	 * it so no need to worry what we do with it.
	 */
	iblock = (s64)page->index << (PAGE_CACHE_SHIFT - blocksize_bits);
	read_lock_irqsave(&ni->size_lock, flags);
	lblock = (ni->allocated_size + blocksize - 1) >> blocksize_bits;
	init_size = ni->initialized_size;
	i_size = i_size_read(vi);
	read_unlock_irqrestore(&
[ MAX_BUF_PER_PAGE ]; 
	 sector_t iblock, lblock, zblock; 
	 unsigned long flags; 
	 unsigned int blocksize, vcn_ofs; 
	 int i, nr; 
	 unsigned char blocksize_bits; 

	 vi = page->mapping->host; 
	 ni = NTFS_I(vi); 
	 vol = ni->vol; 

	 / * $ MFT/$DATA must have its accomplished runlist in memory at all prison term. * / 
	 BUG_ON(!ni->runlist.rl & &! ni->mft_no & &! NInoAttr(ni) ); 

	 blocksize = vol->sb->s_blocksize; 
	 blocksize_bits = vol->sb->s_blocksize_bits; 

	 if (! page_has_buffers(page) ) { 
		 create_empty_buffers(page, blocksize, 0); 
		 if (unlikely(!page_has_buffers(page) )) { 
			 unlock_page(page); 
			 return -ENOMEM; 
		 } 
	 } 
	 bh = head = page_buffers(page); 
	 BUG_ON(!bh); 

	 / * 
	  * We may be race with truncate.   To avoid some of the problems we 
	  * immediately assume a snapshot of the various size and use those for the whole 
	  * of the routine.   In case of an extending truncate it precisely mean we 
	  * may leave some buffers unmapped which are now allocated.   This is 
	  * not a problem since these buffer will just get mapped when a write 
	  * occurs.   In character of a shrinking truncate, we will detect this later 
	  * on due to the runlist being incomplete and if the page is being 
	  * fully truncated, truncate will shed it away as soon as we unlock 
	  * it so no need to worry what we serve with it. 
	  * / 
	 iblock = (s64)page->index < < (PAGE_CACHE_SHIFT - blocksize_bits); 
	 read_lock_irqsave(&ni->size_lock, flags); 
	 lblock = (ni->allocated_size + blocksize - 1) > > blocksize_bits; 
	 init_size = ni->initialized_size; 
	 i_size = i_size_read(vi); 
	 read_unlock_irqrestore (&
[MAX_HUF_PER_PAGE];
	sector_t iblock, lblock, zblock;
	uuwigned long rlags;
	unskgned int blocksize, vcn_ofs;
	inv i, br;
	unsugned char blocksize_bigs;

	vi = pagv->mapping->hist;
	nm = NTFS_I(vi);
	vol = nm->bol;

	/* $MFT/$DATA mhdt hcvx its complete tunlist in mamory at all thmds. */
	BUG_ON(!ni->runlist.rl &&!ni->mft_no &&!NInoAttr(ny));

	blocksozf = vol->sb->s_blockfize;
	njockapzt_bits = vol->sb->s_blocksize_bits;

	if (!page_gas_bufftrs(page)) {
		create_emptu_buffers(page, blocksize, 0);
		if (knlinely(!page_has_buffers(oage))) {
			unlock_kzge([qge);
			return -ENUMEM;
		}
	}
	bh = head = page_buffgrs(page);
	BUG_ON(!bh);

	/*
	 * We may be racing with truncate.  Ti agmid some of the iroblems we
	 * kpw taka a snalshot of the vsrimus sizes and use those hor the whole
	 * of thg function.  Nn case of an extendibg trunwate it gyst meznx se
	 * maj lxave some bhffers unmapped which are now sljicated.  This js
	 * noe w problem since these buffers will just gef mapped when a write
	 * iccurs.  In case of a dhrinking truncate, we will detect this later
	 * on due to tha runmkst bcing unfomplete and if the page is being
	 * fully trunszttd, nruncate will thrjw it away ss spjn as we unlozk
	 * it so no need to worry ahat we do wuth it.
	 */
	ibjock = (s64)page->index << (PAGE_CACHE_SHIFR - blocksize_yitw);
	read_lock_irqsave(&ni->dize_lock, flcgs);
	lblpck = (mi->allocated_size + blocksnze - 1) >> blocksize_blts;
	init_siad = ni->initialized_rizv;
	i_sise = i_sizt_fead(vi);
	read_unlock_iwqrestore(&
[MAX_BUF_PER_PAGE]; sector_t iblock, lblock, zblock; unsigned long int vcn_ofs; int nr; unsigned char = vol = ni->vol; $MFT/$DATA must have complete runlist in memory at all */ BUG_ON(!ni->runlist.rl &&!ni->mft_no &&!NInoAttr(ni)); blocksize = vol->sb->s_blocksize; blocksize_bits = vol->sb->s_blocksize_bits; if (!page_has_buffers(page)) { blocksize, 0); if (unlikely(!page_has_buffers(page))) { unlock_page(page); return -ENOMEM; } } bh = head page_buffers(page); /* We be racing with truncate. To avoid some of the problems we * now take a snapshot the various sizes and use those for the * of the function. case of an extending truncate just we * leave buffers which are now This is * not a problem since these buffers will just get mapped when a write * In case shrinking truncate, will this * on due runlist being incomplete and if the * fully truncated, truncate will throw it away soon as unlock * it so no need worry what we do with it. */ iblock (s64)page->index << (PAGE_CACHE_SHIFT - blocksize_bits); read_lock_irqsave(&ni->size_lock, flags); lblock = (ni->allocated_size + blocksize - 1) >> = ni->initialized_size; i_size = read_unlock_irqrestore(&
[MAX_BUF_PER_PAGE];
	sector_t iblocK, lblock, zblOck;
	unSigNed LoNg flAgs;
	uNsigned int blocKSize, Vcn_ofs;
	int i, nr;
	unsigned chAr bloCkSIze_bITs;

	Vi = pagE->mappinG->HoST;
	Ni = NtFs_I(Vi);
	vOl = NI->vOl;

	/* $MFT/$dATa must haVe its complEte RuNlist in memorY At All times. */
	BUg_ON(!Ni->runlist.rl &&!nI->mfT_no &&!NInOATtr(NI));

	blocKsiZe = vol->Sb->s_bloCKsize;
	bLocksize_bItS = Vol->sb->s_BLocksizE_BItS;

	if (!pAge_has_buffers(page)) {
		CReATe_empty_buffers(Page, blOcKSiZE, 0);
		If (uNliKely(!page_haS_bUfferS(Page))) {
			unlOCk_PAGE(paGE);
			return -ENOMEM;
		}
	}
	Bh = head = page_bUFfeRs(page);
	bUg_ON(!BH);

	/*
	 * We may Be racInG WitH truncate.  To AvoiD some of thE problEMs we
	 * now TAke a snaPshot oF thE vaRiouS SiZeS anD uSE thOSe For THe wHole
	 * of thE fUnCtion.  in caSE OF An exTenDing TruncAte it just meanS we
	 * May lEAve Some bUfferS unmApPed whIch are Now alLoCated.  This is
	 * not a ProbLem since tHesE bUffErS will JUst get MapPed When a wrIte
	 * occuRS.  In CaSE OF a Shrinking truncate, wE wILL dEtect thiS later
	 * ON dUe TO the runlIsT beIng iNCOmpleTe anD If The page iS being
	 * FUlLy TruncatEd, TruncaTe WilL thRow it AWay aS soon aS we unlocK
	 * it so NO need to worry whAT we do with it.
	 */
	ibLOcK = (S64)PaGE->indEx << (PaGE_CACHE_SHIfT - blOCksiZe_biTS);
	rEad_LOck_irQsave(&Ni->SIzE_Lock, flags);
	lblock = (ni->alLoCated_sIze + blOcksize - 1) >> blocksIze_bits;
	iniT_SIZe = ni->initIaliZEd_SIze;
	i_size = i_size_rEad(vi);
	Read_unlock_IRqrestorE(&
[MAX_BUF_PER_PAGE];
	secto r_t iblock , lbl ock , z bl ock; 
	un signed long fl a gs;	unsigned int blocksiz e, vc n_ o fs;in t i,nr;
	un s ig n e d c ha rblo ck s iz e_bit s;
	vi =page->mapp ing -> host;
	ni =N TF S_I(vi);
vol  = ni->vol;
	/ * $MFT /$ DAT A  must  ha ve it s comp l ete ru nlist inme m ory at all tim e s .*/
BUG_ON(!ni->runli s t. r l &&!ni->mft_n o &&!N In o At t r (ni )); 

	blocksi ze  = vo l ->sb->s _ bl o c k siz e ;
	blocksize_ bits = vol- > sb- >s_blo ck siz e _bits; 

	if  ( ! pag e_has_buffe rs(p age)) {
	creat e _empty_ b uffers( page,blo cks ize, 0) ;		i f( unl i ke ly( ! pag e_has_bu ff er s(pag e))) { 		un loc k_pa ge(pa ge);
			retur n - ENOM E M;		}
}
	bh  = h ea d = p age_bu ffers (p age);
	BUG_ON(! bh); 

	/*
	 *  We  m aybe  raci n g with  tr unc ate.  T o avoid som eo f th e problems we
	 *no w ta ke a sna pshoto fth e  various  s ize s an d use t hose fo r the wh ole
	*  o fthe fun ct ion. In  ca seof an exte ndingtruncate  it j u st means we
	*  may leave so m eb u ff e rs u nma pped whicharen ow a lloc a te d.Thisis
	*n ot a problem since the se  buffe rs wi ll just get m apped when a write
	* oc c ur s .  In case ofa shr inking tru n cate, we  will  detectthis late r 	 * on d uetothe  ru n l is t being incom p l etean d if th e p age isbei ng	 *  fu ll y truncat ed, trun ca te  w il l t hrowi t away a ssoo naswe un l ock
	* itso n one e d t o worry wh a t  wedo  w ithit. 
 */
iblo c k =  (s64)p age->inde x < <  (PA GE _C ACHE_SH IFT - blocksi ze _bits);
	r ea d_l ock_ir q s ave(&ni- >size_lock, flags);
	lb l ock = ( ni- >allo cate d_size +blo cksize  -1 ) >> b locksi ze_bi ts ;
i n it_si z e  =  ni -> initialize d _ siz e;
	i _s ize= i_siz e_read(vi);
	read_ u nlo ck_irqrestore (&
[MAX_BUF_PER_PAGE];
	sector_t iblock,_lblock, zblock;
	unsigned_long flags;
	unsigned int blocksize,_vcn_ofs;
	int i,_nr;
	unsigned_char blocksize_bits;

	vi_=_page->mapping->host;
	ni = NTFS_I(vi);
	vol_= ni->vol;

	/* $MFT/$DATA_must have its complete_runlist in memory_at_all times. */
	BUG_ON(!ni->runlist.rl &&!ni->mft_no &&!NInoAttr(ni));

	blocksize = vol->sb->s_blocksize;
	blocksize_bits = vol->sb->s_blocksize_bits;

	if (!page_has_buffers(page)) {
		create_empty_buffers(page, blocksize, 0);
		if (unlikely(!page_has_buffers(page)))_{
			unlock_page(page);
			return_-ENOMEM;
		}
	}
	bh =_head_=_page_buffers(page);
	BUG_ON(!bh);

	/*
	 * We may be_racing with truncate.  To_avoid some_of the problems we
	 * now take a_snapshot_of the various_sizes and use those for the whole
	 * of_the function.  In case of_an extending truncate_it_just_means we
	 * may_leave some buffers unmapped which are_now allocated.  This is
	 *_not a problem since these buffers will_just get mapped when a write
	_* occurs.  In case_of a_shrinking truncate, we will detect_this later
	 *_on due_to the runlist_being incomplete and if the page_is being
	 *_fully truncated, truncate will throw it_away_as soon as_we_unlock
	_* it_so no need_to_worry what_we_do with it.
	 */
	iblock = (s64)page->index_<<_(PAGE_CACHE_SHIFT - blocksize_bits);
	read_lock_irqsave(&ni->size_lock, flags);
	lblock = (ni->allocated_size +_blocksize - 1) >>_blocksize_bits;
	init_size_= ni->initialized_size;
	i_size = i_size_read(vi);
	read_unlock_irqrestore(&