Changeset 15d0046 in mainline for uspace/lib/ext4/libext4_balloc.c


Ignore:
Timestamp:
2014-09-12T13:22:33Z (10 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9b20126
Parents:
8db09e4 (diff), 105d8d6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

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

    r8db09e4 r15d0046  
    342342        block_t *bitmap_block;
    343343        uint32_t rel_block_idx = 0;
     344        uint32_t free_blocks;
    344345        uint32_t goal;
    345346       
     
    348349        if (rc != EOK)
    349350                return rc;
    350         else if (goal == 0) {
    351                 /* no goal found => partition is full */
    352                 return ENOMEM;
    353         }
    354        
     351
    355352        ext4_superblock_t *sb = inode_ref->fs->superblock;
    356353       
     
    366363        if (rc != EOK)
    367364                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        }
    368372       
    369373        /* Compute indexes */
     
    469473        }
    470474
     475goal_failed:
     476
    471477        rc = ext4_filesystem_put_block_group_ref(bg_ref);
    472478        if (rc != EOK)
     
    484490                if (rc != EOK)
    485491                        return rc;
    486                
     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
    487500                /* Load block with bitmap */
    488501                bitmap_block_addr =
     
    551564                }
    552565
     566next_group:
    553567                rc = ext4_filesystem_put_block_group_ref(bg_ref);
    554568                if (rc != EOK)
Note: See TracChangeset for help on using the changeset viewer.