diff options
| author | David S. Miller <davem@davemloft.net> | 2010-04-06 23:53:30 -0700 | 
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2010-04-06 23:53:30 -0700 | 
| commit | 4a35ecf8bf1c4b039503fa554100fe85c761de76 (patch) | |
| tree | 9b75f5d5636004d9a9aa496924377379be09aa1f /fs/xfs/linux-2.6/xfs_buf.c | |
| parent | b4d562e3c3553ac58c7120555c4e4aefbb090a2a (diff) | |
| parent | fb9e2d887243499b8d28efcf80821c4f6a092395 (diff) | |
| download | olio-linux-3.10-4a35ecf8bf1c4b039503fa554100fe85c761de76.tar.xz olio-linux-3.10-4a35ecf8bf1c4b039503fa554100fe85c761de76.zip  | |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	drivers/net/bonding/bond_main.c
	drivers/net/via-velocity.c
	drivers/net/wireless/iwlwifi/iwl-agn.c
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_buf.c')
| -rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.c | 81 | 
1 files changed, 4 insertions, 77 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index 6f76ba85f19..bd111b7e1da 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c @@ -168,75 +168,6 @@ test_page_region(  }  /* - *	Mapping of multi-page buffers into contiguous virtual space - */ - -typedef struct a_list { -	void		*vm_addr; -	struct a_list	*next; -} a_list_t; - -static a_list_t		*as_free_head; -static int		as_list_len; -static DEFINE_SPINLOCK(as_lock); - -/* - *	Try to batch vunmaps because they are costly. - */ -STATIC void -free_address( -	void		*addr) -{ -	a_list_t	*aentry; - -#ifdef CONFIG_XEN -	/* -	 * Xen needs to be able to make sure it can get an exclusive -	 * RO mapping of pages it wants to turn into a pagetable.  If -	 * a newly allocated page is also still being vmap()ed by xfs, -	 * it will cause pagetable construction to fail.  This is a -	 * quick workaround to always eagerly unmap pages so that Xen -	 * is happy. -	 */ -	vunmap(addr); -	return; -#endif - -	aentry = kmalloc(sizeof(a_list_t), GFP_NOWAIT); -	if (likely(aentry)) { -		spin_lock(&as_lock); -		aentry->next = as_free_head; -		aentry->vm_addr = addr; -		as_free_head = aentry; -		as_list_len++; -		spin_unlock(&as_lock); -	} else { -		vunmap(addr); -	} -} - -STATIC void -purge_addresses(void) -{ -	a_list_t	*aentry, *old; - -	if (as_free_head == NULL) -		return; - -	spin_lock(&as_lock); -	aentry = as_free_head; -	as_free_head = NULL; -	as_list_len = 0; -	spin_unlock(&as_lock); - -	while ((old = aentry) != NULL) { -		vunmap(aentry->vm_addr); -		aentry = aentry->next; -		kfree(old); -	} -} - -/*   *	Internal xfs_buf_t object manipulation   */ @@ -337,7 +268,8 @@ xfs_buf_free(  		uint		i;  		if (xfs_buf_is_vmapped(bp)) -			free_address(bp->b_addr - bp->b_offset); +			vm_unmap_ram(bp->b_addr - bp->b_offset, +					bp->b_page_count);  		for (i = 0; i < bp->b_page_count; i++) {  			struct page	*page = bp->b_pages[i]; @@ -457,10 +389,8 @@ _xfs_buf_map_pages(  		bp->b_addr = page_address(bp->b_pages[0]) + bp->b_offset;  		bp->b_flags |= XBF_MAPPED;  	} else if (flags & XBF_MAPPED) { -		if (as_list_len > 64) -			purge_addresses(); -		bp->b_addr = vmap(bp->b_pages, bp->b_page_count, -					VM_MAP, PAGE_KERNEL); +		bp->b_addr = vm_map_ram(bp->b_pages, bp->b_page_count, +					-1, PAGE_KERNEL);  		if (unlikely(bp->b_addr == NULL))  			return -ENOMEM;  		bp->b_addr += bp->b_offset; @@ -1955,9 +1885,6 @@ xfsbufd(  			xfs_buf_iostrategy(bp);  			count++;  		} - -		if (as_list_len > 0) -			purge_addresses();  		if (count)  			blk_run_address_space(target->bt_mapping);  |