OSDN Git Service

ANRdaemon: move trace result from /sdcard to /data am: d93aa41807
[android-x86/system-extras.git] / ext4_utils / allocate.h
index 5c26792..4a733d0 100644 (file)
@@ -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,
 
 #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