#define E2FSCK_ATTR(x)
#endif
-#include "quota/mkquota.h"
+#include "quota/quotaio.h"
/*
* Exit codes used by fsck-type programs
struct dx_dirblock_info {
int type;
- blk_t phys;
+ blk64_t phys;
int flags;
- blk_t parent;
+ blk64_t parent;
ext2_dirhash_t min_hash;
ext2_dirhash_t max_hash;
ext2_dirhash_t node_min_hash;
*/
#define E2F_FLAG_ABORT 0x0001 /* Abort signaled */
#define E2F_FLAG_CANCEL 0x0002 /* Cancel signaled */
-#define E2F_FLAG_SIGNAL_MASK 0x0003
+#define E2F_FLAG_SIGNAL_MASK (E2F_FLAG_ABORT | E2F_FLAG_CANCEL)
#define E2F_FLAG_RESTART 0x0004 /* Restart signaled */
+#define E2F_FLAG_RUN_RETURN (E2F_FLAG_SIGNAL_MASK | E2F_FLAG_RESTART)
#define E2F_FLAG_RESTART_LATER 0x0008 /* Restart after all iterations done */
-
#define E2F_FLAG_SETJMP_OK 0x0010 /* Setjmp valid for abort */
#define E2F_FLAG_PROG_BAR 0x0020 /* Progress bar on screen */
#define E2F_FLAG_GOT_DEVSIZE 0x0800 /* Device size has been fetched */
#define E2F_FLAG_EXITING 0x1000 /* E2fsck exiting due to errors */
#define E2F_FLAG_TIME_INSANE 0x2000 /* Time is insane */
+#define E2F_FLAG_PROBLEMS_FIXED 0x4000 /* At least one problem was fixed */
-#define E2F_RESET_FLAGS (E2F_FLAG_TIME_INSANE)
+#define E2F_RESET_FLAGS (E2F_FLAG_TIME_INSANE | E2F_FLAG_PROBLEMS_FIXED)
/*
* Defines for indicating the e2fsck pass number
blk64_t free_blocks;
ino_t free_inodes;
int mount_flags;
+ int openfs_flags;
blkid_cache blkid; /* blkid cache */
#ifdef HAVE_SETJMP_H
profile_t profile;
int blocks_per_page;
+ /* Reserve blocks for root and l+f re-creation */
+ blk64_t root_repair_block, lnf_repair_block;
+
/*
* For the use of callers of the e2fsck functions; not used by
* e2fsck functions themselves.
/* ea_refcount.c */
extern errcode_t ea_refcount_create(int size, ext2_refcount_t *ret);
extern void ea_refcount_free(ext2_refcount_t refcount);
-extern errcode_t ea_refcount_fetch(ext2_refcount_t refcount, blk_t blk,
- int *ret);
+extern errcode_t ea_refcount_fetch(ext2_refcount_t refcount, blk64_t blk, int *ret);
extern errcode_t ea_refcount_increment(ext2_refcount_t refcount,
- blk_t blk, int *ret);
+ blk64_t blk, int *ret);
extern errcode_t ea_refcount_decrement(ext2_refcount_t refcount,
- blk_t blk, int *ret);
+ blk64_t blk, int *ret);
extern errcode_t ea_refcount_store(ext2_refcount_t refcount,
- blk_t blk, int count);
+ blk64_t blk, int count);
extern blk_t ext2fs_get_refcount_size(ext2_refcount_t refcount);
extern void ea_refcount_intr_begin(ext2_refcount_t refcount);
-extern blk_t ea_refcount_intr_next(ext2_refcount_t refcount, int *ret);
+extern blk64_t ea_refcount_intr_next(ext2_refcount_t refcount, int *ret);
/* ehandler.c */
extern const char *ehandler_operation(const char *op);
extern void ehandler_init(io_channel channel);
/* journal.c */
-extern int e2fsck_check_ext3_journal(e2fsck_t ctx);
-extern int e2fsck_run_ext3_journal(e2fsck_t ctx);
+extern errcode_t e2fsck_check_ext3_journal(e2fsck_t ctx);
+extern errcode_t e2fsck_run_ext3_journal(e2fsck_t ctx);
extern void e2fsck_move_ext3_journal(e2fsck_t ctx);
extern int e2fsck_fix_ext3_journal_hint(e2fsck_t ctx);
extern void e2fsck_clear_inode(e2fsck_t ctx, ext2_ino_t ino,
struct ext2_inode *inode, int restart_flag,
const char *source);
+extern void e2fsck_intercept_block_allocations(e2fsck_t ctx);
/* pass2.c */
extern int e2fsck_process_bad_inode(e2fsck_t ctx, ext2_ino_t dir,
#ifdef MTRACE
extern void mtrace_print(char *mesg);
#endif
-extern blk_t get_backup_sb(e2fsck_t ctx, ext2_filsys fs,
+extern blk64_t get_backup_sb(e2fsck_t ctx, ext2_filsys fs,
const char *name, io_manager manager);
extern int ext2_file_type(unsigned int mode);
extern int write_all(int fd, char *buf, size_t count);