From 50860d6e31c28cf4789ef099729dfbce2108620a Mon Sep 17 00:00:00 2001 From: Yan Zheng Date: Wed, 3 Jun 2009 11:59:47 -0400 Subject: Update converter for the new format Signed-off-by: Yan Zheng Signed-off-by: Chris Mason --- disk-io.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'disk-io.c') diff --git a/disk-io.c b/disk-io.c index 2b5771cb..addebe19 100644 --- a/disk-io.c +++ b/disk-io.c @@ -755,6 +755,8 @@ struct btrfs_root *open_ctree_fd(int fp, const char *path, u64 sb_bytenr, BUG_ON(ret); find_and_setup_log_root(tree_root, fs_info, disk_super); + + fs_info->generation = generation + 1; btrfs_read_block_groups(fs_info->tree_root); key.objectid = BTRFS_FS_TREE_OBJECTID; @@ -771,6 +773,7 @@ struct btrfs_root *open_ctree_fd(int fp, const char *path, u64 sb_bytenr, int btrfs_read_dev_super(int fd, struct btrfs_super_block *sb, u64 sb_bytenr) { + u8 fsid[BTRFS_FSID_SIZE]; struct btrfs_super_block buf; int i; int ret; @@ -802,6 +805,11 @@ int btrfs_read_dev_super(int fd, struct btrfs_super_block *sb, u64 sb_bytenr) sizeof(buf.magic))) continue; + if (i == 0) + memcpy(fsid, buf.fsid, sizeof(fsid)); + else if (memcmp(fsid, buf.fsid, sizeof(fsid))) + continue; + if (btrfs_super_generation(&buf) > transid) { memcpy(sb, &buf, sizeof(*sb)); transid = btrfs_super_generation(&buf); -- cgit v1.2.3