Changeset 0dbe5ac in mainline for uspace/srv/fs/exfat/exfat_ops.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_ops.c

    rff0c270 r0dbe5ac  
    3434/**
    3535 * @file        exfat_ops.c
    36  * @brief       Implementation of VFS operations for the exFAT file system server.
     36 * @brief       Implementation of VFS operations for the exFAT file system
     37 *              server.
    3738 */
    3839
     
    335336        switch (exfat_classify_dentry(d)) {
    336337        case EXFAT_DENTRY_FILE:
    337                 nodep->type = (uint16_t_le2host(d->file.attr) & EXFAT_ATTR_SUBDIR)?
     338                nodep->type =
     339                    (uint16_t_le2host(d->file.attr) & EXFAT_ATTR_SUBDIR) ?
    338340                    EXFAT_DIRECTORY : EXFAT_FILE;
    339341                rc = exfat_directory_next(&di);
     
    395397}
    396398
    397 int exfat_node_expand(service_id_t service_id, exfat_node_t *nodep, exfat_cluster_t clusters)
     399int exfat_node_expand(service_id_t service_id, exfat_node_t *nodep,
     400    exfat_cluster_t clusters)
    398401{
    399402        exfat_bs_t *bs;
     
    439442}
    440443
    441 static int exfat_node_shrink(service_id_t service_id, exfat_node_t *nodep, aoff64_t size)
     444static int exfat_node_shrink(service_id_t service_id, exfat_node_t *nodep,
     445    aoff64_t size)
    442446{
    443447        exfat_bs_t *bs;
     
    505509{
    506510        exfat_node_t *parentp = EXFAT_NODE(pfn);
    507         char name[EXFAT_FILENAME_LEN+1];
     511        char name[EXFAT_FILENAME_LEN + 1];
    508512        exfat_file_dentry_t df;
    509513        exfat_stream_dentry_t ds;
     
    520524                return rc;
    521525
    522         while (exfat_directory_read_file(&di, name, EXFAT_FILENAME_LEN,
    523             &df, &ds) == EOK) {
     526        while (exfat_directory_read_file(&di, name, EXFAT_FILENAME_LEN, &df,
     527            &ds) == EOK) {
    524528                if (stricmp(name, component) == 0) {
    525529                        /* hit */
    526530                        exfat_node_t *nodep;
    527                         aoff64_t o = di.pos % (BPS(di.bs) / sizeof(exfat_dentry_t));
     531                        aoff64_t o = di.pos %
     532                            (BPS(di.bs) / sizeof(exfat_dentry_t));
    528533                        exfat_idx_t *idx = exfat_idx_get_by_pos(service_id,
    529534                                parentp->firstc, di.bnum * DPS(di.bs) + o);
     
    734739         */
    735740        rc = exfat_directory_write_file(&di, name);
    736         if (rc!=EOK)
     741        if (rc != EOK)
    737742                return rc;
    738743        rc = exfat_directory_close(&di);
    739         if (rc!=EOK)
     744        if (rc != EOK)
    740745                return rc;
    741746
     
    962967{
    963968        int rc;
    964         exfat_node_t *rootp=NULL, *bitmapp=NULL, *uctablep=NULL;
     969        exfat_node_t *rootp = NULL, *bitmapp = NULL, *uctablep = NULL;
    965970        enum cache_mode cmode;
    966971        exfat_bs_t *bs;
     
    10621067        rc = exfat_node_get_new_by_pos(&bitmapp, service_id, rootp->firstc,
    10631068            di.pos);
    1064         if (rc!=EOK) {
     1069        if (rc != EOK) {
    10651070                free(rootp);
    10661071                (void) block_cache_fini(service_id);
     
    11031108        rc = exfat_node_get_new_by_pos(&uctablep, service_id, rootp->firstc,
    11041109            di.pos);
    1105         if (rc!=EOK) {
     1110        if (rc != EOK) {
    11061111                free(rootp);
    11071112                free(bitmapp);
     
    11231128
    11241129        rc = exfat_directory_close(&di);
    1125         if (rc!=EOK) {
     1130        if (rc != EOK) {
    11261131                free(rootp);
    11271132                free(bitmapp);
     
    11881193        exfat_node_t *nodep;
    11891194        exfat_bs_t *bs;
    1190         size_t bytes=0;
     1195        size_t bytes = 0;
    11911196        block_t *b;
    11921197        int rc;
     
    12441249                       
    12451250                aoff64_t spos = pos;
    1246                 char name[EXFAT_FILENAME_LEN+1];
     1251                char name[EXFAT_FILENAME_LEN + 1];
    12471252                exfat_file_dentry_t df;
    12481253                exfat_stream_dentry_t ds;
     
    12601265                }
    12611266
    1262                 rc = exfat_directory_read_file(&di, name, EXFAT_FILENAME_LEN, &df, &ds);
    1263                 if (rc == EOK) goto hit;
    1264                 if (rc == ENOENT) goto miss;
     1267                rc = exfat_directory_read_file(&di, name, EXFAT_FILENAME_LEN,
     1268                    &df, &ds);
     1269                if (rc == EOK)
     1270                    goto hit;
     1271                if (rc == ENOENT)
     1272                    goto miss;
    12651273
    12661274err:
     
    12811289                pos = di.pos;
    12821290                rc = exfat_directory_close(&di);
    1283                 if (rc!=EOK)
     1291                if (rc != EOK)
    12841292                        goto err;
    1285                 (void) async_data_read_finalize(callid, name, str_size(name) + 1);
    1286                 bytes = (pos - spos)+1;
     1293                (void) async_data_read_finalize(callid, name,
     1294                    str_size(name) + 1);
     1295                bytes = (pos - spos) + 1;
    12871296        }
    12881297
     
    13951404                return rc;
    13961405        }
    1397 
    13981406
    13991407        *wbytes = bytes;
     
    14771485};
    14781486
    1479 
    14801487/**
    14811488 * @}
Note: See TracChangeset for help on using the changeset viewer.