diff options
author | Yan Zheng <zheng.yan@oracle.com> | 2008-12-17 16:10:07 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-12-17 16:10:07 -0500 |
commit | 0d53b212d8464c6476e0cda0bbb8533e080816f6 (patch) | |
tree | 3438dd3fe0117b0f9d12c0c7642a4120ec085bf6 /dir-item.c | |
parent | b238b4b072904e3fe72149b68a2e69784893619e (diff) |
Btrfs: update converter for the new disk format
This patch updates the ext3 to btrfs converter for the new
disk format. This mainly involves changing the convert's
data relocation and free space management code. This patch
also ports some functions from kernel module to btrfs-progs.
Thank you,
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Diffstat (limited to 'dir-item.c')
-rw-r--r-- | dir-item.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -107,7 +107,7 @@ int btrfs_insert_xattr_item(struct btrfs_trans_handle *trans, int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root *root, const char *name, int name_len, u64 dir, - struct btrfs_key *location, u8 type) + struct btrfs_key *location, u8 type, u64 index) { int ret = 0; int ret2 = 0; @@ -128,8 +128,6 @@ int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root name, name_len); if (IS_ERR(dir_item)) { ret = PTR_ERR(dir_item); - if (ret == -EEXIST) - goto second_insert; goto out; } @@ -144,7 +142,6 @@ int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root write_extent_buffer(leaf, name, name_ptr, name_len); btrfs_mark_buffer_dirty(leaf); -second_insert: /* FIXME, use some real flag for selecting the extra index */ if (root == root->fs_info->tree_root) { ret = 0; @@ -153,7 +150,7 @@ second_insert: btrfs_release_path(root, path); btrfs_set_key_type(&key, BTRFS_DIR_INDEX_KEY); - key.offset = location->objectid; + key.offset = index; dir_item = insert_with_overflow(trans, root, path, &key, data_size, name, name_len); if (IS_ERR(dir_item)) { |