Lines Matching refs:fs
18 void ext2fs_inode_alloc_stats2(ext2_filsys fs, ext2_ino_t ino,
21 int group = ext2fs_group_of_ino(fs, ino);
24 if (ino > fs->super->s_inodes_count) {
31 ext2fs_mark_inode_bitmap(fs->inode_map, ino);
33 ext2fs_unmark_inode_bitmap(fs->inode_map, ino);
34 fs->group_desc[group].bg_free_inodes_count -= inuse;
36 fs->group_desc[group].bg_used_dirs_count += inuse;
40 fs->group_desc[group].bg_flags &= ~EXT2_BG_INODE_UNINIT;
41 if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
43 ext2_ino_t first_unused_inode = fs->super->s_inodes_per_group -
44 fs->group_desc[group].bg_itable_unused +
45 group * fs->super->s_inodes_per_group + 1;
48 fs->group_desc[group].bg_itable_unused =
49 group * fs->super->s_inodes_per_group +
50 fs->super->s_inodes_per_group - ino;
51 ext2fs_group_desc_csum_set(fs, group);
54 fs->super->s_free_inodes_count -= inuse;
55 ext2fs_mark_super_dirty(fs);
56 ext2fs_mark_ib_dirty(fs);
59 void ext2fs_inode_alloc_stats(ext2_filsys fs, ext2_ino_t ino, int inuse)
61 ext2fs_inode_alloc_stats2(fs, ino, inuse, 0);
64 void ext2fs_block_alloc_stats(ext2_filsys fs, blk_t blk, int inuse)
66 int group = ext2fs_group_of_blk(fs, blk);
69 if (blk >= fs->super->s_blocks_count) {
76 ext2fs_mark_block_bitmap(fs->block_map, blk);
78 ext2fs_unmark_block_bitmap(fs->block_map, blk);
79 fs->group_desc[group].bg_free_blocks_count -= inuse;
80 fs->group_desc[group].bg_flags &= ~EXT2_BG_BLOCK_UNINIT;
81 ext2fs_group_desc_csum_set(fs, group);
83 fs->super->s_free_blocks_count -= inuse;
84 ext2fs_mark_super_dirty(fs);
85 ext2fs_mark_bb_dirty(fs);
86 if (fs->block_alloc_stats)
87 (fs->block_alloc_stats)(fs, (blk64_t) blk, inuse);
90 void ext2fs_set_block_alloc_stats_callback(ext2_filsys fs,
91 void (*func)(ext2_filsys fs,
94 void (**old)(ext2_filsys fs,
98 if (!fs || fs->magic != EXT2_ET_MAGIC_EXT2FS_FILSYS)
101 *old = fs->block_alloc_stats;
103 fs->block_alloc_stats = func;