Removes some undefined behavior.
Signed-off by: Rosen Penev <rosenp@gmail.com>
};
-void block_allocator_init();
-void block_allocator_free();
-u32 allocate_block();
+void block_allocator_init(void);
+void block_allocator_free(void);
+u32 allocate_block(void);
struct block_allocation *allocate_blocks(u32 len);
int block_allocation_num_regions(struct block_allocation *alloc);
int block_allocation_len(struct block_allocation *alloc);
u16 get_directories(int bg);
u16 get_bg_flags(int bg);
void init_unused_inode_tables(void);
-u32 allocate_inode();
+u32 allocate_inode(void);
void free_alloc(struct block_allocation *alloc);
int reserve_oob_blocks(struct block_allocation *alloc, int blocks);
int advance_blocks(struct block_allocation *alloc, int blocks);
void rewind_alloc(struct block_allocation *alloc);
void append_region(struct block_allocation *alloc,
u32 block, u32 len, int bg);
-struct block_allocation *create_allocation();
+struct block_allocation *create_allocation(void);
int append_oob_allocation(struct block_allocation *alloc, u32 len);
void print_blocks(FILE* f, struct block_allocation *alloc);
len = blocks * info.block_size;
if (dir_inode_num) {
- inode_num = allocate_inode(info);
+ inode_num = allocate_inode();
} else {
dir_inode_num = EXT4_ROOT_INO;
inode_num = EXT4_ROOT_INO;
struct ext4_inode *inode;
u32 inode_num;
- inode_num = allocate_inode(info);
+ inode_num = allocate_inode();
if (inode_num == EXT4_ALLOCATE_FAILED) {
error("failed to allocate inode\n");
return EXT4_ALLOCATE_FAILED;
u32 inode_num;
u32 len = strlen(link);
- inode_num = allocate_inode(info);
+ inode_num = allocate_inode();
if (inode_num == EXT4_ALLOCATE_FAILED) {
error("failed to allocate inode\n");
return EXT4_ALLOCATE_FAILED;
return EXT4_ALLOCATE_FAILED;
}
- inode_num = allocate_inode(info);
+ inode_num = allocate_inode();
if (inode_num == EXT4_ALLOCATE_FAILED) {
error("failed to allocate inode\n");
return EXT4_ALLOCATE_FAILED;
u32 make_special(const char *path);
int inode_set_permissions(u32 inode_num, u16 mode, u16 uid, u16 gid, u32 mtime);
int inode_set_capabilities(u32 inode_num, uint64_t capabilities);
-struct block_allocation* get_saved_allocation_chain();
+struct block_allocation* get_saved_allocation_chain(void);
#endif
struct ext4_inode *inode, u64 len, const char *filename);
u8 *inode_allocate_data_extents(struct ext4_inode *inode, u64 len,
u64 backing_len);
-void free_extent_blocks();
+void free_extent_blocks(void);
#endif
unsigned long backing_len);
void inode_attach_resize(struct ext4_inode *inode,
struct block_allocation *alloc);
-void free_indirect_blocks();
+void free_indirect_blocks(void);
#endif
return inode;
}
-static u32 compute_block_size()
+static u32 compute_block_size(void)
{
return 4096;
}
-static u32 compute_journal_blocks()
+static u32 compute_journal_blocks(void)
{
u32 journal_blocks = DIV_ROUND_UP(info.len, info.block_size) / 64;
if (journal_blocks < 1024)
return journal_blocks;
}
-static u32 compute_blocks_per_group()
+static u32 compute_blocks_per_group(void)
{
return info.block_size * 8;
}
-static u32 compute_inodes()
+static u32 compute_inodes(void)
{
return DIV_ROUND_UP(info.len, info.block_size) / 4;
}
-static u32 compute_inodes_per_group()
+static u32 compute_inodes_per_group(void)
{
u32 blocks = DIV_ROUND_UP(info.len, info.block_size);
u32 block_groups = DIV_ROUND_UP(blocks, info.blocks_per_group);
return inodes;
}
-static u32 compute_bg_desc_reserve_blocks()
+static u32 compute_bg_desc_reserve_blocks(void)
{
u32 blocks = DIV_ROUND_UP(info.len, info.block_size);
u32 block_groups = DIV_ROUND_UP(blocks, info.blocks_per_group);