summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-09-11 15:51:21 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:07 -0400
commit8d5bf1cb35ea29795862ff0ea2f4c4d7e22727f3 (patch)
tree1c9af9227dfb34a47230ebefbb0eed4f3125bcfe /fs/btrfs/tree-log.c
parent4bef084857ab8fe71cf49eae349c25e440a49150 (diff)
downloadlinux-8d5bf1cb35ea29795862ff0ea2f4c4d7e22727f3.tar.bz2
Btrfs: Update the highest objectid in a root after log replay is done
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 13d7ee8e0c52..3f4b139b27ed 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -1027,6 +1027,7 @@ static noinline int fixup_inode_link_count(struct btrfs_trans_handle *trans,
inode->i_nlink = nlink;
btrfs_update_inode(trans, root, inode);
}
+ BTRFS_I(inode)->index_cnt = (u64)-1;
return 0;
}
@@ -2714,6 +2715,7 @@ 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,
@@ -2772,6 +2774,11 @@ 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;
free_extent_buffer(log->node);