Lines Matching refs:undo_ctx

304 	struct undo_context undo_ctx;  in main()  local
370 &undo_ctx.undo_file); in main()
376 retval = io_channel_read_blk64(undo_ctx.undo_file, 0, in main()
377 -(int)sizeof(undo_ctx.hdr), in main()
378 &undo_ctx.hdr); in main()
383 if (memcmp(undo_ctx.hdr.magic, E2UNDO_MAGIC, in main()
384 sizeof(undo_ctx.hdr.magic))) { in main()
389 dump_header(&undo_ctx.hdr); in main()
392 hdr_crc = ext2fs_crc32c_le(~0, (unsigned char *)&undo_ctx.hdr, in main()
395 if (!force && ext2fs_le32_to_cpu(undo_ctx.hdr.header_crc) != hdr_crc) { in main()
400 undo_ctx.blocksize = ext2fs_le32_to_cpu(undo_ctx.hdr.block_size); in main()
401 undo_ctx.fs_blocksize = ext2fs_le32_to_cpu(undo_ctx.hdr.fs_block_size); in main()
402 if (undo_ctx.blocksize == 0 || undo_ctx.fs_blocksize == 0) { in main()
406 if (!force && undo_ctx.blocksize > E2UNDO_MAX_BLOCK_SIZE) { in main()
411 if (!force && undo_ctx.blocksize < E2UNDO_MIN_BLOCK_SIZE) { in main()
416 undo_ctx.super_block = ext2fs_le64_to_cpu(undo_ctx.hdr.super_offset); in main()
417 undo_ctx.num_keys = ext2fs_le64_to_cpu(undo_ctx.hdr.num_keys); in main()
418 io_channel_set_blksize(undo_ctx.undo_file, undo_ctx.blocksize); in main()
424 if (!force && (undo_ctx.hdr.f_incompat || undo_ctx.hdr.f_rocompat)) { in main()
459 if (*opt_offset_string || e2undo_has_feature_fs_offset(&undo_ctx.hdr)) { in main()
461 offset = ext2fs_le64_to_cpu(undo_ctx.hdr.fs_offset); in main()
472 if (!force && check_filesystem(&undo_ctx, channel)) in main()
476 retval = ext2fs_get_mem(sizeof(struct undo_key_info) * undo_ctx.num_keys, in main()
477 &undo_ctx.keys); in main()
482 ikey = undo_ctx.keys; in main()
483 retval = ext2fs_get_mem(undo_ctx.blocksize, &keyb); in main()
488 retval = ext2fs_get_mem(E2UNDO_MAX_EXTENT_BLOCKS * undo_ctx.blocksize, in main()
496 keys_per_block = KEYS_PER_BLOCK(&undo_ctx); in main()
497 lblk = ext2fs_le64_to_cpu(undo_ctx.hdr.key_offset); in main()
499 undo_ctx.num_keys, keys_per_block, undo_ctx.blocksize); in main()
500 for (i = 0; i < undo_ctx.num_keys; i += keys_per_block) { in main()
504 retval = io_channel_read_blk64(undo_ctx.undo_file, in main()
510 undo_ctx.num_keys = i - 1; in main()
526 undo_ctx.blocksize); in main()
536 max_j = undo_ctx.num_keys - i; in main()
546 lblk += (ikey->size + undo_ctx.blocksize - 1) / in main()
547 undo_ctx.blocksize; in main()
549 if (E2UNDO_MAX_EXTENT_BLOCKS * undo_ctx.blocksize < in main()
558 retval = io_channel_read_blk64(undo_ctx.undo_file, in main()
588 qsort(undo_ctx.keys, undo_ctx.num_keys, sizeof(struct undo_key_info), in main()
592 io_channel_set_blksize(channel, undo_ctx.fs_blocksize); in main()
593 for (i = 0, ikey = undo_ctx.keys; i < undo_ctx.num_keys; i++, ikey++) { in main()
594 retval = io_channel_read_blk64(undo_ctx.undo_file, in main()
624 if (!(ext2fs_le32_to_cpu(undo_ctx.hdr.state) & E2UNDO_STATE_FINISHED)) { in main()
629 ext2fs_free_mem(&undo_ctx.keys); in main()
647 io_channel_close(undo_ctx.undo_file); in main()