Changeset 1b20da0 in mainline for uspace/srv/fs/exfat


Ignore:
Timestamp:
2018-02-28T17:52:03Z (8 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3061bc1
Parents:
df6ded8
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:26:03)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:52:03)
Message:

style: Remove trailing whitespace on non-empty lines, in certain file types.

Command used: tools/srepl '\([^[:space:]]\)\s\+$' '\1' -- *.c *.h *.py *.sh *.s *.S *.ag

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

Legend:

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

    rdf6ded8 r1b20da0  
    3131/** @addtogroup fs
    3232 * @{
    33  */ 
     33 */
    3434
    3535/**
  • uspace/srv/fs/exfat/exfat.h

    rdf6ded8 r1b20da0  
    3030/** @addtogroup fs
    3131 * @{
    32  */ 
     32 */
    3333
    3434#ifndef EXFAT_EXFAT_H_
  • uspace/srv/fs/exfat/exfat_bitmap.c

    rdf6ded8 r1b20da0  
    4848
    4949
    50 errno_t exfat_bitmap_is_free(exfat_bs_t *bs, service_id_t service_id, 
     50errno_t exfat_bitmap_is_free(exfat_bs_t *bs, service_id_t service_id,
    5151    exfat_cluster_t clst)
    5252{
     
    8989}
    9090
    91 errno_t exfat_bitmap_set_cluster(exfat_bs_t *bs, service_id_t service_id, 
     91errno_t exfat_bitmap_set_cluster(exfat_bs_t *bs, service_id_t service_id,
    9292    exfat_cluster_t clst)
    9393{
     
    124124}
    125125
    126 errno_t exfat_bitmap_clear_cluster(exfat_bs_t *bs, service_id_t service_id, 
     126errno_t exfat_bitmap_clear_cluster(exfat_bs_t *bs, service_id_t service_id,
    127127    exfat_cluster_t clst)
    128128{
     
    160160}
    161161
    162 errno_t exfat_bitmap_set_clusters(exfat_bs_t *bs, service_id_t service_id, 
     162errno_t exfat_bitmap_set_clusters(exfat_bs_t *bs, service_id_t service_id,
    163163    exfat_cluster_t firstc, exfat_cluster_t count)
    164164{
     
    180180}
    181181
    182 errno_t exfat_bitmap_clear_clusters(exfat_bs_t *bs, service_id_t service_id, 
     182errno_t exfat_bitmap_clear_clusters(exfat_bs_t *bs, service_id_t service_id,
    183183    exfat_cluster_t firstc, exfat_cluster_t count)
    184184{
     
    196196}
    197197
    198 errno_t exfat_bitmap_alloc_clusters(exfat_bs_t *bs, service_id_t service_id, 
     198errno_t exfat_bitmap_alloc_clusters(exfat_bs_t *bs, service_id_t service_id,
    199199    exfat_cluster_t *firstc, exfat_cluster_t count)
    200200{
     
    217217
    218218
    219 errno_t exfat_bitmap_append_clusters(exfat_bs_t *bs, exfat_node_t *nodep, 
     219errno_t exfat_bitmap_append_clusters(exfat_bs_t *bs, exfat_node_t *nodep,
    220220    exfat_cluster_t count)
    221221{
    222222        if (nodep->firstc == 0) {
    223                 return exfat_bitmap_alloc_clusters(bs, nodep->idx->service_id, 
     223                return exfat_bitmap_alloc_clusters(bs, nodep->idx->service_id,
    224224                    &nodep->firstc, count);
    225225        } else {
     
    230230                while (exfat_bitmap_is_free(bs, nodep->idx->service_id, clst) == EOK) {
    231231                        if (clst - lastc == count){
    232                                 return exfat_bitmap_set_clusters(bs, nodep->idx->service_id, 
     232                                return exfat_bitmap_set_clusters(bs, nodep->idx->service_id,
    233233                                    lastc + 1, count);
    234234                        } else
     
    240240
    241241
    242 errno_t exfat_bitmap_free_clusters(exfat_bs_t *bs, exfat_node_t *nodep, 
     242errno_t exfat_bitmap_free_clusters(exfat_bs_t *bs, exfat_node_t *nodep,
    243243    exfat_cluster_t count)
    244244{
  • uspace/srv/fs/exfat/exfat_dentry.c

    rdf6ded8 r1b20da0  
    2929/** @addtogroup fs
    3030 * @{
    31  */ 
     31 */
    3232
    3333/**
     
    143143/**
    144144 * @}
    145  */ 
     145 */
  • uspace/srv/fs/exfat/exfat_dentry.h

    rdf6ded8 r1b20da0  
    2929/** @addtogroup fs
    3030 * @{
    31  */ 
     31 */
    3232
    3333#ifndef EXFAT_EXFAT_DENTRY_H_
     
    8282
    8383typedef struct {
    84         uint8_t         count; /* Always zero */ 
     84        uint8_t         count; /* Always zero */
    8585        uint16_t        checksum;
    8686        uint16_t        flags;
  • uspace/srv/fs/exfat/exfat_directory.c

    rdf6ded8 r1b20da0  
    2929/** @addtogroup fs
    3030 * @{
    31  */ 
     31 */
    3232
    3333/**
     
    6363{
    6464        exfat_directory_init(di);
    65         di->nodep = nodep;     
     65        di->nodep = nodep;
    6666        if (di->nodep->type != EXFAT_DIRECTORY)
    6767                return EINVAL;
     
    7676}
    7777
    78 errno_t exfat_directory_open_parent(exfat_directory_t *di, 
     78errno_t exfat_directory_open_parent(exfat_directory_t *di,
    7979    service_id_t service_id, exfat_cluster_t firstc, bool fragmented)
    8080{
     
    213213
    214214
    215 errno_t exfat_directory_read_file(exfat_directory_t *di, char *name, size_t size, 
     215errno_t exfat_directory_read_file(exfat_directory_t *di, char *name, size_t size,
    216216    exfat_file_dentry_t *df, exfat_stream_dentry_t *ds)
    217217{
     
    232232        if (rc != EOK)
    233233                return rc;
    234         rc = exfat_directory_get(di, &d); 
     234        rc = exfat_directory_get(di, &d);
    235235        if (rc != EOK)
    236236                return rc;
     
    246246                if (rc != EOK)
    247247                        return rc;
    248                 rc = exfat_directory_get(di, &d); 
     248                rc = exfat_directory_get(di, &d);
    249249                if (rc != EOK)
    250250                        return rc;
     
    303303}
    304304
    305 errno_t exfat_directory_sync_file(exfat_directory_t *di, exfat_file_dentry_t *df, 
     305errno_t exfat_directory_sync_file(exfat_directory_t *di, exfat_file_dentry_t *df,
    306306    exfat_stream_dentry_t *ds)
    307307{
     
    388388
    389389        uctable_chars = ALIGN_DOWN(uctablep->size,
    390             sizeof(uint16_t)) / sizeof(uint16_t); 
     390            sizeof(uint16_t)) / sizeof(uint16_t);
    391391        uctable = (uint16_t *) malloc(uctable_chars * sizeof(uint16_t));
    392392        rc = exfat_read_uctable(di->bs, uctablep, (uint8_t *)uctable);
     
    403403        ds.stream.data_size = 0;
    404404        ds.stream.name_size = utf16_wsize(wname);
    405         ds.stream.hash = host2uint16_t_le(exfat_name_hash(wname, uctable, 
     405        ds.stream.hash = host2uint16_t_le(exfat_name_hash(wname, uctable,
    406406            uctable_chars));
    407407
     
    409409        df.type = EXFAT_TYPE_FILE;
    410410        df.file.attr = 0;
    411         df.file.count = ROUND_UP(ds.stream.name_size, EXFAT_NAME_PART_LEN) / 
     411        df.file.count = ROUND_UP(ds.stream.name_size, EXFAT_NAME_PART_LEN) /
    412412            EXFAT_NAME_PART_LEN + 1;
    413413        df.file.checksum = 0;
     
    553553                                }
    554554                        }
    555                 } while (exfat_directory_next(di) == EOK);     
     555                } while (exfat_directory_next(di) == EOK);
    556556        } while (exfat_directory_expand(di) == EOK);
    557557        return ENOSPC;
     
    561561/**
    562562 * @}
    563  */ 
     563 */
  • uspace/srv/fs/exfat/exfat_fat.c

    rdf6ded8 r1b20da0  
    7474 */
    7575errno_t
    76 exfat_cluster_walk(exfat_bs_t *bs, service_id_t service_id, 
     76exfat_cluster_walk(exfat_bs_t *bs, service_id_t service_id,
    7777    exfat_cluster_t firstc, exfat_cluster_t *lastc, uint32_t *numc,
    7878    uint32_t max_clusters)
     
    141141                         * when fortunately we have the last cluster number cached.
    142142                         */
    143                         return block_get(block, nodep->idx->service_id, DATA_FS(bs) + 
    144                         (nodep->lastc_cached_value-EXFAT_CLST_FIRST)*SPC(bs) + 
     143                        return block_get(block, nodep->idx->service_id, DATA_FS(bs) +
     144                        (nodep->lastc_cached_value-EXFAT_CLST_FIRST)*SPC(bs) +
    145145                            (bn % SPC(bs)), flags);
    146146                }
     
    187187 */
    188188errno_t
    189 exfat_block_get_by_clst(block_t **block, exfat_bs_t *bs, 
     189exfat_block_get_by_clst(block_t **block, exfat_bs_t *bs,
    190190    service_id_t service_id, bool fragmented, exfat_cluster_t fcl,
    191191    exfat_cluster_t *clp, aoff64_t bn, int flags)
     
    200200
    201201        if (!fragmented) {
    202                 rc = block_get(block, service_id, DATA_FS(bs) + 
     202                rc = block_get(block, service_id, DATA_FS(bs) +
    203203                    (fcl - EXFAT_CLST_FIRST)*SPC(bs) + bn, flags);
    204204        } else {
     
    209209                assert(clusters == max_clusters);
    210210
    211                 rc = block_get(block, service_id, DATA_FS(bs) + 
     211                rc = block_get(block, service_id, DATA_FS(bs) +
    212212                    (c - EXFAT_CLST_FIRST) * SPC(bs) + (bn % SPC(bs)), flags);
    213213
  • uspace/srv/fs/exfat/exfat_idx.c

    rdf6ded8 r1b20da0  
    2929/** @addtogroup fs
    3030 * @{
    31  */ 
     31 */
    3232
    3333/**
     
    9292
    9393        list_foreach(unused_list, link, unused_t, u) {
    94                 if (u->service_id == service_id) 
     94                if (u->service_id == service_id)
    9595                        return u;
    9696        }
     
    108108 * The index structures are hashed by the service_id, parent node's first
    109109 * cluster and index within the parent directory.
    110  */ 
     110 */
    111111static hash_table_t up_hash;
    112112
     
    211211        u = unused_find(service_id, true);
    212212        if (!u)
    213                 return false;   
     213                return false;
    214214
    215215        if (list_empty(&u->freed_list)) {
    216                 if (u->remaining) { 
     216                if (u->remaining) {
    217217                        /*
    218218                         * There are no freed indices, allocate one directly
     
    333333
    334334        fidx = (exfat_idx_t *) malloc(sizeof(exfat_idx_t));
    335         if (!fidx) 
     335        if (!fidx)
    336336                return ENOMEM;
    337337        if (!exfat_index_alloc(service_id, &fidx->index)) {
     
    470470errno_t exfat_idx_init(void)
    471471{
    472         if (!hash_table_create(&up_hash, 0, 0, &uph_ops)) 
     472        if (!hash_table_create(&up_hash, 0, 0, &uph_ops))
    473473                return ENOMEM;
    474474        if (!hash_table_create(&ui_hash, 0, 0, &uih_ops)) {
     
    536536         * Remove this instance's index structure from up_hash and ui_hash.
    537537         * Process up_hash first and ui_hash second because the index structure
    538          * is actually removed in idx_remove_callback(). 
     538         * is actually removed in idx_remove_callback().
    539539         */
    540540        fibril_mutex_lock(&used_lock);
     
    557557                free(f);
    558558        }
    559         free(u); 
     559        free(u);
    560560}
    561561
    562562/**
    563563 * @}
    564  */ 
     564 */
  • uspace/srv/fs/exfat/exfat_ops.c

    rdf6ded8 r1b20da0  
    139139        ds.data_size = node->size;
    140140
    141         exfat_directory_open_parent(&di, node->idx->service_id, node->idx->pfc, 
     141        exfat_directory_open_parent(&di, node->idx->service_id, node->idx->pfc,
    142142            node->idx->parent_fragmented);
    143143        rc = exfat_directory_seek(&di, node->idx->pdi);
     
    269269}
    270270
    271 static errno_t exfat_node_get_new_by_pos(exfat_node_t **nodepp, 
     271static errno_t exfat_node_get_new_by_pos(exfat_node_t **nodepp,
    272272    service_id_t service_id, exfat_cluster_t pfc, unsigned pdi)
    273273{
     
    320320                return rc;
    321321
    322         exfat_directory_open_parent(&di, idxp->service_id, idxp->pfc, 
     322        exfat_directory_open_parent(&di, idxp->service_id, idxp->pfc,
    323323            idxp->parent_fragmented);
    324324        rc = exfat_directory_seek(&di, idxp->pdi);
     
    338338        case EXFAT_DENTRY_FILE:
    339339                nodep->type =
    340                     (uint16_t_le2host(d->file.attr) & EXFAT_ATTR_SUBDIR) ? 
     340                    (uint16_t_le2host(d->file.attr) & EXFAT_ATTR_SUBDIR) ?
    341341                    EXFAT_DIRECTORY : EXFAT_FILE;
    342342                rc = exfat_directory_next(&di);
     
    708708                                nodep->firstc);
    709709                else
    710                         rc = exfat_bitmap_free_clusters(bs, nodep, 
     710                        rc = exfat_bitmap_free_clusters(bs, nodep,
    711711                            ROUND_UP(nodep->size, BPC(bs)) / BPC(bs));
    712         } 
     712        }
    713713
    714714        exfat_idx_destroy(nodep->idx);
     
    10601060
    10611061        /* Initialize the root node. */
    1062         rc = exfat_node_get_new_by_pos(&rootp, service_id, EXFAT_ROOT_PAR, 
     1062        rc = exfat_node_get_new_by_pos(&rootp, service_id, EXFAT_ROOT_PAR,
    10631063            EXFAT_ROOT_POS);
    10641064        if (rc!=EOK) {
     
    11101110        }
    11111111
    1112         rc = exfat_node_get_new_by_pos(&bitmapp, service_id, rootp->firstc, 
     1112        rc = exfat_node_get_new_by_pos(&bitmapp, service_id, rootp->firstc,
    11131113            di.pos);
    11141114        if (rc != EOK) {
     
    11511151        }
    11521152
    1153         rc = exfat_node_get_new_by_pos(&uctablep, service_id, rootp->firstc, 
     1153        rc = exfat_node_get_new_by_pos(&uctablep, service_id, rootp->firstc,
    11541154            di.pos);
    11551155        if (rc != EOK) {
Note: See TracChangeset for help on using the changeset viewer.