Btrfs: byte offsets for file keys
Signed-off-by: Chris Mason <chris.mason@oracle.com>
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index fd3d9d6..f2f0818 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -697,7 +697,8 @@
ret = btrfs_lookup_file_extent(trans, root, &path,
- inode->i_ino, iblock, 1, 0);
+ inode->i_ino,
+ iblock << inode->i_blkbits, 0);
if (ret < 0) {
btrfs_release_path(root, &path);
err = ret;
@@ -737,6 +738,7 @@
}
extent_start = btrfs_disk_key_offset(&leaf->items[path.slots[0]].key);
+ extent_start = extent_start >> inode->i_blkbits;
extent_start += btrfs_file_extent_offset(item);
extent_end = extent_start + btrfs_file_extent_num_blocks(item);
btrfs_release_path(root, &path);
@@ -751,7 +753,8 @@
err = 0;
goto out;
}
- ret = btrfs_alloc_file_extent(trans, root, objectid, iblock,
+ ret = btrfs_alloc_file_extent(trans, root, objectid,
+ iblock << inode->i_blkbits,
1, extent_end, &blocknr);
if (ret) {
err = ret;