Ignore:
Timestamp:
2012-06-29T13:02:14Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
722912e
Parents:
ba72f2b (diff), 0bbd13e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

Trivial conflicts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/exfat/exfat_directory.c

    rba72f2b r6843a9c  
    9292        int rc = EOK;
    9393       
    94         if (di->b)
     94        if (di->b) {
    9595                rc = block_put(di->b);
     96                di->b = NULL;
     97        }
    9698       
    9799        return rc;
     
    101103{
    102104        uint32_t i;
    103         int rc;
     105        int rc = EOK;
    104106
    105107        i = (di->pos * sizeof(exfat_dentry_t)) / BPS(di->bs);
     
    108110
    109111        if (di->b && di->bnum != i) {
    110                 block_put(di->b);
     112                rc = block_put(di->b);
    111113                di->b = NULL;
     114                if (rc != EOK)
     115                        return rc;
    112116        }
    113117        if (!di->b) {
     
    126130                di->bnum = i;
    127131        }
    128         return EOK;
     132        return rc;
    129133}
    130134
     
    264268                if (idx == 2 || idx == 3)
    265269                        continue;
    266                 checksum = ((checksum << 15) | (checksum >> 1)) + (uint16_t)bytes[idx];
     270                checksum = ((checksum << 15) | (checksum >> 1)) +
     271                    (uint16_t)bytes[idx];
    267272        }
    268273        return checksum;
     
    285290        for (i = 0; i < count; i++) {
    286291                rc = exfat_directory_get(di, &de);
    287                 if (rc != EOK)
    288                         return rc;
     292                if (rc != EOK) {
     293                        free(array);
     294                        return rc;
     295                }
    289296                array[i] = *de;
    290297                rc = exfat_directory_next(di);
     
    306313        array[1].stream.valid_data_size = host2uint64_t_le(ds->valid_data_size);
    307314        array[1].stream.data_size = host2uint64_t_le(ds->data_size);
    308         array[0].file.checksum = host2uint16_t_le(exfat_directory_set_checksum((uint8_t *)array,
     315        array[0].file.checksum =
     316            host2uint16_t_le(exfat_directory_set_checksum((uint8_t *)array,
    309317            count * sizeof(exfat_dentry_t)));
    310318
     
    312320        for (i = 0; i < count; i++) {
    313321                rc = exfat_directory_get(di, &de);
    314                 if (rc != EOK)
    315                         return rc;
     322                if (rc != EOK) {
     323                        free(array);
     324                        return rc;
     325                }
    316326                *de = array[i];
    317327                di->b->dirty = true;
     
    346356        uctablep = EXFAT_NODE(fn);
    347357
    348         uctable_chars = ALIGN_DOWN(uctablep->size, sizeof(uint16_t)) / sizeof(uint16_t);
     358        uctable_chars = ALIGN_DOWN(uctablep->size,
     359            sizeof(uint16_t)) / sizeof(uint16_t);
    349360        uctable = (uint16_t *) malloc(uctable_chars * sizeof(uint16_t));
    350361        rc = exfat_read_uctable(di->bs, uctablep, (uint8_t *)uctable);
     
    360371        ds.stream.valid_data_size = 0;
    361372        ds.stream.data_size = 0;
    362         ds.stream.name_size = utf16_length(wname);
     373        ds.stream.name_size = exfat_utf16_length(wname);
    363374        ds.stream.hash = host2uint16_t_le(exfat_name_hash(wname, uctable,
    364375            uctable_chars));
     
    411422                        return rc;
    412423
    413                 if (i == df.file.count - 2)
    414                         chars = ds.stream.name_size - EXFAT_NAME_PART_LEN*(df.file.count - 2);
     424                if (i == df.file.count - 2) {
     425                        chars = ds.stream.name_size -
     426                            EXFAT_NAME_PART_LEN*(df.file.count - 2);
     427                }
     428
    415429                rc = exfat_directory_get(di, &de);
    416430                if (rc != EOK)
     
    424438
    425439                di->b->dirty = true;
    426                 sname += chars;
    427440        }
    428441       
     
    434447        int rc, count;
    435448        exfat_dentry_t *de;
     449
     450        di->pos = pos;
    436451
    437452        rc = exfat_directory_get(di, &de);
Note: See TracChangeset for help on using the changeset viewer.