Skip to content

Commit

Permalink
Btrfs: Fix read/write_extent_buffer to use KM_USER1 instead of KM_USER0
Browse files Browse the repository at this point in the history
This avoids recursive use of KM_USER0 during btrfs_file_write

Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Chris Mason committed Sep 25, 2008
1 parent b4a2a0e commit 59d169e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fs/btrfs/extent_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -2378,9 +2378,9 @@ void read_extent_buffer(struct extent_buffer *eb, void *dstv,
WARN_ON(!PageUptodate(page));

cur = min(len, (PAGE_CACHE_SIZE - offset));
kaddr = kmap_atomic(page, KM_USER0);
kaddr = kmap_atomic(page, KM_USER1);
memcpy(dst, kaddr + offset, cur);
kunmap_atomic(kaddr, KM_USER0);
kunmap_atomic(kaddr, KM_USER1);

dst += cur;
len -= cur;
Expand Down Expand Up @@ -2523,9 +2523,9 @@ void write_extent_buffer(struct extent_buffer *eb, const void *srcv,
WARN_ON(!PageUptodate(page));

cur = min(len, PAGE_CACHE_SIZE - offset);
kaddr = kmap_atomic(page, KM_USER0);
kaddr = kmap_atomic(page, KM_USER1);
memcpy(kaddr + offset, src, cur);
kunmap_atomic(kaddr, KM_USER0);
kunmap_atomic(kaddr, KM_USER1);

src += cur;
len -= cur;
Expand Down

0 comments on commit 59d169e

Please sign in to comment.