Commit cc7172de authored by Chris Mason's avatar Chris Mason

Btrfs: Don't use kmap_atomic(..., KM_IRQ0) during checksum verifies

Checksum verification happens in a helper thread, and there is no
need to mess with interrupts.  This switches to kmap() instead.
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 07d400a6
...@@ -1727,7 +1727,6 @@ static int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end, ...@@ -1727,7 +1727,6 @@ static int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end,
int ret; int ret;
struct btrfs_root *root = BTRFS_I(inode)->root; struct btrfs_root *root = BTRFS_I(inode)->root;
u32 csum = ~(u32)0; u32 csum = ~(u32)0;
unsigned long flags;
if (PageChecked(page)) { if (PageChecked(page)) {
ClearPageChecked(page); ClearPageChecked(page);
...@@ -1749,8 +1748,7 @@ static int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end, ...@@ -1749,8 +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);
} }
local_irq_save(flags); kaddr = kmap(page);
kaddr = kmap_atomic(page, KM_IRQ0);
if (ret) if (ret)
goto zeroit; goto zeroit;
...@@ -1759,8 +1757,7 @@ static int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end, ...@@ -1759,8 +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_atomic(kaddr, KM_IRQ0); kunmap(page);
local_irq_restore(flags);
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
...@@ -1775,8 +1772,7 @@ static int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end, ...@@ -1775,8 +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_atomic(kaddr, KM_IRQ0); kunmap(page);
local_irq_restore(flags);
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