Lines Matching refs:fs
47 static errcode_t ind_punch(ext2_filsys fs, struct ext2_inode *inode,
61 incr = 1ULL << ((EXT2_BLOCK_SIZE_BITS(fs->super)-2)*level);
73 retval = ext2fs_read_ind_block(fs, b, block_buf);
77 retval = ind_punch(fs, inode, block_buf + fs->blocksize,
80 fs->blocksize >> 2);
83 retval = ext2fs_write_ind_block(fs, b, block_buf);
86 if (!check_zero_block(block_buf, fs->blocksize))
92 ext2fs_block_alloc_stats(fs, b, -1);
99 return ext2fs_iblk_sub_blocks(fs, inode, freed);
102 static errcode_t ext2fs_punch_ind(ext2_filsys fs, struct ext2_inode *inode,
114 retval = ext2fs_get_array(3, fs->blocksize, &buf);
120 addr_per_block = (blk_t) fs->blocksize >> 2;
128 retval = ind_punch(fs, inode, block_buf, bp, level,
180 static errcode_t punch_extent_blocks(ext2_filsys fs, ext2_ino_t ino,
191 if (EXT2FS_CLUSTER_RATIO(fs) == 1) {
194 ext2fs_block_alloc_stats2(fs, free_start++, -1);
203 if (free_start & EXT2FS_CLUSTER_MASK(fs)) {
204 retval = ext2fs_map_cluster_block(fs, ino, inode,
209 ext2fs_block_alloc_stats2(fs, free_start, -1);
212 cluster_freed = EXT2FS_CLUSTER_RATIO(fs) -
213 (free_start & EXT2FS_CLUSTER_MASK(fs));
222 while (free_count > 0 && free_count >= EXT2FS_CLUSTER_RATIO(fs)) {
223 ext2fs_block_alloc_stats2(fs, free_start, -1);
225 cluster_freed = EXT2FS_CLUSTER_RATIO(fs);
233 retval = ext2fs_map_cluster_block(fs, ino, inode,
238 ext2fs_block_alloc_stats2(fs, free_start, -1);
248 static errcode_t ext2fs_punch_extent(ext2_filsys fs, ext2_ino_t ino,
260 retval = ext2fs_extent_open2(fs, ino, inode, &handle);
388 retval = punch_extent_blocks(fs, ino, inode, lfree_start,
402 retval = ext2fs_iblk_sub_blocks(fs, inode, freed);
412 errcode_t ext2fs_punch(ext2_filsys fs, ext2_ino_t ino,
425 retval = ext2fs_read_inode(fs, ino, &inode_buf);
431 retval = ext2fs_punch_extent(fs, ino, inode, start, end);
440 retval = ext2fs_punch_ind(fs, inode, block_buf,
446 return ext2fs_write_inode(fs, ino, inode);