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

Changeset 69f9cf5 in mainline


Ignore:
Timestamp:
2012-02-24T21:39:27Z (10 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master
Children:
557e5b13
Parents:
78de7be2
Message:

mkexfat: Allocate a cluster for the root directory entry also, fix bug in the fat_allocate_cluster() function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/mkexfat/mkexfat.c

    r78de7be2 r69f9cf5  
    378378{
    379379        int rc;
    380         aoff64_t fat_sec = cur_cls / sizeof(uint32_t) + FAT_SECTOR_START;
    381380        unsigned const fat_entries = cfg->sector_size / sizeof(uint32_t);
     381        aoff64_t fat_sec = cur_cls / fat_entries + FAT_SECTOR_START;
    382382        uint32_t *fat;
    383383
     
    611611        }
    612612
     613        next_cls += div_round_up(sizeof(upcase_table), cfg.cluster_size);
     614        cfg.rootdir_cluster = next_cls;
     615
     616        /* Allocate a cluster for the root directory entry */
     617        rc = fat_allocate_clusters(service_id, &cfg, next_cls, 1);
     618        if (rc != EOK) {
     619                printf(NAME ": Error, failed to allocate cluster for the root dentry.\n");
     620                return 2;
     621        }
     622
    613623        return 0;
    614624}
Note: See TracChangeset for help on using the changeset viewer.