]> git.tuebingen.mpg.de Git - osl.git/blobdiff - fsck.c
Add target for man page, install oslfsck and its man page on make install.
[osl.git] / fsck.c
diff --git a/fsck.c b/fsck.c
index f4f1071149e783519f6f0fc6c7acfcf4dcdd0b30..f700e9f9624c6437b33c04d0418767c364da79e3 100644 (file)
--- a/fsck.c
+++ b/fsck.c
@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (C) 2007-2008 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2007-2009 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -20,7 +20,7 @@
 
 /** version text used by various commands if -V switch was given */
 #define VERSION_TEXT(prefix) "osl_" prefix " " VERSION " " "\n" \
 
 /** version text used by various commands if -V switch was given */
 #define VERSION_TEXT(prefix) "osl_" prefix " " VERSION " " "\n" \
-       "Copyright (C) 2008 Andre Noll\n" \
+       "Copyright (C) 2008-2009 Andre Noll\n" \
        "This is free software with ABSOLUTELY NO WARRANTY." \
        " See COPYING for details.\n" \
        "Written by Andre Noll.\n" \
        "This is free software with ABSOLUTELY NO WARRANTY." \
        " See COPYING for details.\n" \
        "Written by Andre Noll.\n" \
@@ -399,15 +399,13 @@ static int check_index_ranges(struct osl_table *t)
        //DEBUG_LOG("%d rows. %d columns\n", t->num_rows, t->desc->num_columns);
        t->num_invalid_rows = 0;
        for (i = 0; i < t->num_rows; i++) {
        //DEBUG_LOG("%d rows. %d columns\n", t->num_rows, t->desc->num_columns);
        t->num_invalid_rows = 0;
        for (i = 0; i < t->num_rows; i++) {
+               const struct osl_column_description *cd;
+
                if (row_is_invalid(t, i)) {
                        t->num_invalid_rows++;
                        continue;
                }
                if (row_is_invalid(t, i)) {
                        t->num_invalid_rows++;
                        continue;
                }
-               for (j = 0; j < t->desc->num_columns; j++) { /* FXIME */
-                       const struct osl_column_description *cd =
-                               get_column_description(t->desc, j);
-                       if (cd->storage_type != OSL_MAPPED_STORAGE)
-                               continue;
+               FOR_EACH_MAPPED_COLUMN(j, t, cd) {
                        ret = check_range(t, i, j);
                        if (ret < 0) {
                                if (ret != -E_FSCK_RANGE_VIOLATION)
                        ret = check_range(t, i, j);
                        if (ret < 0) {
                                if (ret != -E_FSCK_RANGE_VIOLATION)
@@ -512,6 +510,8 @@ static int check_for_invalid_objects(struct osl_table *t, uint32_t **lost_bytes)
        /* first count used bytes */
        FOR_EACH_MAPPED_COLUMN(i, t, cd) {
                loss[i] = t->columns[i].data_map.size;
        /* first count used bytes */
        FOR_EACH_MAPPED_COLUMN(i, t, cd) {
                loss[i] = t->columns[i].data_map.size;
+               DEBUG_LOG("column %i data map: %u bytes\n", i,
+                       t->columns[i].data_map.size);
                for (j = 0; j < t->num_rows; j++) {
                        struct osl_object obj;
                        ret = get_mapped_object(t, i, j, &obj);
                for (j = 0; j < t->num_rows; j++) {
                        struct osl_object obj;
                        ret = get_mapped_object(t, i, j, &obj);
@@ -885,8 +885,11 @@ static int fsck_init(struct osl_table_description *desc, struct osl_table **t)
                ret = map_table(*t, (MAP_TBL_FL_IGNORE_DIRTY));
        else
                ret = map_table(*t, 0);
                ret = map_table(*t, (MAP_TBL_FL_IGNORE_DIRTY));
        else
                ret = map_table(*t, 0);
-       if (ret >= 0)
+       if (ret >= 0) {
                (*t)->num_rows = table_num_rows(*t);
                (*t)->num_rows = table_num_rows(*t);
+               DEBUG_LOG("index header size: %d\n", (*t)->index_header_size);
+               DEBUG_LOG("row index size: %d\n", (*t)->row_index_size);
+       }
 out:
        return ret;
 }
 out:
        return ret;
 }