reiserfsprogs: convert reiserfs_filsys_t from structure to pointer-to-structure

This makes it more consistent with e2fsprogs.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
This commit is contained in:
Jeff Mahoney committed 2013-08-26 19:02:20 -04:00
1 parent 81aeadf510
commit 97fa944851
37 files changed
+393 -393

No files matched your search

+24 -24
View File
@@ -111,7 +111,7 @@ static reiserfs_bitmap_t *source_bitmap;
static int tree_scanning_failed = 0;
/* 1 if block is not marked as used in the bitmap */
static int is_block_free(reiserfs_filsys_t *fs, unsigned long block)
static int is_block_free(reiserfs_filsys_t fs, unsigned long block)
{
return !reiserfs_bitmap_test_bit(source_bitmap, block);
}
@@ -132,7 +132,7 @@ static int did_we_meet_it(unsigned long block)
return reiserfs_bitmap_test_bit(control_bitmap, block);
}
static void init_control_bitmap(reiserfs_filsys_t *fs)
static void init_control_bitmap(reiserfs_filsys_t fs)
{
unsigned int i;
unsigned long block;
@@ -197,7 +197,7 @@ static void init_control_bitmap(reiserfs_filsys_t *fs)
/* if we managed to complete tree scanning and if control bitmap and/or proper
amount of free blocks mismatch with bitmap on disk and super block's
s_free_blocks - we can fix that */
static void handle_bitmaps(reiserfs_filsys_t *fs)
static void handle_bitmaps(reiserfs_filsys_t fs)
{
int problem = 0;
@@ -271,7 +271,7 @@ static void handle_bitmaps(reiserfs_filsys_t *fs)
return;
}
static int auto_handle_bitmaps(reiserfs_filsys_t *fs)
static int auto_handle_bitmaps(reiserfs_filsys_t fs)
{
unsigned long i;
@@ -288,7 +288,7 @@ static int auto_handle_bitmaps(reiserfs_filsys_t *fs)
}
/* is this block legal to be pointed to by some place of the tree? */
static int bad_block_number(reiserfs_filsys_t *fs, unsigned long block)
static int bad_block_number(reiserfs_filsys_t fs, unsigned long block)
{
if (block >= get_sb_block_count(fs->fs_ondisk_sb) ||
not_data_block(fs, block)) {
@@ -317,7 +317,7 @@ static int bad_block_number(reiserfs_filsys_t *fs, unsigned long block)
return 0;
}
static int got_already(reiserfs_filsys_t *fs, unsigned long block)
static int got_already(reiserfs_filsys_t fs, unsigned long block)
{
if (did_we_meet_it(block)) {
/* block is in tree at least twice */
@@ -328,7 +328,7 @@ static int got_already(reiserfs_filsys_t *fs, unsigned long block)
}
/* 1 if it does not look like reasonable stat data */
static int bad_stat_data(reiserfs_filsys_t *fs,
static int bad_stat_data(reiserfs_filsys_t fs,
struct buffer_head *bh, struct item_head *ih)
{
unsigned long objectid;
@@ -381,13 +381,13 @@ static int bad_stat_data(reiserfs_filsys_t *fs,
}
/* it looks like we can check item length only */
static int bad_direct_item(reiserfs_filsys_t *fs,
static int bad_direct_item(reiserfs_filsys_t fs,
struct buffer_head *bh, struct item_head *ih)
{
return 0;
}
inline void handle_one_pointer(reiserfs_filsys_t *fs,
inline void handle_one_pointer(reiserfs_filsys_t fs,
struct buffer_head *bh, __le32 * item,
int offset)
{
@@ -400,7 +400,7 @@ inline void handle_one_pointer(reiserfs_filsys_t *fs,
}
}
static int bad_badblocks_item(reiserfs_filsys_t *fs, struct buffer_head *bh,
static int bad_badblocks_item(reiserfs_filsys_t fs, struct buffer_head *bh,
struct item_head *ih)
{
__u32 i;
@@ -475,7 +475,7 @@ static int bad_badblocks_item(reiserfs_filsys_t *fs, struct buffer_head *bh,
/* for each unformatted node pointer: make sure it points to data area and
that it is not in the tree yet */
static int bad_indirect_item(reiserfs_filsys_t *fs, struct buffer_head *bh,
static int bad_indirect_item(reiserfs_filsys_t fs, struct buffer_head *bh,
struct item_head *ih)
{
__le32 *ind = (__le32 *) ih_item_body(bh, ih);
@@ -541,7 +541,7 @@ static int bad_indirect_item(reiserfs_filsys_t *fs, struct buffer_head *bh,
}
/* FIXME: this was is_bad_directory from pass0.c */
static int bad_directory_item(reiserfs_filsys_t *fs,
static int bad_directory_item(reiserfs_filsys_t fs,
struct buffer_head *bh, struct item_head *ih)
{
char *name, *prev_name;
@@ -644,7 +644,7 @@ static int bad_directory_item(reiserfs_filsys_t *fs,
return 0;
}
static int bad_item(reiserfs_filsys_t *fs, struct buffer_head *bh, int num)
static int bad_item(reiserfs_filsys_t fs, struct buffer_head *bh, int num)
{
struct item_head *ih;
int format;
@@ -752,7 +752,7 @@ error:
}
/* 1 if i-th and (i-1)-th items can not be neighbors in a leaf */
int bad_pair(reiserfs_filsys_t *fs, struct buffer_head *bh, int pos)
int bad_pair(reiserfs_filsys_t fs, struct buffer_head *bh, int pos)
{
struct item_head *ih;
@@ -831,7 +831,7 @@ int bad_pair(reiserfs_filsys_t *fs, struct buffer_head *bh, int pos)
}
/* 1 if block head or any of items is bad */
static int bad_leaf(reiserfs_filsys_t *fs, struct buffer_head *bh)
static int bad_leaf(reiserfs_filsys_t fs, struct buffer_head *bh)
{
int i;
@@ -857,7 +857,7 @@ static int bad_leaf(reiserfs_filsys_t *fs, struct buffer_head *bh)
}
/* 1 if bh does not look like internal node */
static int bad_internal(reiserfs_filsys_t *fs, struct buffer_head *bh)
static int bad_internal(reiserfs_filsys_t fs, struct buffer_head *bh)
{
int i;
@@ -895,7 +895,7 @@ static int bad_internal(reiserfs_filsys_t *fs, struct buffer_head *bh)
}
/* h == 0 for root level. block head's level == 1 for leaf level */
static inline int h_to_level(reiserfs_filsys_t *fs, int h)
static inline int h_to_level(reiserfs_filsys_t fs, int h)
{
return get_sb_tree_height(fs->fs_ondisk_sb) - h - 1;
}
@@ -968,7 +968,7 @@ int leaf_fix_key_oid(struct buffer_head *bh, int pos, __u32 oid)
#endif
/* bh must be formatted node. blk_level must be tree_height - h + 1 */
static int bad_node(reiserfs_filsys_t *fs, struct buffer_head **path, int h)
static int bad_node(reiserfs_filsys_t fs, struct buffer_head **path, int h)
{
struct buffer_head **pbh = &path[h];
@@ -1049,7 +1049,7 @@ static struct reiserfs_key *rkey(struct buffer_head **path, int h)
}
/* are all delimiting keys correct */
static int bad_path(reiserfs_filsys_t *fs, struct buffer_head **path, int h1)
static int bad_path(reiserfs_filsys_t fs, struct buffer_head **path, int h1)
{
int h = 0;
struct reiserfs_key *dk;
@@ -1132,7 +1132,7 @@ static int bad_path(reiserfs_filsys_t *fs, struct buffer_head **path, int h1)
return 0;
}
static void before_check_fs_tree(reiserfs_filsys_t *fs)
static void before_check_fs_tree(reiserfs_filsys_t fs)
{
init_control_bitmap(fs);
@@ -1143,7 +1143,7 @@ static void before_check_fs_tree(reiserfs_filsys_t *fs)
proper_id_map(fs) = id_map_init();
}
static void after_check_fs_tree(reiserfs_filsys_t *fs)
static void after_check_fs_tree(reiserfs_filsys_t fs)
{
if (fsck_mode(fs) == FSCK_FIX_FIXABLE) {
reiserfs_flush_to_ondisk_bitmap(fs->fs_bitmap2, fs);
@@ -1159,7 +1159,7 @@ static void after_check_fs_tree(reiserfs_filsys_t *fs)
}
/* pass internal tree of filesystem */
void check_fs_tree(reiserfs_filsys_t *fs)
void check_fs_tree(reiserfs_filsys_t fs)
{
before_check_fs_tree(fs);
@@ -1183,7 +1183,7 @@ void check_fs_tree(reiserfs_filsys_t *fs)
after_check_fs_tree(fs);
}
static int clean_attributes_handler(reiserfs_filsys_t *fs,
static int clean_attributes_handler(reiserfs_filsys_t fs,
struct buffer_head **path, int h)
{
struct buffer_head *bh = path[h];
@@ -1211,7 +1211,7 @@ static int clean_attributes_handler(reiserfs_filsys_t *fs,
return 0;
}
void do_clean_attributes(reiserfs_filsys_t *fs)
void do_clean_attributes(reiserfs_filsys_t fs)
{
pass_through_tree(fs, clean_attributes_handler, NULL, -1);
set_sb_v2_flag(fs->fs_ondisk_sb, reiserfs_attrs_cleared);
+30 -30
View File
@@ -21,7 +21,7 @@
#include "../version.h"
/* main.c */
extern reiserfs_filsys_t *fs;
extern reiserfs_filsys_t fs;
int main(int argc, char *argv[]);
/* Exit codes. */
@@ -67,10 +67,10 @@ int main(int argc, char *argv[]);
/* pass0.c */
extern reiserfs_bitmap_t *leaves_bitmap;
void pass_0(reiserfs_filsys_t *);
void load_pass_0_result(FILE *, reiserfs_filsys_t *);
void pass_0(reiserfs_filsys_t );
void load_pass_0_result(FILE *, reiserfs_filsys_t );
int leaf_structure_check(reiserfs_filsys_t *fs, struct buffer_head *bh);
int leaf_structure_check(reiserfs_filsys_t fs, struct buffer_head *bh);
int is_used_leaf(unsigned long block);
int is_good_unformatted(unsigned long block);
@@ -84,7 +84,7 @@ void register_uninsertable(unsigned long block);
void register_saved_item(void);
int still_bad_unfm_ptr_1(unsigned long block);
int still_bad_unfm_ptr_2(unsigned long block);
void make_alloc_bitmap(reiserfs_filsys_t *);
void make_alloc_bitmap(reiserfs_filsys_t );
void delete_aux_bitmaps();
void set_aux_bitmaps(reiserfs_bitmap_t *leaves, reiserfs_bitmap_t *good,
@@ -100,8 +100,8 @@ extern reiserfs_bitmap_t *bad_unfm_in_tree_once_bitmap;
#define mark_bad_unfm_in_tree_once(block) __mark (bad_unfm_in_tree_once, block)
/* pass1.c */
void pass_1(reiserfs_filsys_t *);
void load_pass_1_result(FILE *, reiserfs_filsys_t *);
void pass_1(reiserfs_filsys_t );
void load_pass_1_result(FILE *, reiserfs_filsys_t );
struct buffer_head *make_buffer(int dev, unsigned long blocknr, int size,
char *data);
void build_the_tree(void);
@@ -115,8 +115,8 @@ int tree_is_empty(void);
void make_single_leaf_tree(struct buffer_head *bh);
/* pass2.c */
void pass_2(reiserfs_filsys_t *);
void load_pass_2_result(reiserfs_filsys_t *);
void pass_2(reiserfs_filsys_t );
void load_pass_2_result(reiserfs_filsys_t );
void insert_item_separately(struct item_head *ih, char *item, int was_in_tree);
void save_item(struct si **head, struct item_head *ih, char *item,
__u32 blocknr);
@@ -161,9 +161,9 @@ void rewrite_file(struct item_head *ih, int should_relocate,
#define RELOCATED -3
#define LOOP_FOUND -4
void load_semantic_result(FILE *, reiserfs_filsys_t *);
void load_semantic_result(FILE *, reiserfs_filsys_t );
void pass_3_semantic(reiserfs_filsys_t *);
void pass_3_semantic(reiserfs_filsys_t );
void semantic_check(void);
int check_semantic_tree(struct reiserfs_key *key, struct reiserfs_key *parent,
int is_dot_dot, int lost_found,
@@ -174,7 +174,7 @@ int not_a_regfile(void *sd);
int fix_obviously_wrong_sd_mode(struct reiserfs_path *path);
int is_dot_dot(char *name, int namelen);
int is_dot(char *name, int namelen);
/*void create_dir_sd (reiserfs_filsys_t *fs,
/*void create_dir_sd (reiserfs_filsys_t fs,
struct reiserfs_path *path, struct reiserfs_key *key);*/
int rebuild_check_regular_file(struct reiserfs_path *path, void *sd,
struct item_head *new_ih);
@@ -182,9 +182,9 @@ int rebuild_semantic_pass(struct reiserfs_key *key, struct reiserfs_key *parent,
int is_dot_dot, struct item_head *new_ih);
/* lost+found.c */
void pass_3a_look_for_lost(reiserfs_filsys_t *);
void pass_3a_look_for_lost(reiserfs_filsys_t );
void load_lost_found_result(reiserfs_filsys_t *);
void load_lost_found_result(reiserfs_filsys_t );
/* pass4.c */
void pass_4_check_unaccessed_items(void);
@@ -201,10 +201,10 @@ int is_bad_directory(struct item_head *ih, char *item, int dev, int blocksize);
//extern int bad_block_number (struct super_block * s, blocknr_t block);
/* check_tree.c */
void check_fs_tree(reiserfs_filsys_t *);
void do_clean_attributes(reiserfs_filsys_t *fs);
int bad_pair(reiserfs_filsys_t *, struct buffer_head *bh, int i);
int bad_leaf_2(reiserfs_filsys_t *, struct buffer_head *bh);
void check_fs_tree(reiserfs_filsys_t );
void do_clean_attributes(reiserfs_filsys_t fs);
int bad_pair(reiserfs_filsys_t , struct buffer_head *bh, int i);
int bad_leaf_2(reiserfs_filsys_t , struct buffer_head *bh);
#if 0
extern int should_be_relocated(struct reiserfs_key *key);
@@ -227,17 +227,17 @@ void reiserfsck_cut_from_item(struct reiserfs_path *path, int cut_size);
comp3_function_t comp_func, int version);
int usearch_by_entry_key (struct super_block * s, struct reiserfs_key *key, struct reiserfs_path *path);*/
typedef int do_after_read_t(reiserfs_filsys_t *, struct buffer_head **, int h);
typedef int do_on_full_path_t(reiserfs_filsys_t *, struct buffer_head **, int);
void pass_through_tree(reiserfs_filsys_t *, do_after_read_t, do_on_full_path_t,
typedef int do_after_read_t(reiserfs_filsys_t , struct buffer_head **, int h);
typedef int do_on_full_path_t(reiserfs_filsys_t , struct buffer_head **, int);
void pass_through_tree(reiserfs_filsys_t , do_after_read_t, do_on_full_path_t,
int depth);
/* bitmap.c */
int reiserfsck_reiserfs_new_blocknrs(reiserfs_filsys_t *fs,
int reiserfsck_reiserfs_new_blocknrs(reiserfs_filsys_t fs,
unsigned long *pblocknrs,
unsigned long start_from,
int amount_needed);
int reiserfsck_reiserfs_free_block(reiserfs_filsys_t *fs, unsigned long block);
int reiserfsck_reiserfs_free_block(reiserfs_filsys_t fs, unsigned long block);
struct buffer_head *reiserfsck_get_new_buffer(unsigned long start);
int is_block_used(unsigned long block);
void mark_block_used(unsigned long block, int check_hardware);
@@ -254,10 +254,10 @@ void id_map_free(id_map_t *);
int id_map_test(id_map_t *map, __u32 id);
int id_map_mark(id_map_t *map, __u32 id);
__u32 id_map_alloc(id_map_t *map);
void id_map_flush(struct id_map *map, reiserfs_filsys_t *fs);
void id_map_flush(struct id_map *map, reiserfs_filsys_t fs);
/* FIXME: Needs to be implemented
void fetch_objectid_map (struct id_map * map, reiserfs_filsys_t *fs);
void 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);
@@ -463,12 +463,12 @@ struct fsck_data {
/* name of file where we store rollback data */
#define state_rollback_file(fs) fsck_data(fs)->rebuild.rollback_file
int fsck_user_confirmed(reiserfs_filsys_t *fs, char *q, char *a,
int fsck_user_confirmed(reiserfs_filsys_t fs, char *q, char *a,
int default_answer);
void stage_report(int, reiserfs_filsys_t *);
void stage_report(int, reiserfs_filsys_t );
/*pass1: rebuild super block*/
void rebuild_sb(reiserfs_filsys_t *fs, char *filename, struct fsck_data *data);
void rebuild_sb(reiserfs_filsys_t fs, char *filename, struct fsck_data *data);
#define fsck_log(fmt, list...) \
{\
@@ -485,8 +485,8 @@ fflush (fsck_progress_file(fs));\
#define FATAL 1
#define FIXABLE 2
void one_more_corruption(reiserfs_filsys_t *fs, int kind);
void one_less_corruption(reiserfs_filsys_t *fs, int kind);
void 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++
+2 -2
View File
@@ -5,7 +5,7 @@
#include "fsck.h"
int fsck_user_confirmed(reiserfs_filsys_t *fs, char *q, char *a,
int fsck_user_confirmed(reiserfs_filsys_t fs, char *q, char *a,
int default_answer)
{
if (!fsck_interactive(fs))
@@ -14,7 +14,7 @@ int fsck_user_confirmed(reiserfs_filsys_t *fs, char *q, char *a,
return user_confirmed(fsck_progress_file(fs), q, a);
}
void stage_report(int pass, reiserfs_filsys_t *fs)
void stage_report(int pass, reiserfs_filsys_t fs)
{
switch (pass) {
case 0:
+5 -5
View File
@@ -11,7 +11,7 @@ void print_name(char *name, int len);
void modify_item(struct item_head *ih, void *item);
/* fixme: search_by_key is not needed after any add_entry */
static __u64 _look_for_lost(reiserfs_filsys_t *fs, int link_lost_dirs)
static __u64 _look_for_lost(reiserfs_filsys_t fs, int link_lost_dirs)
{
struct reiserfs_key key, prev_key, *rdkey;
INITIALIZE_REISERFS_PATH(path);
@@ -285,7 +285,7 @@ cont:
}
static void save_lost_found_result(reiserfs_filsys_t *fs)
static void save_lost_found_result(reiserfs_filsys_t fs)
{
FILE *file;
int retval;
@@ -310,7 +310,7 @@ static void save_lost_found_result(reiserfs_filsys_t *fs)
/* we have nothing to load from a state file, but we have to fetch
on-disk bitmap, copy it to allocable bitmap, and fetch objectid
map */
void load_lost_found_result(reiserfs_filsys_t *fs)
void load_lost_found_result(reiserfs_filsys_t fs)
{
fsck_new_bitmap(fs) =
reiserfs_create_bitmap(get_sb_block_count(fs->fs_ondisk_sb));
@@ -330,7 +330,7 @@ void load_lost_found_result(reiserfs_filsys_t *fs)
*/
}
static void after_lost_found(reiserfs_filsys_t *fs)
static void after_lost_found(reiserfs_filsys_t fs)
{
/* update super block: objectid map, fsck state */
set_sb_fs_state(fs->fs_ondisk_sb, LOST_FOUND_DONE);
@@ -362,7 +362,7 @@ static void after_lost_found(reiserfs_filsys_t *fs)
exit(EXIT_OK);
}
void pass_3a_look_for_lost(reiserfs_filsys_t *fs)
void pass_3a_look_for_lost(reiserfs_filsys_t fs)
{
INITIALIZE_REISERFS_PATH(path);
struct item_head *ih;
+14 -14
View File
@@ -14,7 +14,7 @@ extern int screen_width;
extern int screen_savebuffer_len;
extern char *screen_savebuffer;
reiserfs_filsys_t *fs;
reiserfs_filsys_t fs;
static char *badblocks_file;
#define print_usage_and_exit() { \
@@ -508,7 +508,7 @@ static void register_timer(void)
alarm(1);
}
static void reset_super_block(reiserfs_filsys_t *fs)
static void reset_super_block(reiserfs_filsys_t fs)
{
struct reiserfs_super_block *sb;
struct reiserfs_journal_header *jh;
@@ -627,7 +627,7 @@ static void reset_super_block(reiserfs_filsys_t *fs)
#define START_FROM_PASS_4 6
/* this decides where to start from */
static int where_to_start_from(reiserfs_filsys_t *fs)
static int where_to_start_from(reiserfs_filsys_t fs)
{
int ret;
FILE *fp = NULL;
@@ -714,7 +714,7 @@ static int where_to_start_from(reiserfs_filsys_t *fs)
return START_FROM_THE_BEGINNING;
}
static void reiserfs_update_interval_fields(reiserfs_filsys_t *fs)
static void reiserfs_update_interval_fields(reiserfs_filsys_t fs)
{
/* Not supported on v3.5 */
if (get_sb_version(fs->fs_ondisk_sb) == REISERFS_FORMAT_3_5)
@@ -731,7 +731,7 @@ static void reiserfs_update_interval_fields(reiserfs_filsys_t *fs)
DEFAULT_CHECK_INTERVAL);
}
static void mark_filesystem_consistent(reiserfs_filsys_t *fs)
static void mark_filesystem_consistent(reiserfs_filsys_t fs)
{
if (!is_opened_rw(fs))
return;
@@ -759,7 +759,7 @@ static void mark_filesystem_consistent(reiserfs_filsys_t *fs)
mark_buffer_dirty(fs->fs_super_bh);
}
static void reiserfsck_replay_journal(reiserfs_filsys_t *fs)
static void reiserfsck_replay_journal(reiserfs_filsys_t fs)
{
struct reiserfs_super_block *on_place_sb;
int sb_size = reiserfs_super_block_size(fs->fs_ondisk_sb);
@@ -797,7 +797,7 @@ static void reiserfsck_replay_journal(reiserfs_filsys_t *fs)
fs->fs_ondisk_sb = on_place_sb;
}
static int the_end(reiserfs_filsys_t *fs)
static int the_end(reiserfs_filsys_t fs)
{
int ret = EXIT_FIXED;
@@ -834,7 +834,7 @@ static int the_end(reiserfs_filsys_t *fs)
}
/* check umounted or read-only mounted filesystems only */
static void prepare_fs_for_check(reiserfs_filsys_t *fs)
static void prepare_fs_for_check(reiserfs_filsys_t fs)
{
/* The method could be called from auto_check already. */
if (fs->fs_flags == O_RDWR)
@@ -890,7 +890,7 @@ static void prepare_fs_for_check(reiserfs_filsys_t *fs)
}
}
static void rebuild_tree(reiserfs_filsys_t *fs)
static void rebuild_tree(reiserfs_filsys_t fs)
{
time_t t;
int ret;
@@ -951,7 +951,7 @@ static void rebuild_tree(reiserfs_filsys_t *fs)
exit(ret);
}
static void clean_attributes(reiserfs_filsys_t *fs)
static void clean_attributes(reiserfs_filsys_t fs)
{
time_t t;
@@ -997,7 +997,7 @@ static void clean_attributes(reiserfs_filsys_t *fs)
}
static int reiserfs_check_auto_state(reiserfs_filsys_t *fs)
static int reiserfs_check_auto_state(reiserfs_filsys_t fs)
{
time_t now = time(NULL);
time_t lastcheck = get_sb_v2_lastcheck(fs->fs_ondisk_sb);
@@ -1038,7 +1038,7 @@ static int reiserfs_check_auto_state(reiserfs_filsys_t *fs)
return 0;
}
static int auto_check(reiserfs_filsys_t *fs)
static int auto_check(reiserfs_filsys_t fs)
{
__u16 state;
int retval = 0;
@@ -1137,7 +1137,7 @@ error:
}
/* check umounted or read-only mounted filesystems only */
static void check_fs(reiserfs_filsys_t *fs)
static void check_fs(reiserfs_filsys_t fs)
{
int retval = EXIT_OK;
time_t t;
@@ -1285,7 +1285,7 @@ static int open_devices_for_rollback(char *file_name, struct fsck_data *data)
return 0;
}
static void fsck_rollback(reiserfs_filsys_t *fs)
static void fsck_rollback(reiserfs_filsys_t fs)
{
time_t t;
+16 -16
View File
@@ -40,7 +40,7 @@ static int correct_direct_item_offset(__u64 offset, int format)
}
/* bitmaps which are built on pass 0 and are used on pass 1 */
static void make_aux_bitmaps(reiserfs_filsys_t *fs)
static void make_aux_bitmaps(reiserfs_filsys_t fs)
{
struct reiserfs_super_block *sb;
@@ -171,7 +171,7 @@ static int correct_key_format(struct item_head *ih, int symlink)
#if 0
/* fixme: we might try all available hashes */
static int prob_name(reiserfs_filsys_t *fs,
static int prob_name(reiserfs_filsys_t fs,
char **name, int max_len, __u32 deh_offset)
{
int start; /* */
@@ -190,7 +190,7 @@ static int prob_name(reiserfs_filsys_t *fs,
}
#endif
static void hash_hits_init(reiserfs_filsys_t *fs)
static void hash_hits_init(reiserfs_filsys_t fs)
{
fsck_data(fs)->rebuild.hash_amount = known_hashes();
fsck_data(fs)->rebuild.hash_hits =
@@ -198,7 +198,7 @@ static void hash_hits_init(reiserfs_filsys_t *fs)
return;
}
static void add_hash_hit(reiserfs_filsys_t *fs, int hash_code)
static void add_hash_hit(reiserfs_filsys_t fs, int hash_code)
{
fsck_data(fs)->rebuild.hash_hits[hash_code]++;
}
@@ -226,7 +226,7 @@ static int try_to_get_name_length(struct item_head *ih,
#undef DEBUG_VERIFY_DENTRY
/* check directory item and try to recover something */
static int verify_directory_item(reiserfs_filsys_t *fs, struct buffer_head *bh,
static int verify_directory_item(reiserfs_filsys_t fs, struct buffer_head *bh,
int item_num)
{
struct item_head *ih;
@@ -612,7 +612,7 @@ static int is_wrong_short_key(struct reiserfs_key *key)
}
/* 1 if some of fields in the block head of bh look bad */
int leaf_structure_check(reiserfs_filsys_t *fs, struct buffer_head *bh)
int leaf_structure_check(reiserfs_filsys_t fs, struct buffer_head *bh)
{
struct block_head *blkh;
int free_space, counted;
@@ -671,7 +671,7 @@ int leaf_structure_check(reiserfs_filsys_t *fs, struct buffer_head *bh)
/* FIXME: we can improve fixing of broken keys: we can ssfe direct items which
go after stat data and have broken keys */
static void pass0_correct_leaf(reiserfs_filsys_t *fs, struct buffer_head *bh)
static void pass0_correct_leaf(reiserfs_filsys_t fs, struct buffer_head *bh)
{
int file_format = KEY_FORMAT_UNDEFINED;
struct item_head *ih;
@@ -1837,12 +1837,12 @@ int is_leaf_bad(struct buffer_head *bh)
return bad;
}
static int is_to_be_read(reiserfs_filsys_t *fs, unsigned long block)
static int is_to_be_read(reiserfs_filsys_t fs, unsigned long block)
{
return reiserfs_bitmap_test_bit(fsck_source_bitmap(fs), block);
}
static void do_pass_0(reiserfs_filsys_t *fs)
static void do_pass_0(reiserfs_filsys_t fs)
{
struct buffer_head *bh;
unsigned long i;
@@ -2028,7 +2028,7 @@ void make_allocable(unsigned long block)
reiserfs_bitmap_clear_bit(fsck_allocable_bitmap(fs), block);
}
static void choose_hash_function(reiserfs_filsys_t *fs)
static void choose_hash_function(reiserfs_filsys_t fs)
{
unsigned long max;
unsigned int hash_code;
@@ -2078,7 +2078,7 @@ static void choose_hash_function(reiserfs_filsys_t *fs)
/* create bitmap of blocks the tree is to be built off */
/* debugreiserfs and pass0 should share this code -s should show
the same as we could recover - test: zero first 32M */
static void init_source_bitmap(reiserfs_filsys_t *fs)
static void init_source_bitmap(reiserfs_filsys_t fs)
{
FILE *fp;
unsigned long block_count = get_sb_block_count(fs->fs_ondisk_sb);
@@ -2214,7 +2214,7 @@ static void init_source_bitmap(reiserfs_filsys_t *fs)
}
static void before_pass_0(reiserfs_filsys_t *fs)
static void before_pass_0(reiserfs_filsys_t fs)
{
/* bitmap of blocks to be read */
init_source_bitmap(fs);
@@ -2229,7 +2229,7 @@ static void before_pass_0(reiserfs_filsys_t *fs)
hash_hits_init(fs);
}
static void save_pass_0_result(reiserfs_filsys_t *fs)
static void save_pass_0_result(reiserfs_filsys_t fs)
{
FILE *file;
int retval;
@@ -2255,7 +2255,7 @@ static void save_pass_0_result(reiserfs_filsys_t *fs)
/* file 'fp' must contain 3 bitmaps saved during last pass 0: bitmap
of leaves, bitmaps of good and bad unfms*/
void load_pass_0_result(FILE * fp, reiserfs_filsys_t *fs)
void load_pass_0_result(FILE * fp, reiserfs_filsys_t fs)
{
leaves_bitmap = reiserfs_bitmap_load(fp);
good_unfm_bitmap = reiserfs_bitmap_load(fp);
@@ -2274,7 +2274,7 @@ void load_pass_0_result(FILE * fp, reiserfs_filsys_t *fs)
reiserfs_bitmap_ones(bad_unfm_bitmap));
}
static void after_pass_0(reiserfs_filsys_t *fs)
static void after_pass_0(reiserfs_filsys_t fs)
{
time_t t;
@@ -2317,7 +2317,7 @@ static void after_pass_0(reiserfs_filsys_t *fs)
exit(0);
}
void pass_0(reiserfs_filsys_t *fs)
void pass_0(reiserfs_filsys_t fs)
{
if (get_reiserfs_format(fs->fs_ondisk_sb) != fs->fs_format ||
get_reiserfs_format(fs->fs_ondisk_sb) == REISERFS_FORMAT_UNKNOWN) {
+9 -9
View File
@@ -340,7 +340,7 @@ out:
3. what we should do with directory entries hashed by another hash?
they are deleted for now
*/
static void pass1_correct_leaf(reiserfs_filsys_t *fs, struct buffer_head *bh)
static void pass1_correct_leaf(reiserfs_filsys_t fs, struct buffer_head *bh)
{
unsigned int i, j;
struct item_head *ih;
@@ -483,7 +483,7 @@ struct si *remove_saved_item(struct si *si)
/* fsck starts creating of this bitmap on pass 1. It will then become
on-disk bitmap */
static void init_new_bitmap(reiserfs_filsys_t *fs)
static void init_new_bitmap(reiserfs_filsys_t fs)
{
unsigned int i;
unsigned long block;
@@ -553,7 +553,7 @@ static void init_new_bitmap(reiserfs_filsys_t *fs)
/* this makes a map of blocks which can be allocated when fsck will
continue */
static void find_allocable_blocks(reiserfs_filsys_t *fs)
static void find_allocable_blocks(reiserfs_filsys_t fs)
{
unsigned long i;
@@ -596,7 +596,7 @@ static void find_allocable_blocks(reiserfs_filsys_t *fs)
fs->block_deallocator = reiserfsck_reiserfs_free_block;
}
static void before_pass_1(reiserfs_filsys_t *fs)
static void before_pass_1(reiserfs_filsys_t fs)
{
/* this will become an on-disk bitmap */
init_new_bitmap(fs);
@@ -617,7 +617,7 @@ static void before_pass_1(reiserfs_filsys_t *fs)
/* pass 1 does not deal with objectid */
}
static void save_pass_1_result(reiserfs_filsys_t *fs)
static void save_pass_1_result(reiserfs_filsys_t fs)
{
FILE *file;
int retval;
@@ -645,7 +645,7 @@ static void save_pass_1_result(reiserfs_filsys_t *fs)
state_dump_file(fs));
}
void load_pass_1_result(FILE * fp, reiserfs_filsys_t *fs)
void load_pass_1_result(FILE * fp, reiserfs_filsys_t fs)
{
fsck_new_bitmap(fs) =
reiserfs_create_bitmap(get_sb_block_count(fs->fs_ondisk_sb));
@@ -676,7 +676,7 @@ void load_pass_1_result(FILE * fp, reiserfs_filsys_t *fs)
/* reads blocks marked in leaves_bitmap and tries to insert them into
tree */
static void do_pass_1(reiserfs_filsys_t *fs)
static void do_pass_1(reiserfs_filsys_t fs)
{
struct buffer_head *bh;
unsigned long i;
@@ -775,7 +775,7 @@ static void do_pass_1(reiserfs_filsys_t *fs)
}
static void after_pass_1(reiserfs_filsys_t *fs)
static void after_pass_1(reiserfs_filsys_t fs)
{
time_t t;
@@ -822,7 +822,7 @@ static void after_pass_1(reiserfs_filsys_t *fs)
exit(0);
}
void pass_1(reiserfs_filsys_t *fs)
void pass_1(reiserfs_filsys_t fs)
{
fsck_progress("\nPass 1 (will try to insert %lu leaves):\n",
reiserfs_bitmap_ones(fsck_source_bitmap(fs)));
+6 -6
View File
@@ -432,12 +432,12 @@ static void put_not_stat_data_items(struct buffer_head *bh)
}
}
static void before_pass_2(reiserfs_filsys_t *fs)
static void before_pass_2(reiserfs_filsys_t fs)
{
/* anything specific for pass 2 ? */
}
static void save_pass_2_result(reiserfs_filsys_t *fs)
static void save_pass_2_result(reiserfs_filsys_t fs)
{
FILE *file;
int retval;
@@ -461,7 +461,7 @@ static void save_pass_2_result(reiserfs_filsys_t *fs)
/* we have nothing to load from a state file, but we have to fetch
on-disk bitmap, copy it to allocable bitmap, and fetch objectid
map */
void load_pass_2_result(reiserfs_filsys_t *fs)
void load_pass_2_result(reiserfs_filsys_t fs)
{
fsck_new_bitmap(fs) =
reiserfs_create_bitmap(get_sb_block_count(fs->fs_ondisk_sb));
@@ -483,7 +483,7 @@ void load_pass_2_result(reiserfs_filsys_t *fs)
/* uninsertable blocks are marked by 0s in uninsertable_leaf_bitmap
during the pass 1. They must be not in the tree */
static void do_pass_2(reiserfs_filsys_t *fs)
static void do_pass_2(reiserfs_filsys_t fs)
{
struct buffer_head *bh;
@@ -552,7 +552,7 @@ cont:
fsck_progress("\n");
}
static void after_pass_2(reiserfs_filsys_t *fs)
static void after_pass_2(reiserfs_filsys_t fs)
{
time_t t;
@@ -620,7 +620,7 @@ static void after_pass_2(reiserfs_filsys_t *fs)
exit(0);
}
void pass_2(reiserfs_filsys_t *fs)
void pass_2(reiserfs_filsys_t fs)
{
if (fsck_log_file(fs) != stderr)
fsck_log("####### Pass 2 #######\n");
+6 -6
View File
@@ -1129,7 +1129,7 @@ void modify_item(struct item_head *ih, void *item)
}
/* mkreiserfs should have created this */
static void make_sure_lost_found_exists(reiserfs_filsys_t *fs)
static void make_sure_lost_found_exists(reiserfs_filsys_t fs)
{
int retval;
INITIALIZE_REISERFS_PATH(path);
@@ -1226,7 +1226,7 @@ static void make_sure_lost_found_exists(reiserfs_filsys_t *fs)
/* Result of the rebuild pass will be saved in the state file which is needed to start
* fsck again from the next pass. */
static void save_rebuild_semantic_result(reiserfs_filsys_t *fs)
static void save_rebuild_semantic_result(reiserfs_filsys_t fs)
{
FILE *file;
int retval;
@@ -1251,7 +1251,7 @@ static void save_rebuild_semantic_result(reiserfs_filsys_t *fs)
/* we have nothing to load from a state file, but we have to fetch
on-disk bitmap, copy it to allocable bitmap, and fetch objectid
map */
void load_semantic_result(FILE * file, reiserfs_filsys_t *fs)
void load_semantic_result(FILE * file, reiserfs_filsys_t fs)
{
fsck_new_bitmap(fs) =
reiserfs_create_bitmap(get_sb_block_count(fs->fs_ondisk_sb));
@@ -1272,12 +1272,12 @@ void load_semantic_result(FILE * file, reiserfs_filsys_t *fs)
*/
}
static void before_pass_3(reiserfs_filsys_t *fs)
static void before_pass_3(reiserfs_filsys_t fs)
{
semantic_id_map(fs) = id_map_init();
}
static void after_pass_3(reiserfs_filsys_t *fs)
static void after_pass_3(reiserfs_filsys_t fs)
{
/* update super block: objectid map, fsck state */
set_sb_fs_state(fs->fs_ondisk_sb, SEMANTIC_DONE);
@@ -1310,7 +1310,7 @@ static void after_pass_3(reiserfs_filsys_t *fs)
}
/* this is part of rebuild tree */
void pass_3_semantic(reiserfs_filsys_t *fs)
void pass_3_semantic(reiserfs_filsys_t fs)
{
before_pass_3(fs);
+2 -2
View File
@@ -38,7 +38,7 @@ static int what_fs_version(void)
return exit_code; \
}
int check_sb (reiserfs_filsys_t *fs) {
int check_sb (reiserfs_filsys_t fs) {
int magic = 0, version = 0;
if (!is_blocksize_correct (fs->fs_blocksize))
@@ -168,7 +168,7 @@ int check_sb (reiserfs_filsys_t *fs) {
}
*/
void rebuild_sb(reiserfs_filsys_t *fs, char *filename, struct fsck_data *data)
void rebuild_sb(reiserfs_filsys_t fs, char *filename, struct fsck_data *data)
{
int version = 0;
struct reiserfs_super_block *ondisk_sb = NULL;
+2 -2
View File
@@ -86,7 +86,7 @@ void mark_block_uninsertable(unsigned long block)
}
/* FIXME: should be able to work around no disk space */
int reiserfsck_reiserfs_new_blocknrs(reiserfs_filsys_t *fs,
int reiserfsck_reiserfs_new_blocknrs(reiserfs_filsys_t fs,
unsigned long *free_blocknrs,
unsigned long start, int amount_needed)
{
@@ -119,7 +119,7 @@ struct buffer_head *reiserfsck_get_new_buffer(unsigned long start)
}
/* free block in new bitmap */
int reiserfsck_reiserfs_free_block(reiserfs_filsys_t *fs, unsigned long block)
int reiserfsck_reiserfs_free_block(reiserfs_filsys_t fs, unsigned long block)
{
mark_block_free(block);
+2 -2
View File
@@ -1397,7 +1397,7 @@ check_again:
return get_bytes_number(ih, fs->fs_blocksize);
}
void one_more_corruption(reiserfs_filsys_t *fs, int kind)
void one_more_corruption(reiserfs_filsys_t fs, int kind)
{
if (kind == FATAL)
fsck_check_stat(fs)->fatal_corruptions++;
@@ -1405,7 +1405,7 @@ void one_more_corruption(reiserfs_filsys_t *fs, int kind)
fsck_check_stat(fs)->fixable_corruptions++;
}
void one_less_corruption(reiserfs_filsys_t *fs, int kind)
void one_less_corruption(reiserfs_filsys_t fs, int kind)
{
if (kind == FATAL)
fsck_check_stat(fs)->fatal_corruptions--;
+2 -2
View File
@@ -209,7 +209,7 @@ start_again:
}
}
void id_map_flush(struct id_map *map, reiserfs_filsys_t *fs)
void id_map_flush(struct id_map *map, reiserfs_filsys_t fs)
{
int size, max, i;
__u32 id, prev_id;
@@ -283,7 +283,7 @@ void id_map_flush(struct id_map *map, reiserfs_filsys_t *fs)
/* FIXME: these 3 methods must be implemented also.
void fetch_objectid_map (struct id_map * map, reiserfs_filsys_t *fs)
void fetch_objectid_map (struct id_map * map, reiserfs_filsys_t fs)
{
int sb_size;
__le32 * sb_objectid_map;
+1 -1
View File
@@ -194,7 +194,7 @@ static void erase(void)
fflush(stdout);
}
void pass_through_tree(reiserfs_filsys_t *fs, do_after_read_t action1,
void pass_through_tree(reiserfs_filsys_t fs, do_after_read_t action1,
do_on_full_path_t action2, int depth)
{
struct buffer_head *path[MAX_HEIGHT] = { 0, };