⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fsck.h

📁 reiserfsprogs-3.6.19.tar.gz 源码 给有需要的人!
💻 H
📖 第 1 页 / 共 2 页
字号:
/* FIXME: Needs to be implementedvoid fetch_objectid_map (struct id_map * map, reiserfs_filsys_t * fs);void reiserfs_objectid_map_save (FILE * fp, struct id_map * id_map);struct id_map * reiserfs_objectid_map_load (FILE * fp);*/void mark_formatted_pointed_by_indirect (__u32);int is_formatted_pointed_by_indirect (__u32);#define MAP_NOT_PACKED	0#define MAP_PACKED	1struct pass0_stat {    unsigned long dealt_with; /* number of blocks read during pass 0 */    unsigned long leaves; /* blocks looking like reiserfs leaves found */    unsigned long leaves_corrected;    unsigned long all_contents_removed;    unsigned long too_old_leaves; /* these are leaves which contains                                     direntries with different hash from the                                     one specified with -h */    unsigned long wrong_pointers; /* pointers in indirect items pointing to                                     wrong area */    unsigned long pointed; /* pointers blocks of device pointed by all                              indirect items */};struct pass1_stat {    unsigned long leaves; /* leaves found in pass0 to build tree off */    unsigned long inserted_leaves; /* number of leaves inserted by pointers */    unsigned long pointed_leaves; /* pointers in indirect items which pointed				     to leaves (zeroed) */    unsigned long uninsertable_leaves;    unsigned long non_unique_pointers; /* pointers to already pointed unformatted nodes */    unsigned long correct_pointers;    unsigned long saved_items; /* items saved on pass1: should be 0 */    unsigned long allocable_blocks; /* allocable blocks before pass 1 starts */};struct pass2_stat {    unsigned long leaves; /* leaves inserted item by item */    unsigned long safe_non_unique_pointers; /* these are just the same pointers */    unsigned long relocated;    unsigned long shared_objectids;    unsigned long rewritten;};struct semantic_stat {    unsigned long oid_sharing_files_relocated;    unsigned long regular_files;    unsigned long directories;    unsigned long symlinks;    unsigned long broken_files;    unsigned long others;    unsigned long fixed_sizes;    unsigned long oid_sharing;    unsigned long oid_sharing_dirs_relocated;    unsigned long deleted_entries;};struct lost_found_stat {    unsigned long dir_recovered;    unsigned long empty_lost_dirs;    unsigned long lost_found;    unsigned long lost_found_files;    unsigned long lost_found_dirs;    unsigned long oid_sharing;    unsigned long oid_sharing_dirs_relocated;        unsigned long oid_sharing_files_relocated;    };struct pass_4_stat {    unsigned long deleted_items;};struct rebuild_info {    union {	struct pass0_stat pass0;	struct pass1_stat pass1;	struct pass2_stat pass2;	struct {	    struct semantic_stat semantic;	    struct lost_found_stat lost_found;	} tree;	struct pass_4_stat pass4;    } pass_u;    /* bitmaps */    reiserfs_bitmap_t * source_bitmap;    reiserfs_bitmap_t * new_bitmap;    reiserfs_bitmap_t * allocable_bitmap;    reiserfs_bitmap_t * uninsertables;    char * bitmap_file_name;    /*char * new_bitmap_file_name;*/    char * passes_dump_file_name; /* after pass 0, 1 or 2 reiserfsck can store                                     data with which it will be able to start                                     from the point it stopped last time at */    unsigned short mode;    unsigned long options;    /* rollback file */    char * rollback_file;      /* hash hits stat */    int hash_amount;    unsigned long * hash_hits;    char * defined_hash;#define USED_BLOCKS 1#define EXTERN_BITMAP 2#define ALL_BLOCKS 3    int scan_area;    int use_journal_area;    int test;};struct check_info {    unsigned long bad_nodes;    unsigned long fatal_corruptions;    unsigned long fixable_corruptions;//    unsigned long badblocks_corruptions;    unsigned long leaves;    unsigned long internals;    unsigned long dirs;    unsigned long files;    unsigned long safe;    unsigned long unfm_pointers;    unsigned long zero_unfm_pointers;    reiserfs_bitmap_t * deallocate_bitmap;};struct fsck_data {    unsigned short mode; /* check, rebuild, etc*/    unsigned long options;    unsigned long mounted;    struct rebuild_info rebuild;    struct check_info check;    char * journal_dev_name;     /* log file name and handle */    char * log_file_name;    FILE * log;    /* this is a file where reiserfsck will explain what it is doing. This is       usually stderr. But when -g is specified - reiserfsck runs in the       background and append progress information into 'fsck.run' */    FILE * progress;    /* objectid maps */    id_map_t * proper_id_map;    id_map_t * semantic_id_map; /* this objectid map is used to                                        cure objectid sharing problem */};#define fsck_data(fs) ((struct fsck_data *)((fs)->fs_vp))#define pass_0_stat(fs) (&(fsck_data(fs)->rebuild.pass_u.pass0))#define pass_1_stat(fs) (&(fsck_data(fs)->rebuild.pass_u.pass1))#define pass_2_stat(fs) (&(fsck_data(fs)->rebuild.pass_u.pass2))#define sem_pass_stat(fs) (&(fsck_data(fs)->rebuild.pass_u.tree.semantic))#define lost_found_pass_stat(fs) (&(fsck_data(fs)->rebuild.pass_u.tree.lost_found))#define pass_4_stat(fs) (&(fsck_data(fs)->rebuild.pass_u.pass4))#define fsck_check_stat(fs) (&(fsck_data(fs)->check))#define proper_id_map(s) fsck_data(s)->proper_id_map#define semantic_id_map(s) fsck_data(s)->semantic_id_map#define fsck_source_bitmap(fs) fsck_data(fs)->rebuild.source_bitmap#define fsck_new_bitmap(fs) fsck_data(fs)->rebuild.new_bitmap#define fsck_allocable_bitmap(fs) fsck_data(fs)->rebuild.allocable_bitmap#define fsck_uninsertables(fs) fsck_data(fs)->rebuild.uninsertables#define fsck_deallocate_bitmap(fs) fsck_data(fs)->check.deallocate_bitmap#define fsck_interactive(fs) (fsck_data(fs)->options & OPT_INTERACTIVE)//#define fsck_fix_fixable(fs) (fsck_data(fs)->options & OPT_FIX_FIXABLE)#define fsck_run_one_step(fs) (fsck_data(fs)->options & OPT_SAVE_PASSES_DUMP)#define fsck_save_rollback(fs) (fsck_data(fs)->options & OPT_SAVE_ROLLBACK)/* change unknown modes (corrupted) to mode of regular files, fix file   sizes which are bigger than a real file size, relocate files with   shared objectids (this slows fsck down (when there are too many   files sharing the same objectid), it will also remove other names   pointing to this file */#define fsck_adjust_file_size(fs) (fsck_data(fs)->options & OPT_ADJUST_FILE_SIZE)#define fsck_quiet(fs)	(fsck_data(fs)->options & OPT_QUIET)#define fsck_silent(fs)	(fsck_data(fs)->options & OPT_SILENT)#define fsck_in_background(fs) (fsck_data(fs)->options & OPT_BACKGROUND)#define fsck_hash_defined(fs) (fsck_data(fs)->options & OPT_HASH_DEFINED)#define fsck_skip_journal(fs) (fsck_data(fs)->options & OPT_SKIP_JOURNAL)#define fsck_yes_all(fs) (fsck_data(fs)->options & OPT_YES)#define fsck_mode(fs) (fsck_data(fs)->mode)#define fsck_log_file(fs) (fsck_data(fs)->log)#define fsck_progress_file(fs) ((fs && fsck_data(fs)->progress) ? fsck_data(fs)->progress : stderr)/* name of file where we store information for continuing */#define state_dump_file(fs) fsck_data(fs)->rebuild.passes_dump_file_name/* name of file where we store rollback data */#define state_rollback_file(fs) fsck_data(fs)->rebuild.rollback_fileint fsck_user_confirmed (reiserfs_filsys_t * fs, char * q, char * a, int default_answer);void stage_report (int, reiserfs_filsys_t *);/* journal.c */int replay_journal (reiserfs_filsys_t *);/*pass1: rebuild super block*/void rebuild_sb (reiserfs_filsys_t * fs, char * filename, struct fsck_data * data);#define fsck_log(fmt, list...) \{\if (!fsck_silent (fs))\    reiserfs_warning (fsck_log_file (fs), fmt, ## list);\}#define fsck_progress(fmt, list...) \{\reiserfs_warning (fsck_progress_file(fs), fmt, ## list);\fflush (fsck_progress_file(fs));\}#define FATAL	1#define FIXABLE 2void one_more_corruption(reiserfs_filsys_t *fs, int kind);void one_less_corruption(reiserfs_filsys_t *fs, int kind);/*#define one_more_corruption(fs,kind) fsck_check_stat (fs)->kind##_corruptions++#define one_less_corruption(fs,kind) fsck_check_stat (fs)->kind##_corruptions--*/#define fsck_exit(fmt, list...) \{\reiserfs_warning (fsck_progress_file(fs), fmt, ## list);\exit (EXIT_USER);\}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -