Changeset a429bfb in mainline for uspace/srv/fs/fat/fat_fat.c


Ignore:
Timestamp:
2008-10-26T18:22:03Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e17d986
Parents:
8bc6fcf
Message:

Make sure that data are converted from / to the native endianity when writing them
out to / reading them in from the file system.

File:
1 edited

Legend:

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

    r8bc6fcf ra429bfb  
    286286                for (c = 0; c < bps / sizeof(fat_cluster_t); c++, cl++) {
    287287                        fat_cluster_t *clst = (fat_cluster_t *)blk->data + c;
    288                         if (*clst == FAT_CLST_RES0) {
     288                        if (uint16_t_le2host(*clst) == FAT_CLST_RES0) {
    289289                                /*
    290290                                 * The cluster is free. Put it into our stack
     
    292292                                 */
    293293                                lifo[found] = cl;
    294                                 if (found == 0)
    295                                         *clst = FAT_CLST_LAST1;
    296                                 else
    297                                         *clst = lifo[found - 1];
     294                                *clst = (found == 0) ?
     295                                    host2uint16_t_le(FAT_CLST_LAST1) :
     296                                    host2uint16_t_le(lifo[found - 1]);
    298297                                blk->dirty = true;      /* need to sync block */
    299298                                if (++found == nclsts) {
Note: See TracChangeset for help on using the changeset viewer.