Ignore:
File:
1 edited

Legend:

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

    r36cb22f 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);
Note: See TracChangeset for help on using the changeset viewer.