]> git.tuebingen.mpg.de Git - osl.git/blobdiff - fsck.c
Store table version in struct osl_table.
[osl.git] / fsck.c
diff --git a/fsck.c b/fsck.c
index f96f77c91fcc11327b12b605793e16b0fb966429..8a32abae24dc38d49821711d0acc0511a3ff0872 100644 (file)
--- a/fsck.c
+++ b/fsck.c
@@ -872,21 +872,23 @@ static void set_dummy_contents(struct osl_table_description *desc)
 static int fsck_init(struct osl_table_description *desc, struct osl_table **t)
 {
        struct osl_object map;
-       int ret = map_index(desc, &map);
+       int version, ret = map_index(desc, &map);
 
        if (ret < 0)
                goto out;
-       ret = read_table_desc(&map, desc);
+       ret = read_table_desc(&map, desc); /* checks table version */
        if (ret < 0) {
                osl_munmap(map.data, map.size);
                goto out;
        }
+       version = ret;
        set_dummy_contents(desc);
        ret = init_table_structure(desc, t);
        if (ret < 0) {
                osl_munmap(map.data, map.size);
                goto out;
        }
+       (*t)->version = version;
        DEBUG_LOG("unmapping index\n");
        osl_munmap(map.data, map.size);
        if (OPT_GIVEN(FORCE))