Changeset 18b6a88 in mainline for uspace/srv/fs/exfat


Ignore:
Timestamp:
2018-04-15T09:35:04Z (8 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c1f44ca
Parents:
8ebe212
Message:

More ccheck fixes, sometimes with manual intervention.

Location:
uspace/srv/fs/exfat
Files:
4 edited

Legend:

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

    r8ebe212 r18b6a88  
    455455                if (i == df.file.count - 2) {
    456456                        chars = ds.stream.name_size -
    457                             EXFAT_NAME_PART_LEN*(df.file.count - 2);
     457                            EXFAT_NAME_PART_LEN * (df.file.count - 2);
    458458                }
    459459
  • uspace/srv/fs/exfat/exfat_fat.c

    r8ebe212 r18b6a88  
    142142                         */
    143143                        return block_get(block, nodep->idx->service_id, DATA_FS(bs) +
    144                         (nodep->lastc_cached_value-EXFAT_CLST_FIRST)*SPC(bs) +
     144                            (nodep->lastc_cached_value - EXFAT_CLST_FIRST) * SPC(bs) +
    145145                            (bn % SPC(bs)), flags);
    146146                }
     
    201201        if (!fragmented) {
    202202                rc = block_get(block, service_id, DATA_FS(bs) +
    203                     (fcl - EXFAT_CLST_FIRST)*SPC(bs) + bn, flags);
     203                    (fcl - EXFAT_CLST_FIRST) * SPC(bs) + bn, flags);
    204204        } else {
    205205                max_clusters = bn / SPC(bs);
     
    514514        block_t *b;
    515515        errno_t rc;
    516         blocks = ROUND_UP(nodep->size, BPS(bs))/BPS(bs);
     516        blocks = ROUND_UP(nodep->size, BPS(bs)) / BPS(bs);
    517517        count = BPS(bs);
    518518
  • uspace/srv/fs/exfat/exfat_idx.c

    r8ebe212 r18b6a88  
    119119static inline size_t pos_key_hash(void *key)
    120120{
    121         pos_key_t *pos = (pos_key_t*)key;
     121        pos_key_t *pos = (pos_key_t *)key;
    122122
    123123        size_t hash = 0;
     
    141141static bool pos_key_equal(void *key, const ht_link_t *item)
    142142{
    143         pos_key_t *pos = (pos_key_t*)key;
     143        pos_key_t *pos = (pos_key_t *)key;
    144144        exfat_idx_t *fidx = hash_table_get_inst(item, exfat_idx_t, uph_link);
    145145
    146         return pos->service_id == fidx->service_id
    147                 && pos->pdi == fidx->pdi
    148                 && pos->pfc == fidx->pfc;
     146        return pos->service_id == fidx->service_id &&
     147            pos->pdi == fidx->pdi &&
     148            pos->pfc == fidx->pfc;
    149149}
    150150
     
    170170static size_t idx_key_hash(void *key_arg)
    171171{
    172         idx_key_t *key = (idx_key_t*)key_arg;
     172        idx_key_t *key = (idx_key_t *)key_arg;
    173173        return hash_combine(key->service_id, key->index);
    174174}
     
    183183{
    184184        exfat_idx_t *fidx = hash_table_get_inst(item, exfat_idx_t, uih_link);
    185         idx_key_t *key = (idx_key_t*)key_arg;
     185        idx_key_t *key = (idx_key_t *)key_arg;
    186186
    187187        return key->index == fidx->index && key->service_id == fidx->service_id;
     
    509509static bool rm_pos_service_id(ht_link_t *item, void *arg)
    510510{
    511         service_id_t service_id = *(service_id_t*)arg;
     511        service_id_t service_id = *(service_id_t *)arg;
    512512        exfat_idx_t *fidx = hash_table_get_inst(item, exfat_idx_t, uph_link);
    513513
     
    521521static bool rm_idx_service_id(ht_link_t *item, void *arg)
    522522{
    523         service_id_t service_id = *(service_id_t*)arg;
     523        service_id_t service_id = *(service_id_t *)arg;
    524524        exfat_idx_t *fidx = hash_table_get_inst(item, exfat_idx_t, uih_link);
    525525
  • uspace/srv/fs/exfat/exfat_ops.c

    r8ebe212 r18b6a88  
    248248                fn = FS_NODE(nodep);
    249249        } else {
    250 skip_cache:
     250        skip_cache:
    251251                /* Try to allocate a new node structure. */
    252252                fibril_mutex_unlock(&ffn_mutex);
     
    533533                            (BPS(di.bs) / sizeof(exfat_dentry_t));
    534534                        exfat_idx_t *idx = exfat_idx_get_by_pos(service_id,
    535                                 parentp->firstc, di.bnum * DPS(di.bs) + o);
     535                            parentp->firstc, di.bnum * DPS(di.bs) + o);
    536536                        if (!idx) {
    537537                                /*
     
    706706                if (nodep->fragmented)
    707707                        rc = exfat_free_clusters(bs, nodep->idx->service_id,
    708                                 nodep->firstc);
     708                            nodep->firstc);
    709709                else
    710710                        rc = exfat_bitmap_free_clusters(bs, nodep,
     
    805805
    806806        exfat_directory_t di;
    807         rc = exfat_directory_open(parentp,&di);
     807        rc = exfat_directory_open(parentp, &di);
    808808        if (rc != EOK)
    809809                goto error;
     
    10621062        rc = exfat_node_get_new_by_pos(&rootp, service_id, EXFAT_ROOT_PAR,
    10631063            EXFAT_ROOT_POS);
    1064         if (rc!=EOK) {
     1064        if (rc != EOK) {
    10651065                (void) block_cache_fini(service_id);
    10661066                block_fini(service_id);
     
    11831183                        block_fini(service_id);
    11841184                        exfat_idx_fini_by_service_id(service_id);
    1185                     return ENOTSUP;
     1185                        return ENOTSUP;
    11861186                }
    11871187        }
     
    14091409                (void) exfat_directory_close(&di);
    14101410
    1411 err:
     1411        err:
    14121412                (void) exfat_node_put(fn);
    14131413                async_answer_0(chandle, rc);
    14141414                return rc;
    14151415
    1416 miss:
     1416        miss:
    14171417                rc = exfat_directory_close(&di);
    14181418                if (rc != EOK)
     
    14231423                return rc != EOK ? rc : ENOENT;
    14241424
    1425 hit:
     1425        hit:
    14261426                pos = di.pos;
    14271427                rc = exfat_directory_close(&di);
Note: See TracChangeset for help on using the changeset viewer.