X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=ext4_utils%2Fallocate.h;h=4a733d00adf54200193d4430a7536bf4f66d53b9;hb=9458a99b0c69dd65facc6ef975218848e8b1f0b6;hp=5c26792cd439309fb97a2785b46a04ed4cb1426a;hpb=e5871841f26c13f5aba2ca9f67b381ab7d4bd9ce;p=android-x86%2Fsystem-extras.git diff --git a/ext4_utils/allocate.h b/ext4_utils/allocate.h index 5c26792c..4a733d00 100644 --- a/ext4_utils/allocate.h +++ b/ext4_utils/allocate.h @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -21,7 +21,13 @@ #include "ext4_utils.h" -struct region; +struct region { + u32 block; + u32 len; + int bg; + struct region *next; + struct region *prev; +}; struct region_list { struct region *first; @@ -37,6 +43,24 @@ struct block_allocation { struct block_allocation* next; }; +struct block_group_info { + u32 first_block; + int header_blocks; + int data_blocks_used; + int has_superblock; + u8 *bitmaps; + u8 *block_bitmap; + u8 *inode_bitmap; + u8 *inode_table; + u32 free_blocks; + u32 free_inodes; + u32 first_free_inode; + u16 flags; + u16 used_dirs; + int chunk_count; + int max_chunk_count; + struct region *chunks; +}; void block_allocator_init(); void block_allocator_free(); @@ -69,6 +93,9 @@ void append_region(struct block_allocation *alloc, u32 block, u32 len, int bg); struct block_allocation *create_allocation(); int append_oob_allocation(struct block_allocation *alloc, u32 len); -void print_blocks(FILE* f, struct block_allocation *alloc); - +void region_list_append(struct region_list *list, struct region *reg); +void region_list_merge(struct region_list *list1, struct region_list *list2); +void print_blocks(FILE* f, struct block_allocation *alloc, char separator); +void reserve_bg_chunk(int bg, u32 start_block, u32 size); +int reserve_blocks_for_allocation(struct block_allocation *alloc); #endif