summaryrefslogtreecommitdiff
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-03-27 11:26:26 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-03-27 11:26:26 -0400
commit9773a788681db1f5c2701b7433737fdca61a14ba (patch)
tree9d5f79f7a0e3b0f5e89509b42a3d8134364bed32 /fs/btrfs/super.c
parentf4b9aa8d3b877d0a6044a6d6d9a44b29cab9e265 (diff)
downloadlwn-9773a788681db1f5c2701b7433737fdca61a14ba.tar.gz
lwn-9773a788681db1f5c2701b7433737fdca61a14ba.zip
Btrfs: byte offsets for file keys
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index fd3d9d616ff9..f2f08189903d 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -697,7 +697,8 @@ static int btrfs_get_block(struct inode *inode, sector_t iblock,
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 @@ static int btrfs_get_block(struct inode *inode, sector_t iblock,
}
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 @@ allocate:
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;