summaryrefslogtreecommitdiff
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-06-12 11:36:58 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-06-12 11:36:58 -0400
commit340887809d92a4dd6c71caa97d658cef32c098c3 (patch)
tree4767f84fa4b066ac57c5df15741bda47766fe8ce /fs/btrfs/file.c
parent6cbd55707802b98843f953d1ae6d8f5bcd9a76c0 (diff)
Btrfs: i386 fixes from axboe
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r--fs/btrfs/file.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 566e526b60ff..83836fb3d4e9 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -112,7 +112,7 @@ static int dirty_and_release_pages(struct btrfs_trans_handle *trans,
if (buffer_mapped(bh) && bh->b_blocknr == 0) {
struct btrfs_key key;
struct btrfs_path *path;
- char *ptr;
+ char *ptr, *kaddr;
u32 datasize;
/* create an inline extent, and copy the data in */
@@ -135,8 +135,11 @@ static int dirty_and_release_pages(struct btrfs_trans_handle *trans,
btrfs_set_file_extent_type(ei,
BTRFS_FILE_EXTENT_INLINE);
ptr = btrfs_file_extent_inline_start(ei);
+ kaddr = kmap_atomic(bh->b_page, KM_USER0);
btrfs_memcpy(root, path->nodes[0]->b_data,
- ptr, bh->b_data, offset + write_bytes);
+ ptr, kaddr + bh_offset(bh),
+ offset + write_bytes);
+ kunmap_atomic(kaddr, KM_USER0);
mark_buffer_dirty(path->nodes[0]);
btrfs_free_path(path);
} else if (buffer_mapped(bh)) {