Commit 9ab86c8e authored by Chris Mason's avatar Chris Mason

Btrfs: kmap_atomic(KM_USER0) is safe for btrfs_readpage_end_io_hook

None of the checksum verification code schedules, so we can use the faster
kmap_atomic
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent cc7172de
...@@ -1748,7 +1748,7 @@ static int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end, ...@@ -1748,7 +1748,7 @@ static int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end,
} else { } else {
ret = get_state_private(io_tree, start, &private); ret = get_state_private(io_tree, start, &private);
} }
kaddr = kmap(page); kaddr = kmap_atomic(page, KM_USER0);
if (ret) if (ret)
goto zeroit; goto zeroit;
...@@ -1757,7 +1757,7 @@ static int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end, ...@@ -1757,7 +1757,7 @@ static int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end,
if (csum != private) if (csum != private)
goto zeroit; goto zeroit;
kunmap(page); kunmap_atomic(kaddr, KM_USER0);
good: good:
/* if the io failure tree for this inode is non-empty, /* if the io failure tree for this inode is non-empty,
* check to see if we've recovered from a failed IO * check to see if we've recovered from a failed IO
...@@ -1772,7 +1772,7 @@ static int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end, ...@@ -1772,7 +1772,7 @@ static int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end,
(unsigned long long)private); (unsigned long long)private);
memset(kaddr + offset, 1, end - start + 1); memset(kaddr + offset, 1, end - start + 1);
flush_dcache_page(page); flush_dcache_page(page);
kunmap(page); kunmap_atomic(kaddr, KM_USER0);
if (private == 0) if (private == 0)
return 0; return 0;
return -EIO; return -EIO;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment