Lines Matching refs:ino

46 static int check_directory(e2fsck_t ctx, ext2_ino_t ino,
48 static void fix_dotdot(e2fsck_t ctx, ext2_ino_t ino, ext2_ino_t parent);
108 if (ext2fs_test_inode_bitmap2(ctx->inode_dir_map, dir->ino)) in e2fsck_pass3()
109 if (check_directory(ctx, dir->ino, &pctx)) in e2fsck_pass3()
287 ext2_ino_t ino = dir, parent; in check_directory() local
301 if (ext2fs_mark_inode_bitmap2(inode_done_map, ino)) in check_directory()
304 if (e2fsck_dir_info_get_parent(ctx, ino, &parent)) { in check_directory()
318 pctx->ino = ino; in check_directory()
320 if (e2fsck_reconnect_file(ctx, pctx->ino)) in check_directory()
323 fix_dotdot(ctx, pctx->ino, in check_directory()
330 ino = parent; in check_directory()
332 ext2fs_mark_inode_bitmap2(inode_loop_detect, ino); in check_directory()
353 ino = dir; in check_directory()
361 pctx->ino = dir; in check_directory()
381 ext2_ino_t ino; in e2fsck_get_lost_and_found() local
401 sizeof(name)-1, 0, &ino); in e2fsck_get_lost_and_found()
409 retval = ext2fs_read_inode_full(fs, ino, EXT2_INODE(&inode), in e2fsck_get_lost_and_found()
426 if (ext2fs_check_directory(fs, ino) == 0) { in e2fsck_get_lost_and_found()
427 ctx->lost_and_found = ino; in e2fsck_get_lost_and_found()
428 return ino; in e2fsck_get_lost_and_found()
434 pctx.ino = ino; in e2fsck_get_lost_and_found()
440 pctx.errcode = ext2fs_unlink(fs, EXT2_ROOT_INO, name, ino, 0); in e2fsck_get_lost_and_found()
446 (void) e2fsck_dir_info_set_parent(ctx, ino, 0); in e2fsck_get_lost_and_found()
447 e2fsck_adjust_inode_count(ctx, ino, -1); in e2fsck_get_lost_and_found()
498 ctx->inode_used_map, &ino); in e2fsck_get_lost_and_found()
510 ext2fs_mark_inode_bitmap2(ctx->inode_used_map, ino); in e2fsck_get_lost_and_found()
511 ext2fs_mark_inode_bitmap2(ctx->inode_dir_map, ino); in e2fsck_get_lost_and_found()
512 ext2fs_inode_alloc_stats2(fs, ino, +1, 1); in e2fsck_get_lost_and_found()
528 pctx.errcode = ext2fs_write_new_inode(fs, ino, EXT2_INODE(&inode)); in e2fsck_get_lost_and_found()
540 retval = ext2fs_new_dir_block(fs, ino, EXT2_ROOT_INO, &block); in e2fsck_get_lost_and_found()
547 retval = ext2fs_write_dir_block4(fs, blk, block, 0, ino); in e2fsck_get_lost_and_found()
558 pctx.errcode = ext2fs_link(fs, EXT2_ROOT_INO, name, ino, EXT2_FT_DIR); in e2fsck_get_lost_and_found()
563 pctx.errcode = ext2fs_link(fs, EXT2_ROOT_INO, name, ino, in e2fsck_get_lost_and_found()
576 e2fsck_add_dir_info(ctx, ino, EXT2_ROOT_INO); in e2fsck_get_lost_and_found()
578 ext2fs_icount_store(ctx->inode_count, ino, 2); in e2fsck_get_lost_and_found()
579 ext2fs_icount_store(ctx->inode_link_info, ino, 2); in e2fsck_get_lost_and_found()
580 ctx->lost_and_found = ino; in e2fsck_get_lost_and_found()
581 quota_data_add(ctx->qctx, &inode, ino, EXT2_CLUSTER_SIZE(fs->super)); in e2fsck_get_lost_and_found()
582 quota_data_inodes(ctx->qctx, &inode, ino, +1); in e2fsck_get_lost_and_found()
584 printf("/lost+found created; inode #%lu\n", ino); in e2fsck_get_lost_and_found()
586 return ino; in e2fsck_get_lost_and_found()
592 int e2fsck_reconnect_file(e2fsck_t ctx, ext2_ino_t ino) in e2fsck_reconnect_file() argument
602 pctx.ino = ino; in e2fsck_reconnect_file()
613 sprintf(name, "#%u", ino); in e2fsck_reconnect_file()
614 if (ext2fs_read_inode(fs, ino, &inode) == 0) in e2fsck_reconnect_file()
616 retval = ext2fs_link(fs, ctx->lost_and_found, name, ino, file_type); in e2fsck_reconnect_file()
628 ino, file_type); in e2fsck_reconnect_file()
635 e2fsck_adjust_inode_count(ctx, ino, 1); in e2fsck_reconnect_file()
643 errcode_t e2fsck_adjust_inode_count(e2fsck_t ctx, ext2_ino_t ino, int adj) in e2fsck_adjust_inode_count() argument
649 if (!ino) in e2fsck_adjust_inode_count()
652 retval = ext2fs_read_inode(fs, ino, &inode); in e2fsck_adjust_inode_count()
657 printf("Adjusting link count for inode %lu by %d (from %d)\n", ino, adj, in e2fsck_adjust_inode_count()
662 ext2fs_icount_increment(ctx->inode_count, ino, 0); in e2fsck_adjust_inode_count()
665 ext2fs_icount_increment(ctx->inode_link_info, ino, 0); in e2fsck_adjust_inode_count()
668 ext2fs_icount_decrement(ctx->inode_count, ino, 0); in e2fsck_adjust_inode_count()
671 ext2fs_icount_decrement(ctx->inode_link_info, ino, 0); in e2fsck_adjust_inode_count()
675 retval = ext2fs_write_inode(fs, ino, &inode); in e2fsck_adjust_inode_count()
729 static void fix_dotdot(e2fsck_t ctx, ext2_ino_t ino, ext2_ino_t parent) in fix_dotdot() argument
743 printf("Fixing '..' of inode %lu to be %lu...\n", ino, parent); in fix_dotdot()
747 pctx.ino = ino; in fix_dotdot()
748 will_rehash = e2fsck_dir_will_be_rehashed(ctx, ino); in fix_dotdot()
753 retval = ext2fs_dir_iterate(fs, ino, DIRENT_FLAG_INCLUDE_EMPTY, in fix_dotdot()
764 (void) e2fsck_dir_info_set_dotdot(ctx, ino, parent); in fix_dotdot()
765 if (e2fsck_dir_info_set_parent(ctx, ino, ctx->lost_and_found)) in fix_dotdot()