Btrfs: do not reuse objectid of deleted snapshot/subvol

The new back reference format does not allow reusing objectid of
deleted snapshot/subvol. So we use ++highest_objectid to allocate
objectid for new snapshot/subvol.

Now we use ++highest_objectid to allocate objectid for both new inode
and new snapshot/subvolume, so this patch removes 'find hole' code in
btrfs_find_free_objectid.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
Yan, Zheng
2009-09-21 15:56:00 -04:00
committed by Chris Mason
parent 1c4850e21d
commit 13a8a7c8c4
6 changed files with 31 additions and 116 deletions

View File

@ -2951,7 +2951,6 @@ int btrfs_recover_log_trees(struct btrfs_root *log_root_tree)
struct btrfs_key tmp_key;
struct btrfs_root *log;
struct btrfs_fs_info *fs_info = log_root_tree->fs_info;
u64 highest_inode;
struct walk_control wc = {
.process_func = process_one_buffer,
.stage = 0,
@ -3010,11 +3009,6 @@ again:
path);
BUG_ON(ret);
}
ret = btrfs_find_highest_inode(wc.replay_dest, &highest_inode);
if (ret == 0) {
wc.replay_dest->highest_inode = highest_inode;
wc.replay_dest->last_inode_alloc = highest_inode;
}
key.offset = found_key.offset - 1;
wc.replay_dest->log_root = NULL;