BUG_ON(!PageUptodate(page));  
__xip_file_write(struct file *filp, const char __user *buf,		  size_t count, loff_t pos, loff_t *ppos){	struct address_space * mapping = filp->f_mapping;	struct address_space_operations *a_ops = mapping->a_ops;	struct inode 	*inode = mapping->host;	long		status = 0;	struct page	*page;	size_t		bytes;	ssize_t		written = 0;	BUG_ON(!mapping->a_ops->get_xip_page);	do {		unsigned long index;		unsigned long offset;		size_t copied;		offset = (pos & (PAGE_CACHE_SIZE -1)); /* Within page */		index = pos >> PAGE_CACHE_SHIFT;		bytes = PAGE_CACHE_SIZE - offset;		if (bytes > count)			bytes = count;		/*		 * Bring in the user page that we will copy from _first_.		 * Otherwise there's a nasty deadlock on copying from the		 * same page as we're writing to, without it being marked		 * up-to-date.		 */		fault_in_pages_readable(buf, bytes);		page = a_ops->get_xip_page(mapping,					   index*(PAGE_SIZE/512), 0);		if (IS_ERR(page) && (PTR_ERR(page) == -ENODATA)) {			/* we allocate a new page unmap it */			page = a_ops->get_xip_page(mapping,						   index*(PAGE_SIZE/512), 1);			if (!IS_ERR(page))				/* unmap page at pgoff from all other vmas */				__xip_unmap(mapping, index);		}		if (IS_ERR(page)) {			status = PTR_ERR(page);			break;		}		BUG_ON(!PageUptodate(page));		copied = filemap_copy_from_user(page, offset, buf, bytes);		flush_dcache_page(page);		if (likely(copied > 0)) {			status = copied;			if (status >= 0) {				written += status;				count -= status;				pos += status;				buf += status;			}		}		if (unlikely(copied != bytes))			if (status >= 0)				status = -EFAULT;		if (status < 0)			break;	} while (count);	*ppos = pos;	/*	 * No need to use i_size_read() here, the i_size	 * cannot change under us because we hold i_sem.	 */	if (pos > inode->i_size) {		i_size_write(inode, pos);		mark_inode_dirty(inode);	}	return written ? written : status;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/afa597ba20e9ef55fc6283c1a564854b1c9f13c0/filemap_xip.c/buggy/mm/filemap_xip.c