aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorYan Zheng <zheng.yan@oracle.com>2009-01-06 11:42:00 -0500
committerChris Mason <chris.mason@oracle.com>2009-01-06 11:42:00 -0500
commit07d400a6df4767a90d49a153fdb7f4cfa1e3f23e (patch)
tree8ca61bb87ffb72343b8d392a26fb7a6265f6fa3d /fs/btrfs/inode.c
parent1ba12553f3600ffebad226c5204ab0e46df98161 (diff)
Btrfs: tree logging checksum fixes
This patch contains following things. 1) Limit the max size of btrfs_ordered_sum structure to PAGE_SIZE. This struct is kmalloced so we want to keep it reasonable. 2) Replace copy_extent_csums by btrfs_lookup_csums_range. This was duplicated code in tree-log.c 3) Remove replay_one_csum. csum items are replayed at the same time as replaying file extents. This guarantees we only replay useful csums. 4) nbytes accounting fix. Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index c0ca9c3723c0..4e57fe68e4b9 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -157,7 +157,6 @@ static noinline int insert_inline_extent(struct btrfs_trans_handle *trans,
157 key.objectid = inode->i_ino; 157 key.objectid = inode->i_ino;
158 key.offset = start; 158 key.offset = start;
159 btrfs_set_key_type(&key, BTRFS_EXTENT_DATA_KEY); 159 btrfs_set_key_type(&key, BTRFS_EXTENT_DATA_KEY);
160 inode_add_bytes(inode, size);
161 datasize = btrfs_file_extent_calc_inline_size(cur_size); 160 datasize = btrfs_file_extent_calc_inline_size(cur_size);
162 161
163 inode_add_bytes(inode, size); 162 inode_add_bytes(inode, size);
@@ -920,8 +919,8 @@ static noinline int csum_exist_in_range(struct btrfs_root *root,
920 struct btrfs_ordered_sum *sums; 919 struct btrfs_ordered_sum *sums;
921 LIST_HEAD(list); 920 LIST_HEAD(list);
922 921
923 ret = btrfs_lookup_csums_range(root, bytenr, bytenr + num_bytes - 1, 922 ret = btrfs_lookup_csums_range(root->fs_info->csum_root, bytenr,
924 &list); 923 bytenr + num_bytes - 1, &list);
925 if (ret == 0 && list_empty(&list)) 924 if (ret == 0 && list_empty(&list))
926 return 0; 925 return 0;
927 926