Changeset f092718 in mainline for uspace/srv/fs/fat/fat_fat.c
- Timestamp:
- 2010-11-27T17:42:19Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a6ba0c9
- Parents:
- 45df59a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_fat.c
r45df59a rf092718 671 671 int rc; 672 672 673 printf("fat_sanity_check() begin\n"); 674 673 675 /* Check number of FATs. */ 674 676 if (bs->fatcnt == 0) … … 677 679 /* Check total number of sectors. */ 678 680 681 printf("fat_sanity_check() totsec\n"); 682 679 683 if (bs->totsec16 == 0 && bs->totsec32 == 0) 680 684 return ENOTSUP; 685 686 printf("fat_sanity_check() totsec16 vs 32\n"); 681 687 682 688 if (bs->totsec16 != 0 && bs->totsec32 != 0 && … … 684 690 return ENOTSUP; 685 691 692 printf("fat_sanity_check() media descriptor\n"); 693 686 694 /* Check media descriptor. Must be between 0xf0 and 0xff. */ 687 695 if ((bs->mdesc & 0xf0) != 0xf0) 688 696 return ENOTSUP; 689 697 698 printf("fat_sanity_check() sec_pre_fat\n"); 699 690 700 /* Check number of sectors per FAT. */ 691 701 if (bs->sec_per_fat == 0) 692 702 return ENOTSUP; 703 704 printf("fat_sanity_check() root dir size\n"); 693 705 694 706 /* … … 705 717 /* Check signature of each FAT. */ 706 718 719 printf("fat_sanity_check() FAT signatures\n"); 720 707 721 for (fat_no = 0; fat_no < bs->fatcnt; fat_no++) { 722 printf("fat_sanity_check() read cluster 0\n"); 708 723 rc = fat_get_cluster(bs, devmap_handle, fat_no, 0, &e0); 709 724 if (rc != EOK) 710 725 return EIO; 711 726 727 printf("fat_sanity_check() read cluster 1\n"); 712 728 rc = fat_get_cluster(bs, devmap_handle, fat_no, 1, &e1); 713 729 if (rc != EOK) 714 730 return EIO; 715 731 732 printf("fat_sanity_check() check FAT mdesc\n"); 716 733 /* Check that first byte of FAT contains the media descriptor. */ 717 734 if ((e0 & 0xff) != bs->mdesc) 718 735 return ENOTSUP; 736 737 printf("fat_sanity_check() e0/e1\n"); 719 738 720 739 /* … … 725 744 return ENOTSUP; 726 745 } 746 printf("fat_sanity_check() succeeded\n"); 727 747 728 748 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.