Lines Matching refs:fs

18 void ext2fs_inode_alloc_stats2(ext2_filsys fs, ext2_ino_t ino,  in ext2fs_inode_alloc_stats2()  argument
21 int group = ext2fs_group_of_ino(fs, ino); in ext2fs_inode_alloc_stats2()
23 if (ino > fs->super->s_inodes_count) { in ext2fs_inode_alloc_stats2()
31 ext2fs_mark_inode_bitmap2(fs->inode_map, ino); in ext2fs_inode_alloc_stats2()
33 ext2fs_unmark_inode_bitmap2(fs->inode_map, ino); in ext2fs_inode_alloc_stats2()
34 ext2fs_bg_free_inodes_count_set(fs, group, ext2fs_bg_free_inodes_count(fs, group) - inuse); in ext2fs_inode_alloc_stats2()
36 ext2fs_bg_used_dirs_count_set(fs, group, ext2fs_bg_used_dirs_count(fs, group) + inuse); in ext2fs_inode_alloc_stats2()
40 ext2fs_bg_flags_clear(fs, group, EXT2_BG_INODE_UNINIT); in ext2fs_inode_alloc_stats2()
41 if (ext2fs_has_group_desc_csum(fs)) { in ext2fs_inode_alloc_stats2()
42 ext2_ino_t first_unused_inode = fs->super->s_inodes_per_group - in ext2fs_inode_alloc_stats2()
43 ext2fs_bg_itable_unused(fs, group) + in ext2fs_inode_alloc_stats2()
44 group * fs->super->s_inodes_per_group + 1; in ext2fs_inode_alloc_stats2()
47 …ext2fs_bg_itable_unused_set(fs, group, group * fs->super->s_inodes_per_group + fs->super->s_inodes… in ext2fs_inode_alloc_stats2()
48 ext2fs_group_desc_csum_set(fs, group); in ext2fs_inode_alloc_stats2()
51 fs->super->s_free_inodes_count -= inuse; in ext2fs_inode_alloc_stats2()
52 ext2fs_mark_super_dirty(fs); in ext2fs_inode_alloc_stats2()
53 ext2fs_mark_ib_dirty(fs); in ext2fs_inode_alloc_stats2()
56 void ext2fs_inode_alloc_stats(ext2_filsys fs, ext2_ino_t ino, int inuse) in ext2fs_inode_alloc_stats() argument
58 ext2fs_inode_alloc_stats2(fs, ino, inuse, 0); in ext2fs_inode_alloc_stats()
61 void ext2fs_block_alloc_stats2(ext2_filsys fs, blk64_t blk, int inuse) in ext2fs_block_alloc_stats2() argument
63 int group = ext2fs_group_of_blk2(fs, blk); in ext2fs_block_alloc_stats2()
65 if (blk >= ext2fs_blocks_count(fs->super)) { in ext2fs_block_alloc_stats2()
73 ext2fs_mark_block_bitmap2(fs->block_map, blk); in ext2fs_block_alloc_stats2()
75 ext2fs_unmark_block_bitmap2(fs->block_map, blk); in ext2fs_block_alloc_stats2()
76 ext2fs_bg_free_blocks_count_set(fs, group, ext2fs_bg_free_blocks_count(fs, group) - inuse); in ext2fs_block_alloc_stats2()
77 ext2fs_bg_flags_clear(fs, group, EXT2_BG_BLOCK_UNINIT); in ext2fs_block_alloc_stats2()
78 ext2fs_group_desc_csum_set(fs, group); in ext2fs_block_alloc_stats2()
80 ext2fs_free_blocks_count_add(fs->super, in ext2fs_block_alloc_stats2()
81 -inuse * (blk64_t) EXT2FS_CLUSTER_RATIO(fs)); in ext2fs_block_alloc_stats2()
82 ext2fs_mark_super_dirty(fs); in ext2fs_block_alloc_stats2()
83 ext2fs_mark_bb_dirty(fs); in ext2fs_block_alloc_stats2()
84 if (fs->block_alloc_stats) in ext2fs_block_alloc_stats2()
85 (fs->block_alloc_stats)(fs, (blk64_t) blk, inuse); in ext2fs_block_alloc_stats2()
88 void ext2fs_block_alloc_stats(ext2_filsys fs, blk_t blk, int inuse) in ext2fs_block_alloc_stats() argument
90 ext2fs_block_alloc_stats2(fs, blk, inuse); in ext2fs_block_alloc_stats()
93 void ext2fs_set_block_alloc_stats_callback(ext2_filsys fs, in ext2fs_set_block_alloc_stats_callback() argument
94 void (*func)(ext2_filsys fs, in ext2fs_set_block_alloc_stats_callback() argument
97 void (**old)(ext2_filsys fs, in ext2fs_set_block_alloc_stats_callback() argument
101 if (!fs || fs->magic != EXT2_ET_MAGIC_EXT2FS_FILSYS) in ext2fs_set_block_alloc_stats_callback()
104 *old = fs->block_alloc_stats; in ext2fs_set_block_alloc_stats_callback()
106 fs->block_alloc_stats = func; in ext2fs_set_block_alloc_stats_callback()
109 void ext2fs_block_alloc_stats_range(ext2_filsys fs, blk64_t blk, in ext2fs_block_alloc_stats_range() argument
113 if (blk + num > ext2fs_blocks_count(fs->super)) { in ext2fs_block_alloc_stats_range()
123 ext2fs_mark_block_bitmap_range2(fs->block_map, blk, num); in ext2fs_block_alloc_stats_range()
126 ext2fs_unmark_block_bitmap_range2(fs->block_map, blk, num); in ext2fs_block_alloc_stats_range()
130 int group = ext2fs_group_of_blk2(fs, blk); in ext2fs_block_alloc_stats_range()
131 blk64_t last_blk = ext2fs_group_last_block2(fs, group); in ext2fs_block_alloc_stats_range()
137 ext2fs_bg_free_blocks_count_set(fs, group, in ext2fs_block_alloc_stats_range()
138 ext2fs_bg_free_blocks_count(fs, group) - in ext2fs_block_alloc_stats_range()
139 inuse*n/EXT2FS_CLUSTER_RATIO(fs)); in ext2fs_block_alloc_stats_range()
140 ext2fs_bg_flags_clear(fs, group, EXT2_BG_BLOCK_UNINIT); in ext2fs_block_alloc_stats_range()
141 ext2fs_group_desc_csum_set(fs, group); in ext2fs_block_alloc_stats_range()
142 ext2fs_free_blocks_count_add(fs->super, -inuse * (blk64_t) n); in ext2fs_block_alloc_stats_range()
146 ext2fs_mark_super_dirty(fs); in ext2fs_block_alloc_stats_range()
147 ext2fs_mark_bb_dirty(fs); in ext2fs_block_alloc_stats_range()
148 if (fs->block_alloc_stats_range) in ext2fs_block_alloc_stats_range()
149 (fs->block_alloc_stats_range)(fs, blk, num, inuse); in ext2fs_block_alloc_stats_range()
152 void ext2fs_set_block_alloc_stats_range_callback(ext2_filsys fs, in ext2fs_set_block_alloc_stats_range_callback() argument
153 void (*func)(ext2_filsys fs, blk64_t blk, in ext2fs_set_block_alloc_stats_range_callback() argument
155 void (**old)(ext2_filsys fs, blk64_t blk, in ext2fs_set_block_alloc_stats_range_callback() argument
158 if (!fs || fs->magic != EXT2_ET_MAGIC_EXT2FS_FILSYS) in ext2fs_set_block_alloc_stats_range_callback()
161 *old = fs->block_alloc_stats_range; in ext2fs_set_block_alloc_stats_range_callback()
163 fs->block_alloc_stats_range = func; in ext2fs_set_block_alloc_stats_range_callback()