Btrfs: Remove offset field from struct btrfs_extent_ref

The offset field in struct btrfs_extent_ref records the position
inside file that file extent is referenced by. In the new back
reference system, tree leaves holding references to file extent
are recorded explicitly. We can scan these tree leaves very quickly, so the
offset field is not required.

This patch also makes the back reference system check the objectid
when extents are in deleting.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
This commit is contained in:
Yan Zheng
2008-10-09 11:46:24 -04:00
committed by Chris Mason
parent a76a3cd40c
commit 3bb1a1bc42
8 changed files with 115 additions and 144 deletions

View File

@ -647,8 +647,7 @@ static int btrfs_finish_ordered_io(struct inode *inode, u64 start, u64 end)
ins.type = BTRFS_EXTENT_ITEM_KEY;
ret = btrfs_alloc_reserved_extent(trans, root, leaf->start,
root->root_key.objectid,
trans->transid, inode->i_ino,
ordered_extent->file_offset, &ins);
trans->transid, inode->i_ino, &ins);
BUG_ON(ret);
btrfs_release_path(root, path);
@ -1734,8 +1733,7 @@ delete:
ret = btrfs_free_extent(trans, root, extent_start,
extent_num_bytes,
leaf->start, root_owner,
root_gen, inode->i_ino,
found_key.offset, 0);
root_gen, inode->i_ino, 0);
BUG_ON(ret);
}
next: