summaryrefslogtreecommitdiff
path: root/mkfs.c
diff options
context:
space:
mode:
authorYan Zheng <zheng.yan@oracle.com>2008-10-29 14:07:47 -0400
committerChris Mason <chris.mason@oracle.com>2008-10-29 14:07:47 -0400
commit38702ea7c6456019702658a1524807439febbed3 (patch)
treeebc90212fda77d047b5bc2105a85c424626d2397 /mkfs.c
parentc830821ddf963037cee381fa004b3df0a5296a1b (diff)
Add root tree pointer transaction ids
This patch adds transaction IDs to root tree pointers. Transaction IDs in tree pointers are compared with the generation numbers in block headers when reading root blocks of trees. This can detect some types of IO errors. Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Diffstat (limited to 'mkfs.c')
-rw-r--r--mkfs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/mkfs.c b/mkfs.c
index 3c09c3a9..dae43e97 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -247,6 +247,7 @@ static int create_data_reloc_tree(struct btrfs_trans_handle *trans,
memcpy(&root_item, &root->root_item, sizeof(root_item));
btrfs_set_root_bytenr(&root_item, tmp->start);
btrfs_set_root_level(&root_item, btrfs_header_level(tmp));
+ btrfs_set_root_generation(&root_item, trans->transid);
free_extent_buffer(tmp);
location.objectid = objectid;