Changeset 0dbe5ac in mainline for uspace/srv/fs/exfat/exfat_fat.c


Ignore:
Timestamp:
2011-08-26T21:19:24Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5d95f02
Parents:
ff0c270
Message:

Cstyle.

File:
1 edited

Legend:

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

    rff0c270 r0dbe5ac  
    135135        if (nodep->fragmented) {
    136136                if (((((nodep->size - 1) / BPS(bs)) / SPC(bs)) == bn / SPC(bs)) &&
    137                         nodep->lastc_cached_valid) {
    138                                 /*
    139                         * This is a request to read a block within the last cluster
    140                         * when fortunately we have the last cluster number cached.
    141                         */
     137                    nodep->lastc_cached_valid) {
     138                        /*
     139                         * This is a request to read a block within the last cluster
     140                         * when fortunately we have the last cluster number cached.
     141                         */
    142142                        return block_get(block, nodep->idx->service_id, DATA_FS(bs) +
    143143                        (nodep->lastc_cached_value-EXFAT_CLST_FIRST)*SPC(bs) +
     
    195195        int rc;
    196196
    197         if (fcl < EXFAT_CLST_FIRST || fcl > DATA_CNT(bs)+2)
     197        if (fcl < EXFAT_CLST_FIRST || fcl > DATA_CNT(bs) + 2)
    198198                return ELIMIT;
    199199
    200200        if (!fragmented) {
    201201                rc = block_get(block, service_id, DATA_FS(bs) +
    202                     (fcl-EXFAT_CLST_FIRST)*SPC(bs) + bn, flags);
     202                    (fcl - EXFAT_CLST_FIRST)*SPC(bs) + bn, flags);
    203203        } else {
    204204                max_clusters = bn / SPC(bs);
     
    209209
    210210                rc = block_get(block, service_id, DATA_FS(bs) +
    211                     (c-EXFAT_CLST_FIRST)*SPC(bs) + (bn % SPC(bs)), flags);
     211                    (c - EXFAT_CLST_FIRST) * SPC(bs) + (bn % SPC(bs)), flags);
    212212
    213213                if (clp)
     
    310310
    311311        fibril_mutex_lock(&exfat_alloc_lock);
    312         for (clst=EXFAT_CLST_FIRST; clst < DATA_CNT(bs)+2 && found < nclsts; clst++) {
     312        for (clst = EXFAT_CLST_FIRST; clst < DATA_CNT(bs) + 2 && found < nclsts;
     313            clst++) {
    313314                /* Need to rewrite because of multiple exfat_bitmap_get calls */
    314                 if (bitmap_is_free(bs, service_id, clst)==EOK) {
    315                    /*
    316                         * The cluster is free. Put it into our stack
    317                         * of found clusters and mark it as non-free.
    318                         */
     315                if (bitmap_is_free(bs, service_id, clst) == EOK) {
     316                        /*
     317                         * The cluster is free. Put it into our stack
     318                         * of found clusters and mark it as non-free.
     319                         */
    319320                        lifo[found] = clst;
    320321                        rc = exfat_set_cluster(bs, service_id, clst,
    321                                 (found == 0) ?  EXFAT_CLST_EOF : lifo[found - 1]);
     322                            (found == 0) ?  EXFAT_CLST_EOF : lifo[found - 1]);
    322323                        if (rc != EOK)
    323324                                break;
     
    339340
    340341        /* If something wrong - free the clusters */
    341         if (found > 0) {
    342                 while (found--) {
    343                         (void) bitmap_clear_cluster(bs, service_id, lifo[found]);
    344                         (void) exfat_set_cluster(bs, service_id, lifo[found], 0);
    345                 }
     342        while (found--) {
     343                (void) bitmap_clear_cluster(bs, service_id, lifo[found]);
     344                (void) exfat_set_cluster(bs, service_id, lifo[found], 0);
    346345        }
    347346
     
    490489
    491490        for (i = 0; i < SPC(bs); i++) {
    492                 rc = exfat_block_get_by_clst(&b, bs, service_id, false, c, NULL, i,
    493                     BLOCK_FLAGS_NOREAD);
     491                rc = exfat_block_get_by_clst(&b, bs, service_id, false, c, NULL,
     492                    i, BLOCK_FLAGS_NOREAD);
    494493                if (rc != EOK)
    495494                        return rc;
     
    517516                if (rc != EOK)
    518517                        return rc;
    519                 if (i == blocks-1)
    520                         count = nodep->size - i*BPS(bs);
     518                if (i == blocks - 1)
     519                        count = nodep->size - i * BPS(bs);
    521520                memcpy(uctable, b->data, count);
    522521                uctable += count;
Note: See TracChangeset for help on using the changeset viewer.