Home | History | Annotate | Download | only in e2fsck

Lines Matching defs:fs

85 static int process_pass1b_block(ext2_filsys fs, blk64_t	*blocknr,
212 ext2_filsys fs = ctx->fs;
220 pctx.errcode = e2fsck_allocate_inode_bitmap(fs,
235 init_resource_track(&rtrack, ctx->fs->io);
237 print_resource_track(ctx, "Pass 1b", &rtrack, ctx->fs->io);
239 init_resource_track(&rtrack, ctx->fs->io);
241 print_resource_track(ctx, "Pass 1c", &rtrack, ctx->fs->io);
243 init_resource_track(&rtrack, ctx->fs->io);
245 print_resource_track(ctx, "Pass 1d", &rtrack, ctx->fs->io);
270 ext2_filsys fs = ctx->fs;
281 pctx.errcode = ext2fs_open_inode_scan(fs, ctx->inode_buffer_blocks,
293 if (ino % (fs->super->s_inodes_per_group * 4) == 1) {
294 if (e2fsck_mmp_update(fs))
317 if (ext2fs_inode_has_valid_blocks2(fs, &inode) ||
319 pctx.errcode = ext2fs_block_iterate3(fs, ino,
323 if ((fs->super->s_feature_compat & EXT2_FEATURE_COMPAT_EXT_ATTR) &&
324 ext2fs_file_acl_block(fs, &inode)) {
325 blk64_t blk = ext2fs_file_acl_block(fs, &inode);
326 process_pass1b_block(fs, &blk,
328 ext2fs_file_acl_block_set(fs, &inode, blk);
332 if (ino >= EXT2_FIRST_INODE(fs->super) ||
343 static int process_pass1b_block(ext2_filsys fs EXT2FS_ATTR((unused)),
358 lc = EXT2FS_B2C(fs, blockcnt);
372 add_dupe(ctx, p->ino, EXT2FS_B2C(fs, *block_nr), p->inode);
426 ext2_filsys fs = ctx->fs;
440 sd.first_inode = EXT2_FIRST_INODE(fs->super);
441 sd.max_inode = fs->super->s_inodes_count;
442 ext2fs_dblist_dir_iterate(fs->dblist, 0, block_buf,
448 ext2_filsys fs = ctx->fs;
559 ext2fs_unmark_valid(fs);
574 if (check_if_fs_cluster(ctx, EXT2FS_B2C(ctx->fs, block)))
580 static int delete_file_block(ext2_filsys fs,
599 c = EXT2FS_B2C(fs, *block_nr);
600 lc = EXT2FS_B2C(fs, blockcnt);
613 ext2fs_block_alloc_stats2(fs, *block_nr, -1);
624 ext2_filsys fs = ctx->fs;
636 if (ext2fs_inode_has_valid_blocks2(fs, &dp->inode))
637 pctx.errcode = ext2fs_block_iterate3(fs, ino,
645 ext2fs_inode_alloc_stats2(fs, ino, -1, LINUX_S_ISDIR(dp->inode.i_mode));
647 pb.dup_blocks * fs->blocksize);
653 if (ext2fs_file_acl_block(fs, &dp->inode) &&
654 (fs->super->s_feature_compat & EXT2_FEATURE_COMPAT_EXT_ATTR)) {
656 pctx.errcode = ext2fs_adjust_ea_refcount2(fs,
657 ext2fs_file_acl_block(fs, &dp->inode),
664 pctx.blk = ext2fs_file_acl_block(fs, &dp->inode);
675 ext2fs_file_acl_block(fs, &dp->inode))) {
676 blk64_t blk = ext2fs_file_acl_block(fs, &dp->inode);
677 delete_file_block(fs, &blk,
679 ext2fs_file_acl_block_set(fs, &dp->inode, blk);
680 quota_data_sub(ctx->qctx, &dp->inode, ino, fs->blocksize);
694 static int clone_file_block(ext2_filsys fs,
715 c = EXT2FS_B2C(fs, blockcnt);
716 if (check_if_fs_cluster(ctx, EXT2FS_B2C(fs, *block_nr)))
726 INT_TO_VOIDPTR(EXT2FS_B2C(fs, *block_nr)));
740 retval = ext2fs_new_block2(fs, 0, ctx->block_found_map,
749 new_block &= ~EXT2FS_CLUSTER_MASK(fs);
750 new_block += EXT2FS_CLUSTER_MASK(fs) & blockcnt;
752 retval = ext2fs_set_dir_block2(fs->dblist,
763 retval = io_channel_read_blk64(fs->io, *block_nr, 1, cs->buf);
768 retval = io_channel_write_blk64(fs->io, new_block, 1, cs->buf);
775 ext2fs_mark_block_bitmap2(fs->block_map, new_block);
784 ext2_filsys fs = ctx->fs;
800 retval = ext2fs_get_mem(fs->blocksize, &cs.buf);
809 if (ext2fs_inode_has_valid_blocks2(fs, &dp->inode))
810 pctx.errcode = ext2fs_block_iterate3(fs, ino, 0, block_buf,
812 ext2fs_mark_bb_dirty(fs);
826 blk = ext2fs_file_acl_block(fs, &dp->inode);
828 if (blk && (clone_file_block(fs, &new_blk,
831 ext2fs_file_acl_block_set(fs, &dp->inode, new_blk);
839 INT_TO_VOIDPTR(EXT2FS_B2C(fs, blk)));
861 if (ext2fs_file_acl_block(fs, &di->inode) == blk) {
862 ext2fs_file_acl_block_set(fs, &di->inode,
863 ext2fs_file_acl_block(fs, &dp->inode));
882 ext2_filsys fs = ctx->fs;
886 first_block = fs->super->s_first_data_block;
887 for (i = 0; i < fs->group_desc_count; i++) {
890 if (ext2fs_bg_has_super(fs, i)) {
892 (test_block <= first_block + fs->desc_blocks))
897 if ((ext2fs_inode_table_loc(fs, i)) &&
898 (test_block >= ext2fs_inode_table_loc(fs, i)) &&
899 (test_block < (ext2fs_inode_table_loc(fs, i) +
900 fs->inode_blocks_per_group)))
904 if ((test_block == ext2fs_block_bitmap_loc(fs, i)) ||
905 (test_block == ext2fs_inode_bitmap_loc(fs, i)))
908 first_block += fs->super->s_blocks_per_group;
919 ext2_filsys fs = ctx->fs;
923 first_block = fs->super->s_first_data_block;
924 for (i = 0; i < fs->group_desc_count; i++) {
927 if (ext2fs_bg_has_super(fs, i)) {
928 if (cluster >= EXT2FS_B2C(fs, first_block) &&
929 (cluster <= EXT2FS_B2C(fs, first_block +
930 fs->desc_blocks)))
935 if ((ext2fs_inode_table_loc(fs, i)) &&
936 (cluster >= EXT2FS_B2C(fs,
937 ext2fs_inode_table_loc(fs, i))) &&
938 (cluster <= EXT2FS_B2C(fs,
939 ext2fs_inode_table_loc(fs, i) +
940 fs->inode_blocks_per_group - 1)))
944 if ((cluster == EXT2FS_B2C(fs,
945 ext2fs_block_bitmap_loc(fs, i))) ||
946 (cluster == EXT2FS_B2C(fs,
947 ext2fs_inode_bitmap_loc(fs, i))))
950 first_block += fs->super->s_blocks_per_group;