Ignore:
Timestamp:
Mar 25, 2003, 5:01:56 PM (17 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Children:
bf71e25e
Parents:
2742cc3
Message:

2003-03-25 Thomas Doerfler <Thomas.Doerfler@…>

PR 367/filesystem

  • src/dosfs/Makefile.am, src/dosfs/fat.c, src/dosfs/fat.h, src/dosfs/fat_fat_operations.c, src/dosfs/fat_file.c, src/dosfs/msdos.h, src/dosfs/msdos_dir.c: Some bugs were still present in the DOSFS implementation:
    • FAT12 did not work properly on Big-Endian machines
    • Some synchronization and error handling problems were present
    • Some legal codings for EOC were not recognized
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libfs/src/dosfs/fat_fat_operations.c

    r2742cc3 r01c5b9d7  
    7979        }   
    8080
    81         if ((next_cln & fs_info->vol.mask) == FAT_GENFAT_FREE)
     81        /*if ((next_cln & fs_info->vol.mask) == FAT_GENFAT_FREE)*/
     82        if (next_cln == FAT_GENFAT_FREE)
    8283        {
    8384            /*
     
    178179    unsigned32     freed_cls_cnt = 0;
    179180   
    180     while ((cur_cln & fs_info->vol.mask) != fs_info->vol.eoc_val)
     181    while ((cur_cln & fs_info->vol.mask) < fs_info->vol.eoc_val)
    181182    {
    182183        rc = fat_get_fat_cluster(mt_entry, cur_cln, &next_cln);
     
    277278            else
    278279                *ret_val = (*ret_val) & FAT_FAT12_MASK;
    279 
    280280            break;
    281281
     
    343343            if ( FAT_CLUSTER_IS_ODD(cln) )
    344344            {
     345#if 0
     346              /*
     347               * do not perform endian conversion explicitely,
     348               * because following code will enforce little
     349               * endian format implicitly!
     350               */               
    345351                fat16_clv = CT_LE_W((((unsigned16)in_val) << FAT_FAT12_SHIFT));
    346 
     352#else
     353                fat16_clv = ((unsigned16)in_val) << FAT_FAT12_SHIFT;
     354#endif
    347355                *((unsigned8 *)(block0->buffer + ofs)) =
    348356                        (*((unsigned8 *)(block0->buffer + ofs))) & 0x0F;
     
    380388            else
    381389            {
     390#if 0
     391              /*
     392               * do not perform endian conversion explicitely,
     393               * because following code will enforce little
     394               * endian format implicitly!
     395               */               
    382396                fat16_clv = CT_LE_W((((unsigned16)in_val) & FAT_FAT12_MASK));
    383 
     397#else
     398                fat16_clv = ((unsigned16)in_val) & FAT_FAT12_MASK;
     399#endif
    384400                *((unsigned8 *)(block0->buffer + ofs)) &= 0x00;
    385401
Note: See TracChangeset for help on using the changeset viewer.