diff options
author | Ralf Corsepius <ralf.corsepius@rtems.org> | 2004-11-20 03:11:41 +0000 |
---|---|---|
committer | Ralf Corsepius <ralf.corsepius@rtems.org> | 2004-11-20 03:11:41 +0000 |
commit | c36f885aa7b4390efdf5b89adc6866e1024e1ceb (patch) | |
tree | a386de34a591223bba3bbb03cc2759048ba964a3 /cpukit/libfs/src/dosfs/fat.c | |
parent | 2004-11-20 Ralf Corsepius <ralf.corsepiu@rtems.org> (diff) | |
download | rtems-c36f885aa7b4390efdf5b89adc6866e1024e1ceb.tar.bz2 |
2004-11-20 Ralf Corsepius <ralf.corsepiu@rtems.org>
PR 720/filesystem:
* libfs/src/dosfs/dosfs.h, libfs/src/dosfs/fat.c,
libfs/src/dosfs/fat.h, libfs/src/dosfs/msdos_format.c:
Adaptations to msdos_format.
(From Thomas Doerfler <Thomas.Doerfler@imd-systems.de>).
* libfs/src/dosfs/dosfs.h, libfs/src/dosfs/fat.c,
libfs/src/dosfs/fat.h, libfs/src/dosfs/msdos_format.c:
Adaptations to RTEMS-4.7.
Diffstat (limited to 'cpukit/libfs/src/dosfs/fat.c')
-rw-r--r-- | cpukit/libfs/src/dosfs/fat.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/cpukit/libfs/src/dosfs/fat.c b/cpukit/libfs/src/dosfs/fat.c index e0bcdb2cc0..a566829b91 100644 --- a/cpukit/libfs/src/dosfs/fat.c +++ b/cpukit/libfs/src/dosfs/fat.c @@ -247,10 +247,10 @@ fat_init_volume_info(rtems_filesystem_mount_table_entry_t *mt_entry) } close(fd); - vol->bps = FAT_BR_BYTES_PER_SECTOR(boot_rec); - - if ( (vol->bps != 512) && - (vol->bps != 1024) && + vol->bps = FAT_GET_BR_BYTES_PER_SECTOR(boot_rec); + + if ( (vol->bps != 512) && + (vol->bps != 1024) && (vol->bps != 2048) && (vol->bps != 4096)) { @@ -263,7 +263,7 @@ fat_init_volume_info(rtems_filesystem_mount_table_entry_t *mt_entry) for (vol->sec_log2 = 0, i = vol->bps; (i & 1) == 0; i >>= 1, vol->sec_log2++); - vol->spc = FAT_BR_SECTORS_PER_CLUSTER(boot_rec); + vol->spc = FAT_GET_BR_SECTORS_PER_CLUSTER(boot_rec); /* * "sectors per cluster" of zero is invalid * (and would hang the following loop) @@ -289,33 +289,33 @@ fat_init_volume_info(rtems_filesystem_mount_table_entry_t *mt_entry) for (vol->bpc_log2 = 0, i = vol->bpc; (i & 1) == 0; i >>= 1, vol->bpc_log2++); - vol->fats = FAT_BR_FAT_NUM(boot_rec); - vol->fat_loc = FAT_BR_RESERVED_SECTORS_NUM(boot_rec); - - vol->rdir_entrs = FAT_BR_FILES_PER_ROOT_DIR(boot_rec); + vol->fats = FAT_GET_BR_FAT_NUM(boot_rec); + vol->fat_loc = FAT_GET_BR_RESERVED_SECTORS_NUM(boot_rec); + vol->rdir_entrs = FAT_GET_BR_FILES_PER_ROOT_DIR(boot_rec); + /* calculate the count of sectors occupied by the root directory */ vol->rdir_secs = ((vol->rdir_entrs * FAT_DIRENTRY_SIZE) + (vol->bps - 1)) / vol->bps; vol->rdir_size = vol->rdir_secs << vol->sec_log2; - if ( (FAT_BR_SECTORS_PER_FAT(boot_rec)) != 0) - vol->fat_length = FAT_BR_SECTORS_PER_FAT(boot_rec); + if ( (FAT_GET_BR_SECTORS_PER_FAT(boot_rec)) != 0) + vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT(boot_rec); else - vol->fat_length = FAT_BR_SECTORS_PER_FAT32(boot_rec); - - vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + + vol->fat_length = FAT_GET_BR_SECTORS_PER_FAT32(boot_rec); + + vol->data_fsec = vol->fat_loc + vol->fats * vol->fat_length + vol->rdir_secs; /* for FAT12/16 root dir starts at(sector) */ vol->rdir_loc = vol->fat_loc + vol->fats * vol->fat_length; - - if ( (FAT_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) - vol->tot_secs = FAT_BR_TOTAL_SECTORS_NUM16(boot_rec); + + if ( (FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec)) != 0) + vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM16(boot_rec); else - vol->tot_secs = FAT_BR_TOTAL_SECTORS_NUM32(boot_rec); - + vol->tot_secs = FAT_GET_BR_TOTAL_SECTORS_NUM32(boot_rec); + data_secs = vol->tot_secs - vol->data_fsec; vol->data_cls = data_secs / vol->spc; @@ -345,15 +345,15 @@ fat_init_volume_info(rtems_filesystem_mount_table_entry_t *mt_entry) if (vol->type == FAT_FAT32) { - vol->rdir_cl = FAT_BR_FAT32_ROOT_CLUSTER(boot_rec); - - vol->mirror = FAT_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; + vol->rdir_cl = FAT_GET_BR_FAT32_ROOT_CLUSTER(boot_rec); + + vol->mirror = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_MIRROR; if (vol->mirror) - vol->afat = FAT_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; + vol->afat = FAT_GET_BR_EXT_FLAGS(boot_rec) & FAT_BR_EXT_FLAGS_FAT_NUM; else vol->afat = 0; - vol->info_sec = FAT_BR_FAT32_FS_INFO_SECTOR(boot_rec); + vol->info_sec = FAT_GET_BR_FAT32_FS_INFO_SECTOR(boot_rec); if( vol->info_sec == 0 ) { rtems_disk_release(vol->dd); @@ -367,9 +367,9 @@ fat_init_volume_info(rtems_filesystem_mount_table_entry_t *mt_entry) { rtems_disk_release(vol->dd); return -1; - } - - if (FAT_FSINFO_LEAD_SIGNATURE(fs_info_sector) != + } + + if (FAT_GET_FSINFO_LEAD_SIGNATURE(fs_info_sector) != FAT_FSINFO_LEAD_SIGNATURE_VALUE) { rtems_disk_release(vol->dd); @@ -383,11 +383,11 @@ fat_init_volume_info(rtems_filesystem_mount_table_entry_t *mt_entry) { rtems_disk_release(vol->dd); return -1; - } - - vol->free_cls = FAT_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); - vol->next_cl = FAT_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); - rc = fat_fat32_update_fsinfo_sector(mt_entry, 0xFFFFFFFF, + } + + vol->free_cls = FAT_GET_FSINFO_FREE_CLUSTER_COUNT(fs_info_sector); + vol->next_cl = FAT_GET_FSINFO_NEXT_FREE_CLUSTER(fs_info_sector); + rc = fat_fat32_update_fsinfo_sector(mt_entry, 0xFFFFFFFF, 0xFFFFFFFF); if ( rc != RC_OK ) { |