Skip to content

Commit

Permalink
xfs: use scalable vmap API
Browse files Browse the repository at this point in the history
Re-apply a commit that had been reverted due to regressions
that have since been fixed.

    From 95f8e30 Mon Sep 17 00:00:00 2001
    From: Nick Piggin <npiggin@suse.de>
    Date: Tue, 6 Jan 2009 14:43:09 +1100

    Implement XFS's large buffer support with the new vmap APIs. See the vmap
    rewrite (db64fe0) for some numbers. The biggest improvement that comes from
    using the new APIs is avoiding the global KVA allocation lock on every call.

    Signed-off-by: Nick Piggin <npiggin@suse.de>
    Reviewed-by: Christoph Hellwig <hch@infradead.org>
    Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>

Only modifications here were a minor reformat, plus making the patch
apply given the new use of xfs_buf_is_vmapped().

Modified-by: Alex Elder <aelder@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
  • Loading branch information
Alex Elder committed Mar 16, 2010
1 parent cd9640a commit 8a262e5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fs/xfs/linux-2.6/xfs_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ xfs_buf_free(
uint i;

if (xfs_buf_is_vmapped(bp))
vunmap(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];
Expand Down Expand Up @@ -388,8 +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) {
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;
Expand Down

0 comments on commit 8a262e5

Please sign in to comment.