Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ext4/libext4_balloc.c

    rd579acc r2f591127  
    342342        block_t *bitmap_block;
    343343        uint32_t rel_block_idx = 0;
    344         uint32_t free_blocks;
    345344        uint32_t goal;
    346345       
     
    349348        if (rc != EOK)
    350349                return rc;
    351 
     350        else if (goal == 0) {
     351                /* no goal found => partition is full */
     352                return ENOMEM;
     353        }
     354       
    352355        ext4_superblock_t *sb = inode_ref->fs->superblock;
    353356       
     
    363366        if (rc != EOK)
    364367                return rc;
    365 
    366         free_blocks =
    367             ext4_block_group_get_free_blocks_count(bg_ref->block_group, sb);
    368         if (free_blocks == 0) {
    369                 /* This group has no free blocks */
    370                 goto goal_failed;
    371         }
    372368       
    373369        /* Compute indexes */
     
    473469        }
    474470
    475 goal_failed:
    476 
    477471        rc = ext4_filesystem_put_block_group_ref(bg_ref);
    478472        if (rc != EOK)
     
    490484                if (rc != EOK)
    491485                        return rc;
    492 
    493                 free_blocks =
    494                      ext4_block_group_get_free_blocks_count(bg_ref->block_group, sb);
    495                 if (free_blocks == 0) {
    496                         /* This group has no free blocks */
    497                         goto next_group;
    498                 }
    499 
     486               
    500487                /* Load block with bitmap */
    501488                bitmap_block_addr =
     
    564551                }
    565552
    566 next_group:
    567553                rc = ext4_filesystem_put_block_group_ref(bg_ref);
    568554                if (rc != EOK)
Note: See TracChangeset for help on using the changeset viewer.