Changeset 44c6091f in mainline


Ignore:
Timestamp:
2011-04-30T12:24:14Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fdc05ca
Parents:
8a49fed
Message:

cstyle

Location:
uspace/srv/fs/minixfs
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/minixfs/mfs.c

    r8a49fed r44c6091f  
    5252        .name = NAME,
    5353        .concurrent_read_write = false,
    54         .write_retains_size = false,   
     54        .write_retains_size = false,
    5555};
    5656
     
    7070 * phone for more serialized requests. Similarily, MinixFS can refuse to duplicate
    7171 * the connection. VFS should then just make use of already existing phones and
    72  * route its requests through them. To avoid paying the fibril creation price 
     72 * route its requests through them. To avoid paying the fibril creation price
    7373 * upon each request, MinixFS might want to keep the connections open after the
    7474 * request has been completed.
     
    8585                async_answer_0(iid, EOK);
    8686        }
    87        
     87
    8888        printf(NAME ": connection opened\n");
    8989        while (1) {
    9090                ipc_callid_t callid;
    9191                ipc_call_t call;
    92        
     92
    9393                callid = async_get_call(&call);
    9494                int method = IPC_GET_IMETHOD(call);
     
    150150        if (rc != EOK)
    151151                goto err;
    152        
     152
    153153        printf(NAME ": Accepting connections\n");
    154154        task_retval(0);
     
    164164/**
    165165 * @}
    166  */ 
     166 */
    167167
  • uspace/srv/fs/minixfs/mfs_balloc.c

    r8a49fed r44c6091f  
    3737static int
    3838find_free_bit_and_set(bitchunk_t *b, const int bsize,
    39                                 const bool native, unsigned start_bit);
     39                      const bool native, unsigned start_bit);
    4040
    4141int
     
    5555                if (idx > sbi->nzones) {
    5656                        printf(NAME ": Error! Trying to free beyond the" \
    57                                         "bitmap max size\n");
     57                               "bitmap max size\n");
    5858                        return -1;
    5959                }
     
    6363                if (idx > sbi->ninodes) {
    6464                        printf(NAME ": Error! Trying to free beyond the" \
    65                                         "bitmap max size\n");
     65                               "bitmap max size\n");
    6666                        return -1;
    6767                }
     
    124124        for (i = *search / bits_per_block; i < nblocks; ++i) {
    125125                r = block_get(&b, inst->handle, i + start_block,
    126                                 BLOCK_FLAGS_NONE);
     126                              BLOCK_FLAGS_NONE);
    127127
    128128                on_error(r, goto out);
     
    168168static int
    169169find_free_bit_and_set(bitchunk_t *b, const int bsize,
    170                                 const bool native, unsigned start_bit)
     170                      const bool native, unsigned start_bit)
    171171{
    172172        int r = -1;
     
    176176
    177177        for (i = start_bit / sizeof(uint32_t);
    178                                 i < bsize / sizeof(uint32_t); ++i) {
     178             i < bsize / sizeof(uint32_t); ++i) {
    179179                if (!(~b[i])) {
    180180                        /*No free bit in this chunk*/
     
    200200/**
    201201 * @}
    202  */ 
    203 
     202 */
     203
  • uspace/srv/fs/minixfs/mfs_dentry.c

    r8a49fed r44c6091f  
    3636int
    3737read_directory_entry(struct mfs_node *mnode,
    38                         struct mfs_dentry_info **d_info, unsigned index)
     38                     struct mfs_dentry_info **d_info, unsigned index)
    3939{
    4040        const struct mfs_instance *inst = mnode->instance;
     
    7676        } else {
    7777                const int namelen = longnames ? MFS_L_MAX_NAME_LEN :
    78                                         MFS_MAX_NAME_LEN;
     78                                    MFS_MAX_NAME_LEN;
    7979
    8080                struct mfs_dentry *d;
    8181
    8282                d = b->data + dentry_off * (longnames ? MFSL_DIRSIZE :
    83                                                         MFS_DIRSIZE);
     83                                            MFS_DIRSIZE);
    8484                (*d_info)->d_inum = conv16(sbi->native, d->d_inum);
    8585                memcpy((*d_info)->d_name, d->d_name, namelen);
     
    202202/**
    203203 * @}
    204  */ 
    205 
     204 */
     205
  • uspace/srv/fs/minixfs/mfs_inode.c

    r8a49fed r44c6091f  
    5050int
    5151get_inode(struct mfs_instance *inst, struct mfs_ino_info **ino_i,
    52                                 fs_index_t index)
     52          fs_index_t index)
    5353{
    5454        struct mfs_sb_info *sbi = inst->sbi;
     
    6969
    7070static struct mfs_ino_info *
    71 mfs_read_inode_raw(const struct mfs_instance *instance, uint16_t inum)
    72 {
     71mfs_read_inode_raw(const struct mfs_instance *instance, uint16_t inum) {
    7372        struct mfs_inode *ino = NULL;
    7473        struct mfs_ino_info *ino_i = NULL;
     
    9594
    9695        if (block_get(&b, instance->handle,
    97                         itable_off + inum / sbi->ino_per_block,
    98                         BLOCK_FLAGS_NONE) != EOK)
     96                      itable_off + inum / sbi->ino_per_block,
     97                      BLOCK_FLAGS_NONE) != EOK)
    9998                goto out_err;
    10099
     
    128127
    129128static struct mfs_ino_info *
    130 mfs2_read_inode_raw(const struct mfs_instance *instance, uint32_t inum)
    131 {
     129mfs2_read_inode_raw(const struct mfs_instance *instance, uint32_t inum) {
    132130        struct mfs2_inode *ino = NULL;
    133131        struct mfs_ino_info *ino_i = NULL;
     
    153151        const int ino_off = inum % sbi->ino_per_block;
    154152
    155         if (block_get(&b, instance->handle, 
    156                 itable_off + inum / sbi->ino_per_block,
    157                         BLOCK_FLAGS_NONE) != EOK)
     153        if (block_get(&b, instance->handle,
     154                      itable_off + inum / sbi->ino_per_block,
     155                      BLOCK_FLAGS_NONE) != EOK)
    158156                goto out_err;
    159157
     
    228226
    229227        r = block_get(&b, mnode->instance->handle,
    230                                 itable_off + inum / sbi->ino_per_block,
    231                                 BLOCK_FLAGS_NONE);
     228                      itable_off + inum / sbi->ino_per_block,
     229                      BLOCK_FLAGS_NONE);
    232230
    233231        on_error(r, goto out);
     
    268266        const int ino_off = inum % sbi->ino_per_block;
    269267        const bool native = sbi->native;
    270        
     268
    271269        r = block_get(&b, mnode->instance->handle,
    272                                 itable_off + inum / sbi->ino_per_block,
    273                                 BLOCK_FLAGS_NONE);
     270                      itable_off + inum / sbi->ino_per_block,
     271                      BLOCK_FLAGS_NONE);
    274272
    275273        on_error(r, goto out);
     
    282280        ino2->i_uid = conv16(native, ino_i->i_uid);
    283281        ino2->i_gid = conv16(native, ino_i->i_gid);
    284         ino2->i_size = conv32(native, ino_i->i_size);   
     282        ino2->i_size = conv32(native, ino_i->i_size);
    285283        ino2->i_atime = conv32(native, ino_i->i_atime);
    286284        ino2->i_mtime = conv32(native, ino_i->i_mtime);
     
    389387                block_t *b;
    390388                r = block_get(&b, mnode->instance->handle, new_zone,
    391                                                 BLOCK_FLAGS_NOREAD);
     389                              BLOCK_FLAGS_NOREAD);
    392390                on_error(r, return r);
    393391
     
    397395
    398396                r = write_map(mnode, (start_zone + i) * bs,
    399                                 new_zone, &dummy);
     397                              new_zone, &dummy);
    400398
    401399                on_error(r, return r);
     
    413411/**
    414412 * @}
    415  */ 
    416 
     413 */
     414
  • uspace/srv/fs/minixfs/mfs_ops.c

    r8a49fed r44c6091f  
    3838
    3939static bool check_magic_number(uint16_t magic, bool *native,
    40                                 mfs_version_t *version, bool *longfilenames);
     40                               mfs_version_t *version, bool *longfilenames);
    4141static int mfs_node_core_get(fs_node_t **rfn, struct mfs_instance *inst,
    42                         fs_index_t index);
     42                             fs_index_t index);
    4343
    4444static int mfs_node_put(fs_node_t *fsnode);
     
    8585{
    8686        devmap_handle_t devmap_handle = (devmap_handle_t) IPC_GET_ARG1(*request);
    87         enum cache_mode cmode; 
     87        enum cache_mode cmode;
    8888        struct mfs_superblock *sb;
    8989        struct mfs3_superblock *sb3;
     
    9797        char *opts;
    9898        int rc = async_data_write_accept((void **) &opts, true, 0, 0, 0, NULL);
    99        
     99
    100100        if (rc != EOK) {
    101101                mfsdebug("Can't accept async data write\n");
     
    212212                sbi->dirsize = longnames ? MFSL_DIRSIZE : MFS_DIRSIZE;
    213213                sbi->max_name_len = longnames ? MFS_L_MAX_NAME_LEN :
    214                                 MFS_MAX_NAME_LEN;
     214                                    MFS_MAX_NAME_LEN;
    215215        }
    216216        sbi->itable_off = 2 + sbi->ibmap_blocks + sbi->zbmap_blocks;
    217  
     217
    218218        free(sb);
    219219
     
    259259        fs_node_t *fsnode;
    260260        uint32_t inum;
    261        
     261
    262262        mfsdebug("create_node()\n");
    263263
     
    287287                goto out_err_1;
    288288        }
    289        
     289
    290290        fsnode = malloc(sizeof(fs_node_t));
    291291        if (!fsnode) {
     
    365365                        /*Hit!*/
    366366                        mfs_node_core_get(rfn, mnode->instance,
    367                                 d_info->d_inum);
     367                                          d_info->d_inum);
    368368                        free(d_info);
    369369                        goto found;
     
    445445
    446446static int mfs_node_core_get(fs_node_t **rfn, struct mfs_instance *inst,
    447                         fs_index_t index)
     447                             fs_index_t index)
    448448{
    449449        fs_node_t *node = NULL;
     
    546546
    547547        struct mfs_dentry_info *d_info;
    548        
     548
    549549        /* The first two dentries are always . and .. */
    550550        int i = 2;
     
    586586        fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
    587587        aoff64_t pos = (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request),
    588                                 IPC_GET_ARG4(*request));
     588                                               IPC_GET_ARG4(*request));
    589589        fs_node_t *fn;
    590590
     
    643643found:
    644644                async_data_read_finalize(callid, d_info->d_name,
    645                                 str_size(d_info->d_name) + 1);
     645                                         str_size(d_info->d_name) + 1);
    646646                bytes = ((pos - spos) + 1);
    647647        } else {
     
    673673                        memset(buf, 0, sizeof(sbi->block_size));
    674674                        async_data_read_finalize(callid,
    675                             buf + pos % sbi->block_size, bytes);
     675                                                buf + pos % sbi->block_size, bytes);
    676676                        free(buf);
    677677                        goto out_success;
     
    682682
    683683                async_data_read_finalize(callid, b->data +
    684                                 pos % sbi->block_size, bytes);
     684                                         pos % sbi->block_size, bytes);
    685685
    686686                rc = block_put(b);
     
    695695        async_answer_1(rid, rc, (sysarg_t)bytes);
    696696        return;
    697 out_error: ;
     697out_error:
     698        ;
    698699        int tmp = mfs_node_put(fn);
    699700        async_answer_0(callid, tmp != EOK ? tmp : rc);
     
    709710        fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
    710711        aoff64_t pos = (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request),
    711                                                 IPC_GET_ARG4(*request));
     712                                               IPC_GET_ARG4(*request));
    712713
    713714        fs_node_t *fn;
     
    835836        for (link = inst_list.next; link != &inst_list; link = link->next) {
    836837                instance_ptr = list_get_instance(link, struct mfs_instance,
    837                                 link);
    838                
     838                                                 link);
     839
    839840                if (instance_ptr->handle == handle) {
    840841                        *instance = instance_ptr;
     
    851852
    852853static bool check_magic_number(uint16_t magic, bool *native,
    853                                 mfs_version_t *version, bool *longfilenames)
     854                               mfs_version_t *version, bool *longfilenames)
    854855{
    855856        bool rc = true;
     
    893894/**
    894895 * @}
    895  */ 
    896 
     896 */
     897
  • uspace/srv/fs/minixfs/mfs_rw.c

    r8a49fed r44c6091f  
    3636static int
    3737rw_map_ondisk(uint32_t *b, const struct mfs_node *mnode, int rblock,
    38                                 bool write_mode, uint32_t w_block);
     38              bool write_mode, uint32_t w_block);
    3939
    4040static int
     
    7979
    8080int
    81 write_map(struct mfs_node *mnode, const uint32_t pos, uint32_t new_zone, 
    82                                 uint32_t *old_zone)
     81write_map(struct mfs_node *mnode, const uint32_t pos, uint32_t new_zone,
     82          uint32_t *old_zone)
    8383{
    8484        const struct mfs_sb_info *sbi = mnode->instance->sbi;
     
    108108static int
    109109rw_map_ondisk(uint32_t *b, const struct mfs_node *mnode, int rblock,
    110                                 bool write_mode, uint32_t w_block)
     110              bool write_mode, uint32_t w_block)
    111111{
    112112        int r, nr_direct;
     
    276276        block_t *b;
    277277        const int max_ind_zone_ptrs = (MFS_MAX_BLOCKSIZE / sizeof(uint16_t)) *
    278                                 sizeof(uint32_t);
     278                                      sizeof(uint32_t);
    279279
    280280        *ind_zone = malloc(max_ind_zone_ptrs);
     
    301301
    302302        block_put(b);
    303        
     303
    304304        return EOK;
    305305}
     
    337337/**
    338338 * @}
    339  */ 
    340 
     339 */
     340
  • uspace/srv/fs/minixfs/mfs_utils.c

    r8a49fed r44c6091f  
    6161/**
    6262 * @}
    63  */ 
     63 */
    6464
  • uspace/srv/fs/minixfs/mfs_utils.h

    r8a49fed r44c6091f  
    5151/**
    5252 * @}
    53  */ 
     53 */
    5454
Note: See TracChangeset for help on using the changeset viewer.