jfs_info("__get_metapage: inode = 0x%p, lblock = 0x%lx", inode, lblock); 
jfs_info("__get_metapage: ino = %ld, lblock = 0x%lx, abs=%d", inode->i_ino, lblock, absolute); 
struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,				unsigned int size, int absolute,				unsigned long new){	struct metapage **hash_ptr;	int l2BlocksPerPage;	int l2bsize;	struct address_space *mapping;	struct metapage *mp;	unsigned long page_index;	unsigned long page_offset;	jfs_info("__get_metapage: inode = 0x%p, lblock = 0x%lx", inode, lblock);	if (absolute)		mapping = inode->i_sb->s_bdev->bd_inode->i_mapping;	else {		/*		 * If an nfs client tries to read an inode that is larger		 * than any existing inodes, we may try to read past the		 * end of the inode map		 */		if ((lblock << inode->i_blkbits) >= inode->i_size)			return NULL;		mapping = inode->i_mapping;	}	hash_ptr = meta_hash(mapping, lblock);again:	spin_lock(&meta_lock);	mp = search_hash(hash_ptr, mapping, lblock);	if (mp) {	      page_found:		if (test_bit(META_stale, &mp->flag)) {			spin_unlock(&meta_lock);			msleep(1);			goto again;		}		mp->count++;		lock_metapage(mp);		spin_unlock(&meta_lock);		if (test_bit(META_discard, &mp->flag)) {			if (!new) {				jfs_error(inode->i_sb,					  "__get_metapage: using a "					  "discarded metapage");				release_metapage(mp);				return NULL;			}			clear_bit(META_discard, &mp->flag);		}		jfs_info("__get_metapage: found 0x%p, in hash", mp);		if (mp->logical_size != size) {			jfs_error(inode->i_sb,				  "__get_metapage: mp->logical_size != size");			release_metapage(mp);			return NULL;		}	} else {		l2bsize = inode->i_blkbits;		l2BlocksPerPage = PAGE_CACHE_SHIFT - l2bsize;		page_index = lblock >> l2BlocksPerPage;		page_offset = (lblock - (page_index << l2BlocksPerPage)) <<		    l2bsize;		if ((page_offset + size) > PAGE_CACHE_SIZE) {			spin_unlock(&meta_lock);			jfs_err("MetaData crosses page boundary!!");			return NULL;		}				/*		 * Locks held on aggregate inode pages are usually		 * not held long, and they are taken in critical code		 * paths (committing dirty inodes, txCommit thread) 		 * 		 * Attempt to get metapage without blocking, tapping into		 * reserves if necessary.		 */		mp = NULL;		if (JFS_IP(inode)->fileset == AGGREGATE_I) {			mp = alloc_metapage(GFP_ATOMIC);			if (!mp) {				/*				 * mempool is supposed to protect us from				 * failing here.  We will try a blocking				 * call, but a deadlock is possible here				 */				printk(KERN_WARNING				       "__get_metapage: atomic call to mempool_alloc failed.\n");				printk(KERN_WARNING				       "Will attempt blocking call\n");			}		}		if (!mp) {			struct metapage *mp2;			spin_unlock(&meta_lock);			mp = alloc_metapage(GFP_NOFS);			spin_lock(&meta_lock);			/* we dropped the meta_lock, we need to search the			 * hash again.			 */			mp2 = search_hash(hash_ptr, mapping, lblock);			if (mp2) {				free_metapage(mp);				mp = mp2;				goto page_found;			}		}		mp->flag = 0;		lock_metapage(mp);		if (absolute)			set_bit(META_absolute, &mp->flag);		mp->xflag = COMMIT_PAGE;		mp->count = 1;		atomic_set(&mp->nohomeok,0);		mp->mapping = mapping;		mp->index = lblock;		mp->page = NULL;		mp->logical_size = size;		add_to_hash(mp, hash_ptr);		spin_unlock(&meta_lock);		if (new) {			jfs_info("__get_metapage: Calling grab_cache_page");			mp->page = grab_cache_page(mapping, page_index);			if (!mp->page) {				jfs_err("grab_cache_page failed!");				goto freeit;			} else {				INCREMENT(mpStat.pagealloc);				unlock_page(mp->page);			}		} else {			jfs_info("__get_metapage: Calling read_cache_page");			mp->page = read_cache_page(mapping, lblock,				    (filler_t *)mapping->a_ops->readpage, NULL);			if (IS_ERR(mp->page)) {				jfs_err("read_cache_page failed!");				goto freeit;			} else				INCREMENT(mpStat.pagealloc);		}		mp->data = kmap(mp->page) + page_offset;	}	if (new)		memset(mp->data, 0, PSIZE);	jfs_info("__get_metapage: returning = 0x%p", mp);	return mp;freeit:	spin_lock(&meta_lock);	remove_from_hash(mp, hash_ptr);	free_metapage(mp);	spin_unlock(&meta_lock);	return NULL;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/7fab479bebb96b1b4888bdae9b42e1fa9c5d3f38/jfs_metapage.c/clean/fs/jfs/jfs_metapage.c