Changeset 06d85e5 in mainline for uspace/lib/ext4/libext4_bitmap.c


Ignore:
Timestamp:
2012-06-18T11:09:34Z (13 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2616a75b
Parents:
9a487cc
Message:

Most of comments modified by current coding style

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ext4/libext4_bitmap.c

    r9a487cc r06d85e5  
    7373        uint32_t byte_index;
    7474
    75         // Align index to multiple of 8
     75        /* Align index to multiple of 8 */
    7676        while (((idx % 8) != 0) && (remaining > 0)) {
    7777
     
    8787        }
    8888
    89         // For < 8 bits this check necessary
     89        /* For < 8 bits this check necessary */
    9090        if (remaining == 0) {
    9191                return;
     
    9797        target = bitmap + byte_index;
    9898
    99         // Zero the whole bytes
     99        /* Zero the whole bytes */
    100100        while (remaining >= 8) {
    101101                *target = 0;
     
    108108        assert(remaining < 8);
    109109
    110         // Zero remaining bytes
     110        /* Zero remaining bytes */
    111111        while (remaining != 0) {
    112112
     
    174174        uint32_t idx;
    175175
    176         // Align idx
     176        /* Align idx */
    177177        if (start % 8) {
    178178                idx = start + (8 - (start % 8));
     
    183183        uint8_t *pos = bitmap + (idx / 8);
    184184
    185         // Try to find free byte
     185        /* Try to find free byte */
    186186        while (idx < max) {
    187187
     
    197197        }
    198198
    199         // Free byte not found
     199        /* Free byte not found */
    200200        return ENOSPC;
    201201}
     
    218218        bool byte_part = false;
    219219
    220         // Check the rest of first byte
     220        /* Check the rest of first byte */
    221221        while ((idx % 8) != 0) {
    222222                byte_part = true;
     
    235235        }
    236236
    237         // Check the whole bytes (255 = 11111111 binary)
     237        /* Check the whole bytes (255 = 11111111 binary) */
    238238        while (idx < max) {
    239239
    240240                if ((*pos & 255) != 255) {
    241                         // free bit found
     241                        /* free bit found */
    242242                        break;
    243243                }
     
    247247        }
    248248
    249         // If idx < max, some free bit found
     249        /* If idx < max, some free bit found */
    250250        if (idx < max) {
    251251
    252                 // Check which bit from byte is free
     252                /* Check which bit from byte is free */
    253253                for (uint8_t i = 0; i < 8; ++i) {
    254254                        if ((*pos & (1 << i)) == 0) {
    255                                 // free bit found
     255                                /* free bit found */
    256256                                *pos |=  (1 << i);
    257257                                *index = idx;
     
    262262        }
    263263
    264         // Free bit not found
     264        /* Free bit not found */
    265265        return ENOSPC;
    266266}
Note: See TracChangeset for help on using the changeset viewer.