diff options
author | Yan Zheng <zheng.yan@oracle.com> | 2008-12-10 20:32:51 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-12-10 20:32:51 -0500 |
commit | 0403e47ee26f26e960ee9038552bc89df4a1fb3d (patch) | |
tree | 08280f23e5cadcf9610f8b80ad1de2c27059aed8 /fs | |
parent | 459931eca5f4b8c9ad259d07cc1ca49afed54804 (diff) |
Btrfs: Add checking of csum tree in balancing code
This updates the space balancing code for the
new checksum format.
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/disk-io.c | 2 | ||||
-rw-r--r-- | fs/btrfs/extent-tree.c | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index c72f4f3b912c..6f042de1ac43 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -1097,6 +1097,8 @@ struct btrfs_root *btrfs_read_fs_root_no_name(struct btrfs_fs_info *fs_info, | |||
1097 | return fs_info->chunk_root; | 1097 | return fs_info->chunk_root; |
1098 | if (location->objectid == BTRFS_DEV_TREE_OBJECTID) | 1098 | if (location->objectid == BTRFS_DEV_TREE_OBJECTID) |
1099 | return fs_info->dev_root; | 1099 | return fs_info->dev_root; |
1100 | if (location->objectid == BTRFS_CSUM_TREE_OBJECTID) | ||
1101 | return fs_info->csum_root; | ||
1100 | 1102 | ||
1101 | root = radix_tree_lookup(&fs_info->fs_roots_radix, | 1103 | root = radix_tree_lookup(&fs_info->fs_roots_radix, |
1102 | (unsigned long)location->objectid); | 1104 | (unsigned long)location->objectid); |
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index cc74316dc426..673ff59c288a 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -241,7 +241,7 @@ static int cache_block_group(struct btrfs_root *root, | |||
241 | * skip the locking here | 241 | * skip the locking here |
242 | */ | 242 | */ |
243 | path->skip_locking = 1; | 243 | path->skip_locking = 1; |
244 | key.objectid = last; | 244 | key.objectid = max_t(u64, last, BTRFS_SUPER_INFO_OFFSET); |
245 | key.offset = 0; | 245 | key.offset = 0; |
246 | btrfs_set_key_type(&key, BTRFS_EXTENT_ITEM_KEY); | 246 | btrfs_set_key_type(&key, BTRFS_EXTENT_ITEM_KEY); |
247 | ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); | 247 | ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); |
@@ -4087,7 +4087,8 @@ static int is_cowonly_root(u64 root_objectid) | |||
4087 | root_objectid == BTRFS_EXTENT_TREE_OBJECTID || | 4087 | root_objectid == BTRFS_EXTENT_TREE_OBJECTID || |
4088 | root_objectid == BTRFS_CHUNK_TREE_OBJECTID || | 4088 | root_objectid == BTRFS_CHUNK_TREE_OBJECTID || |
4089 | root_objectid == BTRFS_DEV_TREE_OBJECTID || | 4089 | root_objectid == BTRFS_DEV_TREE_OBJECTID || |
4090 | root_objectid == BTRFS_TREE_LOG_OBJECTID) | 4090 | root_objectid == BTRFS_TREE_LOG_OBJECTID || |
4091 | root_objectid == BTRFS_CSUM_TREE_OBJECTID) | ||
4091 | return 1; | 4092 | return 1; |
4092 | return 0; | 4093 | return 0; |
4093 | } | 4094 | } |
@@ -5497,8 +5498,7 @@ static int __insert_orphan_inode(struct btrfs_trans_handle *trans, | |||
5497 | btrfs_set_inode_generation(leaf, item, 1); | 5498 | btrfs_set_inode_generation(leaf, item, 1); |
5498 | btrfs_set_inode_size(leaf, item, size); | 5499 | btrfs_set_inode_size(leaf, item, size); |
5499 | btrfs_set_inode_mode(leaf, item, S_IFREG | 0600); | 5500 | btrfs_set_inode_mode(leaf, item, S_IFREG | 0600); |
5500 | btrfs_set_inode_flags(leaf, item, BTRFS_INODE_NODATASUM | | 5501 | btrfs_set_inode_flags(leaf, item, BTRFS_INODE_NOCOMPRESS); |
5501 | BTRFS_INODE_NOCOMPRESS); | ||
5502 | btrfs_mark_buffer_dirty(leaf); | 5502 | btrfs_mark_buffer_dirty(leaf); |
5503 | btrfs_release_path(root, path); | 5503 | btrfs_release_path(root, path); |
5504 | out: | 5504 | out: |