Changeset f092718 in mainline for uspace/srv/fs/fat/fat_fat.c


Ignore:
Timestamp:
2010-11-27T17:42:19Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a6ba0c9
Parents:
45df59a
Message:

Small-to-large block size translation in block cache.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/fat/fat_fat.c

    r45df59a rf092718  
    671671        int rc;
    672672
     673        printf("fat_sanity_check() begin\n");
     674
    673675        /* Check number of FATs. */
    674676        if (bs->fatcnt == 0)
     
    677679        /* Check total number of sectors. */
    678680
     681        printf("fat_sanity_check() totsec\n");
     682
    679683        if (bs->totsec16 == 0 && bs->totsec32 == 0)
    680684                return ENOTSUP;
     685
     686        printf("fat_sanity_check() totsec16 vs 32\n");
    681687
    682688        if (bs->totsec16 != 0 && bs->totsec32 != 0 &&
     
    684690                return ENOTSUP;
    685691
     692        printf("fat_sanity_check() media descriptor\n");
     693
    686694        /* Check media descriptor. Must be between 0xf0 and 0xff. */
    687695        if ((bs->mdesc & 0xf0) != 0xf0)
    688696                return ENOTSUP;
    689697
     698        printf("fat_sanity_check() sec_pre_fat\n");
     699
    690700        /* Check number of sectors per FAT. */
    691701        if (bs->sec_per_fat == 0)
    692702                return ENOTSUP;
     703
     704        printf("fat_sanity_check() root dir size\n");
    693705
    694706        /*
     
    705717        /* Check signature of each FAT. */
    706718
     719        printf("fat_sanity_check() FAT signatures\n");
     720
    707721        for (fat_no = 0; fat_no < bs->fatcnt; fat_no++) {
     722                printf("fat_sanity_check() read cluster 0\n");
    708723                rc = fat_get_cluster(bs, devmap_handle, fat_no, 0, &e0);
    709724                if (rc != EOK)
    710725                        return EIO;
    711726
     727                printf("fat_sanity_check() read cluster 1\n");
    712728                rc = fat_get_cluster(bs, devmap_handle, fat_no, 1, &e1);
    713729                if (rc != EOK)
    714730                        return EIO;
    715731
     732                printf("fat_sanity_check() check FAT mdesc\n");
    716733                /* Check that first byte of FAT contains the media descriptor. */
    717734                if ((e0 & 0xff) != bs->mdesc)
    718735                        return ENOTSUP;
     736
     737                printf("fat_sanity_check() e0/e1\n");
    719738
    720739                /*
     
    725744                        return ENOTSUP;
    726745        }
     746        printf("fat_sanity_check() succeeded\n");
    727747
    728748        return EOK;
Note: See TracChangeset for help on using the changeset viewer.