ni = NTFS_I(page->mapping->host); 
vi = page->mapping->host; ni = NTFS_I(vi); 
static int ntfs_read_block(struct page *page){	VCN vcn;	LCN lcn;	ntfs_inode *ni;	ntfs_volume *vol;	runlist_element *rl;	struct buffer_head *bh, *head, *arr[MAX_BUF_PER_PAGE];	sector_t iblock, lblock, zblock;	unsigned long flags;	unsigned int blocksize, vcn_ofs;	int i, nr;	unsigned char blocksize_bits;	ni = NTFS_I(page->mapping->host);	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_bits = VFS_I(ni)->i_blkbits;	blocksize = 1 << 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);	iblock = (s64)page->index << (PAGE_CACHE_SHIFT - blocksize_bits);	read_lock_irqsave(&ni->size_lock, flags);	lblock = (ni->allocated_size + blocksize - 1) >> blocksize_bits;	zblock = (ni->initialized_size + blocksize - 1) >> blocksize_bits;	read_unlock_irqrestore(&ni->size_lock, flags);	/* Loop through all the buffers in the page. */	rl = NULL;	nr = i = 0;	do {		u8 *kaddr;		int err;		if (unlikely(buffer_uptodate(bh)))			continue;		if (unlikely(buffer_mapped(bh))) {			arr[nr++] = bh;			continue;		}		err = 0;		bh->b_bdev = vol->sb->s_bdev;		/* Is the block within the allowed limits? */		if (iblock < lblock) {			BOOL is_retry = FALSE;			/* Convert iblock into corresponding vcn and offset. */			vcn = (VCN)iblock << blocksize_bits >>					vol->cluster_size_bits;			vcn_ofs = ((VCN)iblock << blocksize_bits) &					vol->cluster_size_mask;			if (!rl) {lock_retry_remap:				down_read(&ni->runlist.lock);				rl = ni->runlist.rl;			}			if (likely(rl != NULL)) {				/* Seek to element containing target vcn. */				while (rl->length && rl[1].vcn <= vcn)					rl++;				lcn = ntfs_rl_vcn_to_lcn(rl, vcn);			} else				lcn = LCN_RL_NOT_MAPPED;			/* Successful remap. */			if (lcn >= 0) {				/* Setup buffer head to correct block. */				bh->b_blocknr = ((lcn << vol->cluster_size_bits)						+ vcn_ofs) >> blocksize_bits;				set_buffer_mapped(bh);				/* Only read initialized data blocks. */				if (iblock < zblock) {					arr[nr++] = bh;					continue;				}				/* Fully non-initialized data block, zero it. */				goto handle_zblock;			}			/* It is a hole, need to zero it. */			if (lcn == LCN_HOLE)				goto handle_hole;			/* If first try and runlist unmapped, map and retry. */			if (!is_retry && lcn == LCN_RL_NOT_MAPPED) {				is_retry = TRUE;				/*				 * Attempt to map runlist, dropping lock for				 * the duration.				 */				up_read(&ni->runlist.lock);				err = ntfs_map_runlist(ni, vcn);				if (likely(!err))					goto lock_retry_remap;				rl = NULL;			} else if (!rl)				up_read(&ni->runlist.lock);			/*			 * If buffer is outside the runlist, treat it as a			 * hole.  This can happen due to concurrent truncate			 * for example.			 */			if (err == -ENOENT || lcn == LCN_ENOENT) {				err = 0;				goto handle_hole;			}			/* Hard error, zero out region. */			if (!err)				err = -EIO;			bh->b_blocknr = -1;			SetPageError(page);			ntfs_error(vol->sb, "Failed to read from inode 0x%lx, "					"attribute type 0x%x, vcn 0x%llx, "					"offset 0x%x because its location on "					"disk could not be determined%s "					"(error code %i).", ni->mft_no,					ni->type, (unsigned long long)vcn,					vcn_ofs, is_retry ? " even after "					"retrying" : "", err);		}		/*		 * Either iblock was outside lblock limits or		 * ntfs_rl_vcn_to_lcn() returned error.  Just zero that portion		 * of the page and set the buffer uptodate.		 */handle_hole:		bh->b_blocknr = -1UL;		clear_buffer_mapped(bh);handle_zblock:		kaddr = kmap_atomic(page, KM_USER0);		memset(kaddr + i * blocksize, 0, blocksize);		kunmap_atomic(kaddr, KM_USER0);		flush_dcache_page(page);		if (likely(!err))			set_buffer_uptodate(bh);	} while (i++, iblock++, (bh = bh->b_this_page) != head);	/* Release the lock if we took it. */	if (rl)		up_read(&ni->runlist.lock);	/* Check we have at least one buffer ready for i/o. */	if (nr) {		struct buffer_head *tbh;		/* Lock the buffers. */		for (i = 0; i < nr; i++) {			tbh = arr[i];			lock_buffer(tbh);			tbh->b_end_io = ntfs_end_buffer_async_read;			set_buffer_async_read(tbh);		}		/* Finally, start i/o on the buffers. */		for (i = 0; i < nr; i++) {			tbh = arr[i];			if (likely(!buffer_uptodate(tbh)))				submit_bh(READ, tbh);			else				ntfs_end_buffer_async_read(tbh, 1);		}		return 0;	}	/* No i/o was scheduled on any of the buffers. */	if (likely(!PageError(page)))		SetPageUptodate(page);	else /* Signal synchronous i/o error. */		nr = -EIO;	unlock_page(page);	return nr;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/f6098cf449b81c14a51e48dd22ae47d03126a1de/aops.c/buggy/fs/ntfs/aops.c