summaryrefslogtreecommitdiff
path: root/disk-io.c
diff options
context:
space:
mode:
authorYan Zheng <zheng.yan@oracle.com>2009-06-03 11:59:47 -0400
committerChris Mason <chris.mason@oracle.com>2009-06-08 13:31:10 -0400
commit50860d6e31c28cf4789ef099729dfbce2108620a (patch)
tree417d481264e84935fec3a2a1fcfb3cf3475b207a /disk-io.c
parent95d3f20b51e9b2ee21822313ad4f31279396407b (diff)
Update converter for the new format
Signed-off-by: Yan Zheng <zheng.yan@oracle.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'disk-io.c')
-rw-r--r--disk-io.c8
1 files changed, 8 insertions, 0 deletions
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);