mirror of https://github.com/vitalif/e2fsprogs
Add 64-bit alloc_stats interface
Add new ext2fs_block_alloc_stats2() routine that takes blk64_t as an input. Signed-off-by: Jose R. Santos <jrs@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>bitmap-optimize
parent
57e2467d62
commit
e8328e31a9
|
@ -61,9 +61,9 @@ void ext2fs_inode_alloc_stats(ext2_filsys fs, ext2_ino_t ino, int inuse)
|
|||
ext2fs_inode_alloc_stats2(fs, ino, inuse, 0);
|
||||
}
|
||||
|
||||
void ext2fs_block_alloc_stats(ext2_filsys fs, blk_t blk, int inuse)
|
||||
void ext2fs_block_alloc_stats2(ext2_filsys fs, blk64_t blk, int inuse)
|
||||
{
|
||||
int group = ext2fs_group_of_blk(fs, blk);
|
||||
int group = ext2fs_group_of_blk2(fs, blk);
|
||||
|
||||
#ifndef OMIT_COM_ERR
|
||||
if (blk >= fs->super->s_blocks_count) {
|
||||
|
@ -73,20 +73,27 @@ void ext2fs_block_alloc_stats(ext2_filsys fs, blk_t blk, int inuse)
|
|||
}
|
||||
#endif
|
||||
if (inuse > 0)
|
||||
/* FIXME-64 */
|
||||
ext2fs_mark_block_bitmap(fs->block_map, blk);
|
||||
else
|
||||
/* FIXME-64 */
|
||||
ext2fs_unmark_block_bitmap(fs->block_map, blk);
|
||||
fs->group_desc[group].bg_free_blocks_count -= inuse;
|
||||
fs->group_desc[group].bg_flags &= ~EXT2_BG_BLOCK_UNINIT;
|
||||
ext2fs_group_desc_csum_set(fs, group);
|
||||
|
||||
fs->super->s_free_blocks_count -= inuse;
|
||||
ext2fs_free_blocks_count_add(fs->super, -inuse);
|
||||
ext2fs_mark_super_dirty(fs);
|
||||
ext2fs_mark_bb_dirty(fs);
|
||||
if (fs->block_alloc_stats)
|
||||
(fs->block_alloc_stats)(fs, (blk64_t) blk, inuse);
|
||||
}
|
||||
|
||||
void ext2fs_block_alloc_stats(ext2_filsys fs, blk_t blk, int inuse)
|
||||
{
|
||||
ext2fs_block_alloc_stats2(fs, blk, inuse);
|
||||
}
|
||||
|
||||
void ext2fs_set_block_alloc_stats_callback(ext2_filsys fs,
|
||||
void (*func)(ext2_filsys fs,
|
||||
blk64_t blk,
|
||||
|
|
|
@ -586,6 +586,7 @@ void ext2fs_inode_alloc_stats(ext2_filsys fs, ext2_ino_t ino, int inuse);
|
|||
void ext2fs_inode_alloc_stats2(ext2_filsys fs, ext2_ino_t ino,
|
||||
int inuse, int isdir);
|
||||
void ext2fs_block_alloc_stats(ext2_filsys fs, blk_t blk, int inuse);
|
||||
void ext2fs_block_alloc_stats2(ext2_filsys fs, blk64_t blk, int inuse);
|
||||
|
||||
/* alloc_tables.c */
|
||||
extern errcode_t ext2fs_allocate_tables(ext2_filsys fs);
|
||||
|
|
Loading…
Reference in New Issue