Changeset 6d4d883 in mainline


Ignore:
Timestamp:
2011-10-14T19:39:02Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2ac7af3
Parents:
9269c88
Message:

cstyle

Location:
uspace/srv/fs/mfs
Files:
7 edited

Legend:

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

    r9269c88 r6d4d883  
    7474
    7575        async_sess_t *vfs_sess = service_connect_blocking(EXCHANGE_SERIALIZE,
    76                                 SERVICE_VFS, 0, 0);
     76            SERVICE_VFS, 0, 0);
    7777
    7878        if (!vfs_sess) {
  • uspace/srv/fs/mfs/mfs_balloc.c

    r9269c88 r6d4d883  
    3636static int
    3737find_free_bit_and_set(bitchunk_t *b, const int bsize,
    38                       const bool native, unsigned start_bit);
     38    const bool native, unsigned start_bit);
    3939
    4040static int
     
    129129                if (idx > sbi->nzones) {
    130130                        printf(NAME ": Error! Trying to free beyond the" \
    131                                "bitmap max size\n");
     131                            "bitmap max size\n");
    132132                        return -1;
    133133                }
    134134        } else {
    135                 /*bid == BMAP_INODE*/
     135                /* bid == BMAP_INODE */
    136136                search = &sbi->isearch;
    137137                start_block = 2;
    138138                if (idx > sbi->ninodes) {
    139139                        printf(NAME ": Error! Trying to free beyond the" \
    140                                "bitmap max size\n");
     140                            "bitmap max size\n");
    141141                        return -1;
    142142                }
    143143        }
    144144
    145         /*Compute the bitmap block*/
     145        /* Compute the bitmap block */
    146146        uint32_t block = idx / (sbi->block_size * 8) + start_block;
    147147
     
    150150                goto out_err;
    151151
    152         /*Compute the bit index in the block*/
     152        /* Compute the bit index in the block */
    153153        idx %= (sbi->block_size * 8);
    154154        bitchunk_t *ptr = b->data;
     
    220220
    221221                freebit = find_free_bit_and_set(b->data, sbi->block_size,
    222                                                 sbi->native, tmp);
     222                    sbi->native, tmp);
    223223                if (freebit == -1) {
    224                         /*No free bit in this block*/
     224                        /* No free bit in this block */
    225225                        r = block_put(b);
    226226                        if (r != EOK)
     
    229229                }
    230230
    231                 /*Free bit found in this block, compute the real index*/
     231                /* Free bit found in this block, compute the real index */
    232232                *idx = freebit + bits_per_block * i;
    233233                if (*idx > limit) {
    234                         /*Index is beyond the limit, it is invalid*/
     234                        /* Index is beyond the limit, it is invalid */
    235235                        r = block_put(b);
    236236                        if (r != EOK)
     
    246246
    247247        if (*search > 0) {
    248                 /*Repeat the search from the first bitmap block*/
     248                /* Repeat the search from the first bitmap block */
    249249                *search = 0;
    250250                goto retry;
    251251        }
    252252
    253         /*Free bit not found, return error*/
     253        /* Free bit not found, return error */
    254254        return ENOSPC;
    255255
     
    260260static int
    261261find_free_bit_and_set(bitchunk_t *b, const int bsize,
    262                       const bool native, unsigned start_bit)
     262    const bool native, unsigned start_bit)
    263263{
    264264        int r = -1;
     
    268268
    269269        for (i = start_bit / chunk_bits;
    270              i < bsize / sizeof(bitchunk_t); ++i) {
     270            i < bsize / sizeof(bitchunk_t); ++i) {
     271
    271272                if (!(~b[i])) {
    272                         /*No free bit in this chunk*/
     273                        /* No free bit in this chunk */
    273274                        continue;
    274275                }
  • uspace/srv/fs/mfs/mfs_dentry.c

    r9269c88 r6d4d883  
    4444int
    4545mfs_read_dentry(struct mfs_node *mnode,
    46                      struct mfs_dentry_info *d_info, unsigned index)
     46    struct mfs_dentry_info *d_info, unsigned index)
    4747{
    4848        const struct mfs_instance *inst = mnode->instance;
     
    5757
    5858        if (block == 0) {
    59                 /*End of the dentries list*/
     59                /* End of the dentries list */
    6060                r = EOK;
    6161                goto out_err;
     
    7979        } else {
    8080                const int namelen = longnames ? MFS_L_MAX_NAME_LEN :
    81                                     MFS_MAX_NAME_LEN;
     81                    MFS_MAX_NAME_LEN;
    8282
    8383                struct mfs_dentry *d;
    8484
    8585                d = b->data + dentry_off * (longnames ? MFSL_DIRSIZE :
    86                                             MFS_DIRSIZE);
     86                    MFS_DIRSIZE);
    8787                d_info->d_inum = conv16(sbi->native, d->d_inum);
    8888                memcpy(d_info->d_name, d->d_name, namelen);
     
    101101/**Write a directory entry on disk.
    102102 *
    103  * @param d_info        Pointer to the directory entry structure to write on disk.
    104  *
    105  * @return              EOK on success or a negative error code.
     103 * @param d_info Pointer to the directory entry structure to write on disk.
     104 *
     105 * @return       EOK on success or a negative error code.
    106106 */
    107107int
     
    178178
    179179                if (name_len == d_name_len &&
    180                                 !bcmp(d_info.d_name, d_name, name_len)) {
     180                    !bcmp(d_info.d_name, d_name, name_len)) {
     181
    181182                        d_info.d_inum = 0;
    182183                        r = mfs_write_dentry(&d_info);
     
    197198 */
    198199int
    199 mfs_insert_dentry(struct mfs_node *mnode, const char *d_name, fs_index_t d_inum)
     200mfs_insert_dentry(struct mfs_node *mnode, const char *d_name,
     201    fs_index_t d_inum)
    200202{
    201203        int r;
     
    209211                return ENAMETOOLONG;
    210212
    211         /*Search for an empty dentry*/
     213        /* Search for an empty dentry */
    212214        unsigned i;
    213215        for (i = 0; i < mnode->ino_i->i_size / sbi->dirsize; ++i) {
     
    217219
    218220                if (d_info.d_inum == 0) {
    219                         /*This entry is not used*/
     221                        /* This entry is not used */
    220222                        empty_dentry_found = true;
    221223                        break;
     
    231233
    232234                if (b == 0) {
    233                         /*Increase the inode size*/
     235                        /* Increase the inode size */
    234236
    235237                        uint32_t dummy;
  • uspace/srv/fs/mfs/mfs_inode.c

    r9269c88 r6d4d883  
    4242static int
    4343mfs_read_inode_raw(const struct mfs_instance *instance,
    44                 struct mfs_ino_info **ino_ptr, uint16_t inum);
     44    struct mfs_ino_info **ino_ptr, uint16_t inum);
    4545
    4646static int
    4747mfs2_read_inode_raw(const struct mfs_instance *instance,
    48                 struct mfs_ino_info **ino_ptr, uint32_t inum);
     48    struct mfs_ino_info **ino_ptr, uint32_t inum);
    4949
    5050/**Read a MINIX inode from disk
     
    5959int
    6060mfs_get_inode(struct mfs_instance *inst, struct mfs_ino_info **ino_i,
    61           fs_index_t index)
     61    fs_index_t index)
    6262{
    6363        struct mfs_sb_info *sbi = inst->sbi;
     
    6565
    6666        if (sbi->fs_version == MFS_VERSION_V1) {
    67                 /*Read a MFS V1 inode*/
     67                /* Read a MFS V1 inode */
    6868                r = mfs_read_inode_raw(inst, ino_i, index);
    6969        } else {
    70                 /*Read a MFS V2/V3 inode*/
     70                /* Read a MFS V2/V3 inode */
    7171                r = mfs2_read_inode_raw(inst, ino_i, index);
    7272        }
     
    7777static int
    7878mfs_read_inode_raw(const struct mfs_instance *instance,
    79                 struct mfs_ino_info **ino_ptr, uint16_t inum) {
     79    struct mfs_ino_info **ino_ptr, uint16_t inum)
     80{
    8081        struct mfs_inode *ino;
    8182        struct mfs_ino_info *ino_i = NULL;
     
    8687        sbi = instance->sbi;
    8788
    88         /*inode 0 does not exist*/
     89        /* inode 0 does not exist */
    8990        inum -= 1;
    9091
     
    101102
    102103        r = block_get(&b, instance->service_id,
    103                       itable_off + inum / sbi->ino_per_block,
    104                       BLOCK_FLAGS_NONE);
     104            itable_off + inum / sbi->ino_per_block,
     105            BLOCK_FLAGS_NONE);
     106
    105107        if (r != EOK)
    106108                goto out_err;
     
    134136static int
    135137mfs2_read_inode_raw(const struct mfs_instance *instance,
    136                 struct mfs_ino_info **ino_ptr, uint32_t inum) {
     138    struct mfs_ino_info **ino_ptr, uint32_t inum)
     139{
    137140        struct mfs2_inode *ino;
    138141        struct mfs_ino_info *ino_i = NULL;
     
    150153        sbi = instance->sbi;
    151154
    152         /*inode 0 does not exist*/
     155        /* inode 0 does not exist */
    153156        inum -= 1;
    154157
     
    157160
    158161        r = block_get(&b, instance->service_id,
    159                       itable_off + inum / sbi->ino_per_block,
    160                       BLOCK_FLAGS_NONE);
     162            itable_off + inum / sbi->ino_per_block,
     163            BLOCK_FLAGS_NONE);
     164
    161165        if (r != EOK)
    162166                goto out_err;
     
    322326
    323327        if (size_shrink == 0) {
    324                 /*Nothing to be done*/
     328                /* Nothing to be done */
    325329                return EOK;
    326330        }
     
    333337        ino_i->dirty = true;
    334338
    335         /*Compute the number of zones to free*/
     339        /* Compute the number of zones to free */
    336340        unsigned zones_to_free;
    337341
     
    354358
    355359                if (old_zone == 0)
    356                         continue; /*Sparse block*/
     360                        continue; /* Sparse block */
    357361
    358362                r = mfs_free_zone(mnode->instance, old_zone);
  • uspace/srv/fs/mfs/mfs_ops.c

    r9269c88 r6d4d883  
    4343
    4444static bool check_magic_number(uint16_t magic, bool *native,
    45                                mfs_version_t *version, bool *longfilenames);
     45    mfs_version_t *version, bool *longfilenames);
    4646static int mfs_node_core_get(fs_node_t **rfn, struct mfs_instance *inst,
    47                              fs_index_t index);
    48 
     47    fs_index_t index);
    4948static int mfs_node_put(fs_node_t *fsnode);
    5049static int mfs_node_open(fs_node_t *fsnode);
     
    6463static hash_index_t open_nodes_hash(unsigned long key[]);
    6564static int open_nodes_compare(unsigned long key[], hash_count_t keys,
    66                 link_t *item);
     65    link_t *item);
    6766static void open_nodes_remove_cb(link_t *link);
    68 
    6967static int mfs_node_get(fs_node_t **rfn, service_id_t service_id,
    70                         fs_index_t index);
    71 static int
    72 mfs_instance_get(service_id_t service_id, struct mfs_instance **instance);
     68    fs_index_t index);
     69static int mfs_instance_get(service_id_t service_id,
     70    struct mfs_instance **instance);
    7371
    7472
     
    9694
    9795/* Hash table interface for open nodes hash table */
    98 static hash_index_t open_nodes_hash(unsigned long key[])
     96static hash_index_t
     97open_nodes_hash(unsigned long key[])
    9998{
    10099        /* TODO: This is very simple and probably can be improved */
     
    102101}
    103102
    104 static int open_nodes_compare(unsigned long key[], hash_count_t keys,
    105                 link_t *item)
     103static int
     104open_nodes_compare(unsigned long key[], hash_count_t keys,
     105    link_t *item)
    106106{
    107107        struct mfs_node *mnode = hash_table_get_instance(item, struct mfs_node, link);
     
    118118}
    119119
    120 static void open_nodes_remove_cb(link_t *link)
     120static void
     121open_nodes_remove_cb(link_t *link)
    121122{
    122123        /* We don't use remove callback for this hash table */
     
    129130};
    130131
    131 int mfs_global_init(void)
     132int
     133mfs_global_init(void)
    132134{
    133135        if (!hash_table_create(&open_nodes, OPEN_NODES_BUCKETS,
    134                         OPEN_NODES_KEYS, &open_nodes_ops)) {
     136            OPEN_NODES_KEYS, &open_nodes_ops)) {
    135137                return ENOMEM;
    136138        }
     
    140142static int
    141143mfs_mounted(service_id_t service_id, const char *opts, fs_index_t *index,
    142                 aoff64_t *size, unsigned *linkcnt)
     144    aoff64_t *size, unsigned *linkcnt)
    143145{
    144146        enum cache_mode cmode;
     
    163165                return rc;
    164166
    165         /*Allocate space for generic MFS superblock*/
     167        /* Allocate space for generic MFS superblock */
    166168        sbi = malloc(sizeof(*sbi));
    167169        if (!sbi) {
     
    170172        }
    171173
    172         /*Allocate space for filesystem instance*/
     174        /* Allocate space for filesystem instance */
    173175        instance = malloc(sizeof(*instance));
    174176        if (!instance) {
     
    191193
    192194        if (check_magic_number(sb->s_magic, &native, &version, &longnames)) {
    193                 /*This is a V1 or V2 Minix filesystem*/
     195                /* This is a V1 or V2 Minix filesystem */
    194196                magic = sb->s_magic;
    195197        } else if (check_magic_number(sb3->s_magic, &native, &version, &longnames)) {
    196                 /*This is a V3 Minix filesystem*/
     198                /* This is a V3 Minix filesystem */
    197199                magic = sb3->s_magic;
    198200        } else {
    199                 /*Not recognized*/
     201                /* Not recognized */
    200202                mfsdebug("magic number not recognized\n");
    201203                rc = ENOTSUP;
     
    205207        mfsdebug("magic number recognized = %04x\n", magic);
    206208
    207         /*Fill superblock info structure*/
     209        /* Fill superblock info structure */
    208210
    209211        sbi->fs_version = version;
     
    243245                sbi->dirsize = longnames ? MFSL_DIRSIZE : MFS_DIRSIZE;
    244246                sbi->max_name_len = longnames ? MFS_L_MAX_NAME_LEN :
    245                                     MFS_MAX_NAME_LEN;
     247                    MFS_MAX_NAME_LEN;
    246248        }
    247249
     
    267269        }
    268270
    269         /*Initialize the instance structure and remember it*/
     271        /* Initialize the instance structure and remember it */
    270272        instance->service_id = service_id;
    271273        instance->sbi = sbi;
     
    328330}
    329331
    330 service_id_t mfs_service_get(fs_node_t *fsnode)
     332service_id_t
     333mfs_service_get(fs_node_t *fsnode)
    331334{
    332335        struct mfs_node *node = fsnode->data;
     
    334337}
    335338
    336 static int mfs_create_node(fs_node_t **rfn, service_id_t service_id, int flags)
     339static int
     340mfs_create_node(fs_node_t **rfn, service_id_t service_id, int flags)
    337341{
    338342        int r;
     
    348352                return r;
    349353
    350         /*Alloc a new inode*/
     354        /* Alloc a new inode */
    351355        r = mfs_alloc_inode(inst, &inum);
    352356        if (r != EOK)
     
    375379        if (flags & L_DIRECTORY) {
    376380                ino_i->i_mode = S_IFDIR;
    377                 ino_i->i_nlinks = 2; /*This accounts for the '.' dentry*/
     381                ino_i->i_nlinks = 2; /* This accounts for the '.' dentry */
    378382        } else {
    379383                ino_i->i_mode = S_IFREG;
     
    428432}
    429433
    430 static int mfs_match(fs_node_t **rfn, fs_node_t *pfn, const char *component)
     434static int
     435mfs_match(fs_node_t **rfn, fs_node_t *pfn, const char *component)
    431436{
    432437        struct mfs_node *mnode = pfn->data;
     
    450455
    451456                if (!d_info.d_inum) {
    452                         /*This entry is not used*/
     457                        /* This entry is not used */
    453458                        continue;
    454459                }
     
    457462
    458463                if (comp_size == dentry_name_size &&
    459                         !bcmp(component, d_info.d_name, dentry_name_size)) {
    460                         /*Hit!*/
     464                    !bcmp(component, d_info.d_name, dentry_name_size)) {
     465                        /* Hit! */
    461466                        mfs_node_core_get(rfn, mnode->instance,
    462                                           d_info.d_inum);
     467                            d_info.d_inum);
    463468                        goto found;
    464469                }
     
    469474}
    470475
    471 static aoff64_t mfs_size_get(fs_node_t *node)
     476static aoff64_t
     477mfs_size_get(fs_node_t *node)
    472478{
    473479        const struct mfs_node *mnode = node->data;
     
    477483static int
    478484mfs_node_get(fs_node_t **rfn, service_id_t service_id,
    479                         fs_index_t index)
     485    fs_index_t index)
    480486{
    481487        int rc;
     
    521527}
    522528
    523 static int mfs_node_open(fs_node_t *fsnode)
     529static int
     530mfs_node_open(fs_node_t *fsnode)
    524531{
    525532        /*
     
    530537}
    531538
    532 static fs_index_t mfs_index_get(fs_node_t *fsnode)
     539static fs_index_t
     540mfs_index_get(fs_node_t *fsnode)
    533541{
    534542        struct mfs_node *mnode = fsnode->data;
     
    536544}
    537545
    538 static unsigned mfs_lnkcnt_get(fs_node_t *fsnode)
     546static unsigned
     547mfs_lnkcnt_get(fs_node_t *fsnode)
    539548{
    540549        struct mfs_node *mnode = fsnode->data;
     
    551560}
    552561
    553 static int mfs_node_core_get(fs_node_t **rfn, struct mfs_instance *inst,
    554                              fs_index_t index)
     562static int
     563mfs_node_core_get(fs_node_t **rfn, struct mfs_instance *inst,
     564    fs_index_t index)
    555565{
    556566        fs_node_t *node = NULL;
     
    624634}
    625635
    626 static bool mfs_is_directory(fs_node_t *fsnode)
     636static bool
     637mfs_is_directory(fs_node_t *fsnode)
    627638{
    628639        const struct mfs_node *node = fsnode->data;
     
    630641}
    631642
    632 static bool mfs_is_file(fs_node_t *fsnode)
     643static bool
     644mfs_is_file(fs_node_t *fsnode)
    633645{
    634646        struct mfs_node *node = fsnode->data;
     
    636648}
    637649
    638 static int mfs_root_get(fs_node_t **rfn, service_id_t service_id)
     650static int
     651mfs_root_get(fs_node_t **rfn, service_id_t service_id)
    639652{
    640653        int rc = mfs_node_get(rfn, service_id, MFS_ROOT_INO);
     
    642655}
    643656
    644 static int mfs_link(fs_node_t *pfn, fs_node_t *cfn, const char *name)
     657static int
     658mfs_link(fs_node_t *pfn, fs_node_t *cfn, const char *name)
    645659{
    646660        struct mfs_node *parent = pfn->data;
     
    717731}
    718732
    719 static int mfs_has_children(bool *has_children, fs_node_t *fsnode)
     733static int
     734mfs_has_children(bool *has_children, fs_node_t *fsnode)
    720735{
    721736        struct mfs_node *mnode = fsnode->data;
     
    738753
    739754                if (d_info.d_inum) {
    740                         /*A valid entry has been found*/
     755                        /* A valid entry has been found */
    741756                        *has_children = true;
    742757                        break;
     
    750765static int
    751766mfs_read(service_id_t service_id, fs_index_t index, aoff64_t pos,
    752                 size_t *rbytes)
     767    size_t *rbytes)
    753768{
    754769        int rc;
     
    780795
    781796                if (pos < 2) {
    782                         /*Skip the first two dentries ('.' and '..')*/
     797                        /* Skip the first two dentries ('.' and '..') */
    783798                        pos = 2;
    784799                }
     
    790805
    791806                        if (d_info.d_inum) {
    792                                 /*Dentry found!*/
     807                                /* Dentry found! */
    793808                                goto found;
    794809                        }
     
    806821
    807822                if (pos >= (size_t) ino_i->i_size) {
    808                         /*Trying to read beyond the end of file*/
     823                        /* Trying to read beyond the end of file */
    809824                        bytes = 0;
    810825                        (void) async_data_read_finalize(callid, NULL, 0);
     
    823838
    824839                if (zone == 0) {
    825                         /*sparse file*/
     840                        /* sparse file */
    826841                        uint8_t *buf = malloc(sbi->block_size);
    827842                        if (!buf) {
     
    831846                        memset(buf, 0, sizeof(sbi->block_size));
    832847                        async_data_read_finalize(callid,
    833                                                 buf + pos % sbi->block_size, bytes);
     848                            buf + pos % sbi->block_size, bytes);
    834849                        free(buf);
    835850                        goto out_success;
     
    841856
    842857                async_data_read_finalize(callid, b->data +
    843                                         pos % sbi->block_size, bytes);
     858                    pos % sbi->block_size, bytes);
    844859
    845860                rc = block_put(b);
     
    862877static int
    863878mfs_write(service_id_t service_id, fs_index_t index, aoff64_t pos,
    864                 size_t *wbytes, aoff64_t *nsize)
     879    size_t *wbytes, aoff64_t *nsize)
    865880{
    866881        fs_node_t *fn;
     
    954969                return ENOENT;
    955970
    956         /*Destroy the inode*/
     971        /* Destroy the inode */
    957972        return mfs_destroy_node(fn);
    958973}
     
    973988        assert(!has_children);
    974989
    975         /*Free the entire inode content*/
     990        /* Free the entire inode content */
    976991        r = mfs_inode_shrink(mnode, mnode->ino_i->i_size);
    977992        if (r != EOK)
    978993                goto out;
    979994
    980         /*Mark the inode as free in the bitmap*/
     995        /* Mark the inode as free in the bitmap */
    981996        r = mfs_free_inode(mnode->instance, mnode->ino_i->index);
    982997
     
    10171032
    10181033        rc = fs_instance_get(service_id, &data);
    1019         if (rc == EOK) {
     1034        if (rc == EOK)
    10201035                *instance = (struct mfs_instance *) data;
    1021         } else {
     1036        else {
    10221037                mfsdebug("instance not found\n");
    10231038        }
     
    10261041}
    10271042
    1028 static bool check_magic_number(uint16_t magic, bool *native,
    1029                                mfs_version_t *version, bool *longfilenames)
     1043static bool
     1044check_magic_number(uint16_t magic, bool *native,
     1045                mfs_version_t *version, bool *longfilenames)
    10301046{
    10311047        bool rc = true;
  • uspace/srv/fs/mfs/mfs_rw.c

    r9269c88 r6d4d883  
    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
     
    6868        const int block_size = sbi->block_size;
    6969
    70         /*Compute relative block number in file*/
     70        /* Compute relative block number in file */
    7171        int rblock = pos / block_size;
    7272
    7373        if (ROUND_UP(mnode->ino_i->i_size, sbi->block_size) < pos) {
    74                 /*Trying to read beyond the end of file*/
     74                /* Trying to read beyond the end of file */
    7575                r = EOK;
    7676                *b = 0;
     
    8585int
    8686mfs_write_map(struct mfs_node *mnode, const uint32_t pos, uint32_t new_zone,
    87           uint32_t *old_zone)
     87    uint32_t *old_zone)
    8888{
    8989        const struct mfs_sb_info *sbi = mnode->instance->sbi;
    9090
    9191        if (pos >= sbi->max_file_size) {
    92                 /*Can't write beyond the maximum file size*/
     92                /* Can't write beyond the maximum file size */
    9393                return EINVAL;
    9494        }
    9595
    96         /*Compute the relative block number in file*/
     96        /* Compute the relative block number in file */
    9797        int rblock = pos / sbi->block_size;
    9898
     
    102102static int
    103103rw_map_ondisk(uint32_t *b, const struct mfs_node *mnode, int rblock,
    104               bool write_mode, uint32_t w_block)
     104    bool write_mode, uint32_t w_block)
    105105{
    106106        int r, nr_direct;
     
    123123        }
    124124
    125         /*Check if the wanted block is in the direct zones*/
     125        /* Check if the wanted block is in the direct zones */
    126126        if (rblock < nr_direct) {
    127127                *b = ino_i->i_dzone[rblock];
     
    136136
    137137        if (rblock < ptrs_per_block) {
    138                 /*The wanted block is in the single indirect zone chain*/
     138                /* The wanted block is in the single indirect zone chain */
    139139                if (ino_i->i_izone[0] == 0) {
    140140                        if (write_mode && !deleting) {
     
    168168        rblock -= ptrs_per_block;
    169169
    170         /*The wanted block is in the double indirect zone chain*/
    171 
    172         /*read the first indirect zone of the chain*/
     170        /* The wanted block is in the double indirect zone chain */
     171
     172        /* Read the first indirect zone of the chain */
    173173        if (ino_i->i_izone[1] == 0) {
    174174                if (write_mode && !deleting) {
     
    181181                        ino_i->dirty = true;
    182182                } else {
    183                         /*Sparse block*/
     183                        /* Sparse block */
    184184                        *b = 0;
    185185                        return EOK;
     
    192192
    193193        /*
    194          *Compute the position of the second indirect
    195          *zone pointer in the chain.
     194         * Compute the position of the second indirect
     195         * zone pointer in the chain.
    196196         */
    197197        uint32_t ind2_off = rblock / ptrs_per_block;
    198198
    199         /*read the second indirect zone of the chain*/
     199        /* read the second indirect zone of the chain */
    200200        if (ind_zone[ind2_off] == 0) {
    201201                if (write_mode && !deleting) {
     
    208208                        write_ind_zone(inst, ino_i->i_izone[1], ind_zone);
    209209                } else {
    210                         /*Sparse block*/
     210                        /* Sparse block */
    211211                        r = EOK;
    212212                        *b = 0;
     
    264264
    265265        if (rblock < nr_direct) {
    266                 /*free the single indirect zone*/
     266                /* Free the single indirect zone */
    267267                if (ino_i->i_izone[0]) {
    268268                        r = mfs_free_zone(inst, ino_i->i_izone[0]);
     
    282282                ++fzone_to_free;
    283283
    284         /*free the entire double indirect zone*/
     284        /* Free the entire double indirect zone */
    285285        uint32_t *dbl_zone;
    286286
    287287        if (ino_i->i_izone[1] == 0) {
    288                 /*Nothing to be done*/
     288                /* Nothing to be done */
    289289                return EOK;
    290290        }
     
    350350        block_t *b;
    351351        const int max_ind_zone_ptrs = (MFS_MAX_BLOCKSIZE / sizeof(uint16_t)) *
    352                                       sizeof(uint32_t);
     352            sizeof(uint32_t);
    353353
    354354        *ind_zone = malloc(max_ind_zone_ptrs);
  • uspace/srv/fs/mfs/mfs_utils.c

    r9269c88 r6d4d883  
    3434#include "mfs.h"
    3535
    36 uint16_t conv16(bool native, uint16_t n)
     36uint16_t
     37conv16(bool native, uint16_t n)
    3738{
    3839        if (native)
     
    4243}
    4344
    44 uint32_t conv32(bool native, uint32_t n)
     45uint32_t
     46conv32(bool native, uint32_t n)
    4547{
    4648        if (native)
     
    5052}
    5153
    52 uint64_t conv64(bool native, uint64_t n)
     54uint64_t
     55conv64(bool native, uint64_t n)
    5356{
    5457        if (native)
Note: See TracChangeset for help on using the changeset viewer.