1 | /* space_bitmap.h 2 | -------------- 3 | 4 | Header file for the bitmap block allocator 5 | 6 | $Id: space_bitmap.h,v 1.3 2003/10/20 07:18:11 stewart Exp $ 7 | 8 | (C)2003 Stewart Smith 9 | Distributed under the GNU Public License 10 | */ 11 | 12 | #ifndef __SPACE_BITMAP_H__ 13 | #define __SPACE_BITMAP_H__ 14 | 15 | #include "testkit/types.h" 16 | 17 | #define BLOCK_AG(disk,block) (block/disk->sb->ag_blocksnr) 18 | 19 | u32 space_bitmap_size(struct fcfs_sb *sb, int ag); 20 | int space_bitmap_allocate_block(struct fcfs_disk *disk, u32 allocation_group,u32 block); 21 | struct fcfs_block_run *ag_allocate_block(struct fcfs_disk *disk, u32 allocation_group, u32 near, u32 blocksnr); 22 | int ag_block_free(struct fcfs_disk *disk,u32 allocation_group, u32 block); 23 | 24 | #endif