Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 0a51029f in mainline


Ignore:
Timestamp:
2011-05-01T07:02:34Z (11 years ago)
Author:
Oleg Romanenko <romanenko.oleg@…>
Branches:
lfn, master
Children:
b5db2ae
Parents:
aa2ea13
Message:

Implemented readonly access to FAT32 file system
Support reading root directory, subdirs and files.

Location:
uspace/srv/fs/fat
Files:
2 edited

Legend:

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

    raa2ea13 r0a51029f  
    474474        int rc;
    475475
    476         for (fatno = FAT1 + 1; fatno < bs->fatcnt; fatno++) {
     476        for (fatno = FAT1 + 1; fatno < FATCNT(bs); fatno++) {
    477477                for (c = 0; c < nclsts; c++) {
    478478                        rc = fat_set_cluster(bs, devmap_handle, fatno, lifo[c],
     
    584584                if (rc != EOK)
    585585                        return rc;
    586                 for (fatno = FAT1; fatno < bs->fatcnt; fatno++) {
     586                for (fatno = FAT1; fatno < FATCNT(bs); fatno++) {
    587587                        rc = fat_set_cluster(bs, devmap_handle, fatno, firstc,
    588588                            FAT_CLST_RES0);
     
    630630                }
    631631
    632                 for (fatno = FAT1; fatno < bs->fatcnt; fatno++) {
     632                for (fatno = FAT1; fatno < FATCNT(bs); fatno++) {
    633633                        rc = fat_set_cluster(bs, nodep->idx->devmap_handle,
    634634                            fatno, lastc, mcl);
     
    683683
    684684                /* Terminate the cluster chain in all copies of FAT. */
    685                 for (fatno = FAT1; fatno < bs->fatcnt; fatno++) {
     685                for (fatno = FAT1; fatno < FATCNT(bs); fatno++) {
    686686                        rc = fat_set_cluster(bs, devmap_handle, fatno, lcl,
    687687                            clst_last1);
  • uspace/srv/fs/fat/fat_ops.c

    raa2ea13 r0a51029f  
    10551055
    10561056        rootp->type = FAT_DIRECTORY;
    1057         rootp->firstc = FAT_CLST_ROOT;
     1057        rootp->firstc = (FAT_IS_FAT32(bs) ? bs->fat32.root_cluster : FAT_CLST_ROOT);
    10581058        rootp->refcnt = 1;
    10591059        rootp->lnkcnt = 0;      /* FS root is not linked */
    1060         rootp->size = RDE(bs) * sizeof(fat_dentry_t);
     1060        rootp->size = (FAT_IS_FAT32(bs) ? SPC(bs)*BPS(bs) :
     1061            RDE(bs) * sizeof(fat_dentry_t));
    10611062        rootp->idx = ridxp;
    10621063        ridxp->nodep = rootp;
Note: See TracChangeset for help on using the changeset viewer.