aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index de9ee3aa0aad..5230554380d1 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -311,6 +311,7 @@ struct btrfs_root *open_ctree(struct super_block *sb)
311 fs_info->extent_root = extent_root; 311 fs_info->extent_root = extent_root;
312 fs_info->inode_root = inode_root; 312 fs_info->inode_root = inode_root;
313 fs_info->last_inode_alloc = 0; 313 fs_info->last_inode_alloc = 0;
314 fs_info->highest_inode = 0;
314 fs_info->sb = sb; 315 fs_info->sb = sb;
315 fs_info->btree_inode = new_inode(sb); 316 fs_info->btree_inode = new_inode(sb);
316 fs_info->btree_inode->i_ino = 1; 317 fs_info->btree_inode->i_ino = 1;
@@ -360,12 +361,15 @@ printk("failed2\n");
360 361
361 ret = find_and_setup_root(sb->s_blocksize, tree_root, fs_info, 362 ret = find_and_setup_root(sb->s_blocksize, tree_root, fs_info,
362 BTRFS_FS_TREE_OBJECTID, root); 363 BTRFS_FS_TREE_OBJECTID, root);
363 mutex_unlock(&fs_info->fs_mutex);
364 BUG_ON(ret); 364 BUG_ON(ret);
365 root->commit_root = root->node; 365 root->commit_root = root->node;
366 get_bh(root->node); 366 get_bh(root->node);
367 root->ref_cows = 1; 367 root->ref_cows = 1;
368 root->fs_info->generation = root->root_key.offset + 1; 368 root->fs_info->generation = root->root_key.offset + 1;
369 ret = btrfs_find_highest_inode(root, &root->fs_info->last_inode_alloc);
370 if (ret == 0)
371 fs_info->highest_inode = fs_info->last_inode_alloc;
372 mutex_unlock(&fs_info->fs_mutex);
369 return root; 373 return root;
370} 374}
371 375