cleanup: remove trailing whitespace
This patch just removes trailing whitespace. Signed-off-by: Jeff Mahoney <jeffm@suse.com>
This commit is contained in:
1 parent
47cff72748
commit
290bb8c378
50 files changed
+319
-319
No files matched your search
+16
-16
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1999-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 1999-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -99,7 +99,7 @@ void clear_relocated_list()
|
||||
// not data blocks (journal area, super block, bitmaps)
|
||||
// 4. bad formatted node found
|
||||
// 5. delimiting keys are incorrect
|
||||
//
|
||||
//
|
||||
|
||||
/* mark every block we see in the tree in control bitmap, so, when to make
|
||||
sure, that no blocks are pointed to from more than one place we use
|
||||
@@ -143,7 +143,7 @@ static void init_control_bitmap(reiserfs_filsys_t *fs)
|
||||
if (!control_bitmap)
|
||||
die("init_control_bitmap: Failed to allocate a control bitmap.");
|
||||
|
||||
/*printf ("Initially number of zeros in control bitmap %d\n",
|
||||
/*printf ("Initially number of zeros in control bitmap %d\n",
|
||||
reiserfs_bitmap_zeros (control_bitmap)); */
|
||||
|
||||
/* skipped and super block */
|
||||
@@ -214,7 +214,7 @@ static void handle_bitmaps(reiserfs_filsys_t *fs)
|
||||
if (get_sb_free_blocks(fs->fs_ondisk_sb) !=
|
||||
reiserfs_bitmap_zeros(control_bitmap)) {
|
||||
/* fsck_log ("vpf-10630: The count of free blocks in the on-disk bitmap "
|
||||
"(%lu) mismatches with the correct one (%lu).\n",
|
||||
"(%lu) mismatches with the correct one (%lu).\n",
|
||||
get_sb_free_blocks (fs->fs_ondisk_sb),
|
||||
reiserfs_bitmap_zeros (control_bitmap));
|
||||
*/
|
||||
@@ -230,11 +230,11 @@ static void handle_bitmaps(reiserfs_filsys_t *fs)
|
||||
("vpf-10630: The on-disk and the correct bitmaps differs. "
|
||||
"Will be fixed later.\n");
|
||||
// fsck_progress ("Trying to fix bitmap ..\n");
|
||||
/* mark blocks as used in source bitmap if they are used in
|
||||
/* mark blocks as used in source bitmap if they are used in
|
||||
control bitmap */
|
||||
reiserfs_bitmap_disjunction(source_bitmap,
|
||||
control_bitmap);
|
||||
/* change used blocks count accordinly source bitmap, copy bitmap
|
||||
/* change used blocks count accordinly source bitmap, copy bitmap
|
||||
changes to on_disk bitmap */
|
||||
set_sb_free_blocks(fs->fs_ondisk_sb,
|
||||
reiserfs_bitmap_zeros
|
||||
@@ -242,13 +242,13 @@ static void handle_bitmaps(reiserfs_filsys_t *fs)
|
||||
reiserfs_bitmap_copy(fs->fs_bitmap2, source_bitmap);
|
||||
mark_buffer_dirty(fs->fs_super_bh);
|
||||
/*
|
||||
// check again
|
||||
if ((diff = reiserfs_bitmap_compare(source_bitmap,
|
||||
control_bitmap)) != 0)
|
||||
// check again
|
||||
if ((diff = reiserfs_bitmap_compare(source_bitmap,
|
||||
control_bitmap)) != 0)
|
||||
{
|
||||
// do not mark them as fatal or fixable because one can live
|
||||
// with leaked space. So this is not a fatal corruption, and
|
||||
// fix-fixable cannot fix it
|
||||
// do not mark them as fatal or fixable because one can live
|
||||
// with leaked space. So this is not a fatal corruption, and
|
||||
// fix-fixable cannot fix it
|
||||
fsck_progress (" bitmaps were not recovered.\n\tYou can either "
|
||||
"run rebuild-tree or live with %d leaked blocks\n", diff);
|
||||
} else {
|
||||
@@ -259,7 +259,7 @@ static void handle_bitmaps(reiserfs_filsys_t *fs)
|
||||
fsck_log
|
||||
("vpf-10640: The on-disk and the correct bitmaps differs.\n");
|
||||
while (problem) {
|
||||
/* fixable corruptions because we can try to recover them
|
||||
/* fixable corruptions because we can try to recover them
|
||||
without rebuilding the tree */
|
||||
one_more_corruption(fs, FIXABLE);
|
||||
problem--;
|
||||
@@ -355,12 +355,12 @@ static int bad_stat_data(reiserfs_filsys_t *fs,
|
||||
objectid);
|
||||
#if 0
|
||||
to_be_relocated(&ih->ih_key);
|
||||
// one_more_corruption (fs, FIXABLE);
|
||||
// one_more_corruption (fs, FIXABLE);
|
||||
#endif
|
||||
}
|
||||
|
||||
return 0;
|
||||
/* Check this on semantic_check pass.
|
||||
/* Check this on semantic_check pass.
|
||||
|
||||
sd = (struct stat_data *)B_I_PITEM(bh,ih);
|
||||
get_sd_nlink (ih, sd, &links);
|
||||
@@ -420,7 +420,7 @@ static int bad_badblocks_item(reiserfs_filsys_t *fs, struct buffer_head *bh,
|
||||
if (!d32_get(ind, i)) {
|
||||
/* fsck_log ("%s: block %lu: badblocks item (%H) has zero pointer.",
|
||||
__FUNCTION__, bh->b_blocknr, ih);
|
||||
|
||||
|
||||
if (fsck_mode(fs) != FSCK_FIX_FIXABLE) {
|
||||
fsck_log("Not an error, but could be deleted with --fix-fixable\n");
|
||||
} else {
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -173,7 +173,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);
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
|
||||
+8
-8
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -56,7 +56,7 @@ fsck_progress ("Usage: %s [mode] [options] " \
|
||||
badblocks, adds badblocks to badblock list in fs.
|
||||
and with --rebuild
|
||||
builds the tree without pointers to badblocks (internal,
|
||||
indirect), adds badblocks to badblock list in fs.
|
||||
indirect), adds badblocks to badblock list in fs.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -273,7 +273,7 @@ static char *parse_options(struct fsck_data *data, int argc, char *argv[])
|
||||
|
||||
/*
|
||||
if (data->options & OPT_ADJUST_FILE_SIZE) {
|
||||
if ((mode != FSCK_REBUILD) && (mode != FSCK_FIX_FIXABLE))
|
||||
if ((mode != FSCK_REBUILD) && (mode != FSCK_FIX_FIXABLE))
|
||||
print_usage_and_exit();
|
||||
}
|
||||
*/
|
||||
@@ -637,7 +637,7 @@ static int where_to_start_from(reiserfs_filsys_t *fs)
|
||||
if (last_run_state == 0 || !fsck_run_one_step(fs))
|
||||
/**/ return START_FROM_THE_BEGINNING;
|
||||
|
||||
/* We are able to perform the next step only if there is a file with the previous
|
||||
/* We are able to perform the next step only if there is a file with the previous
|
||||
* step results. */
|
||||
fp = open_file(state_dump_file(fs), "r");
|
||||
if (fp == 0) {
|
||||
@@ -747,7 +747,7 @@ static void mark_filesystem_consistent(reiserfs_filsys_t *fs)
|
||||
("WARNING: You must use reiserfstune to specify a new "
|
||||
"journal before mounting it.\n");
|
||||
|
||||
/* mark filesystem such that it is not mountable until
|
||||
/* mark filesystem such that it is not mountable until
|
||||
* new journaldevice is defined */
|
||||
set_jp_journal_magic(sb_jp(fs->fs_ondisk_sb), NEED_TUNE);
|
||||
}
|
||||
@@ -764,7 +764,7 @@ 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);
|
||||
|
||||
/* keep the super_block in the separate memory to avoid problems with replaying
|
||||
/* keep the super_block in the separate memory to avoid problems with replaying
|
||||
* broken parameters. */
|
||||
on_place_sb = (struct reiserfs_super_block *)fs->fs_super_bh->b_data;
|
||||
fs->fs_ondisk_sb = getmem(sb_size);
|
||||
@@ -1197,7 +1197,7 @@ static void check_fs(reiserfs_filsys_t *fs)
|
||||
} else if (fsck_data(fs)->check.fixable_corruptions) {
|
||||
/* fixable corruptions found */
|
||||
if (fsck_mode(fs) == FSCK_FIX_FIXABLE) {
|
||||
/* fixable corruptions found and fix-fixable has not fixed them,
|
||||
/* fixable corruptions found and fix-fixable has not fixed them,
|
||||
* do rebuild-tree */
|
||||
|
||||
fsck_progress
|
||||
@@ -1240,7 +1240,7 @@ static void check_fs(reiserfs_filsys_t *fs)
|
||||
id_map_free(proper_id_map(fs));
|
||||
clean_after_dma_check(fs->fs_dev, &dma_info);
|
||||
|
||||
//clear_relocated_list();
|
||||
//clear_relocated_list();
|
||||
|
||||
time(&t);
|
||||
fsck_progress("###########\n"
|
||||
|
||||
+10
-10
@@ -1,15 +1,15 @@
|
||||
/*
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
#include "fsck.h"
|
||||
|
||||
/*
|
||||
* Pass0 scans the used part of the partition. It creates two maps which will
|
||||
* be used on the pass 1. These are a map of nodes looking like leaves and
|
||||
* a map of "bad" unformatted nodes. After pass 0 we can detect unformatted
|
||||
* node pointers pointing to leaves.
|
||||
/*
|
||||
* Pass0 scans the used part of the partition. It creates two maps which will
|
||||
* be used on the pass 1. These are a map of nodes looking like leaves and
|
||||
* a map of "bad" unformatted nodes. After pass 0 we can detect unformatted
|
||||
* node pointers pointing to leaves.
|
||||
*/
|
||||
|
||||
/* leaves */
|
||||
@@ -323,7 +323,7 @@ static int verify_directory_item(reiserfs_filsys_t *fs, struct buffer_head *bh,
|
||||
/*
|
||||
if (not_of_one_file (&(deh[i].deh2_dir_id), &(ih->ih_key))) {
|
||||
fsck_log ("verify_direntry: block %lu, item %H has entry \".\" "
|
||||
"pointing to (%K) instead of (%K)\n",
|
||||
"pointing to (%K) instead of (%K)\n",
|
||||
bh->b_blocknr, ih,
|
||||
&(deh[i].deh2_dir_id), &(ih->ih_key));
|
||||
set_deh_dirid (deh + i, get_key_dirid (&ih->ih_key));
|
||||
@@ -588,7 +588,7 @@ static int verify_directory_item(reiserfs_filsys_t *fs, struct buffer_head *bh,
|
||||
|
||||
static __inline__ int does_it_fit_into_dev(__u64 offset, __u64 fs_size)
|
||||
{
|
||||
/*
|
||||
/*
|
||||
Count of unformatted pointers - offset / blocksize
|
||||
Count of blocks to store them - UNFM_P_SIZE * offset / blocksize / MAX_ITEM_LEN
|
||||
Size to store it - blocksize * UNFM_P_SIZE * offset / blocksize / MAX_ITEM_LEN
|
||||
@@ -745,7 +745,7 @@ start_again:
|
||||
bh->b_blocknr, i, ih);
|
||||
return;
|
||||
}
|
||||
// delete last item
|
||||
// delete last item
|
||||
fsck_log ("block %lu: item %d: (%H) id equals 0\n",
|
||||
bh->b_blocknr, i, ih);
|
||||
delete_item (fs, bh, i - 1);
|
||||
@@ -1161,7 +1161,7 @@ start_again:
|
||||
}
|
||||
}
|
||||
|
||||
/* this recovers corruptions like the below:
|
||||
/* this recovers corruptions like the below:
|
||||
1774 1732 0 0
|
||||
116262638 1732 1 3
|
||||
1774 1736 0 0 */
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
#include "fsck.h"
|
||||
@@ -780,7 +780,7 @@ static void after_pass_1(reiserfs_filsys_t *fs)
|
||||
/* update fsck_state */
|
||||
|
||||
/* we should not flush bitmaps on disk after pass1, because
|
||||
new_bitmap contains only those blocks which are good leaves or
|
||||
new_bitmap contains only those blocks which are good leaves or
|
||||
just allocated internal blocks. */
|
||||
|
||||
set_sb_fs_state(fs->fs_ondisk_sb, PASS_1_DONE);
|
||||
|
||||
+9
-9
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -78,7 +78,7 @@ static __u64 link_one(struct relocated *file)
|
||||
set_key_dirid(&obj_key, file->old_dir_id);
|
||||
set_key_objectid(&obj_key, file->new_objectid);
|
||||
|
||||
/* 0 for fsck_need does not mean too much - it would make effect if there
|
||||
/* 0 for fsck_need does not mean too much - it would make effect if there
|
||||
* were no this directory yet. But /lost_found is there already */
|
||||
len = reiserfs_add_entry(fs, &lost_found_dir_key, name,
|
||||
name_length(name, lost_found_dir_format),
|
||||
@@ -477,7 +477,7 @@ void load_pass_2_result(reiserfs_filsys_t *fs)
|
||||
/* we need objectid map on semantic pass to be able to relocate files */
|
||||
proper_id_map(fs) = id_map_init();
|
||||
/* Not implemented yet.
|
||||
fetch_objectid_map (proper_id_map (fs), fs);
|
||||
fetch_objectid_map (proper_id_map (fs), fs);
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -556,17 +556,17 @@ static void after_pass_2(reiserfs_filsys_t *fs)
|
||||
{
|
||||
time_t t;
|
||||
|
||||
/* we can now flush new_bitmap on disk as tree is built and
|
||||
contains all data, which were found on dik at start in
|
||||
/* we can now flush new_bitmap on disk as tree is built and
|
||||
contains all data, which were found on dik at start in
|
||||
used bitmaps */
|
||||
reiserfs_bitmap_copy(fs->fs_bitmap2, fsck_new_bitmap(fs));
|
||||
|
||||
/* we should copy new_bitmap to allocable bitmap, becuase evth what is used
|
||||
/* we should copy new_bitmap to allocable bitmap, becuase evth what is used
|
||||
for now (marked as used in new_bitmap) should not be allocablel;
|
||||
and what is not in tree for now should be allocable.
|
||||
these bitmaps differ because on pass2 we skip those blocks, whose SD's
|
||||
are not in the tree, and therefore indirect items of such bad leaves points
|
||||
to not used and not allocable blocks.
|
||||
these bitmaps differ because on pass2 we skip those blocks, whose SD's
|
||||
are not in the tree, and therefore indirect items of such bad leaves points
|
||||
to not used and not allocable blocks.
|
||||
*/
|
||||
|
||||
/* DEBUG only */
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ static int check_check_regular_file(struct reiserfs_path *path, void *sd,
|
||||
|
||||
/*
|
||||
if (fsck_mode (fs) == FSCK_FIX_FIXABLE) {
|
||||
// check and set nlink first
|
||||
// check and set nlink first
|
||||
nlink ++;
|
||||
set_sd_nlink (ih, sd, &nlink);
|
||||
mark_buffer_dirty (bh);
|
||||
@@ -429,8 +429,8 @@ static int check_semantic_pass(struct reiserfs_key *key,
|
||||
|
||||
get_sd_nlink(ih, sd, &nlink);
|
||||
|
||||
/* It seems quite difficult to relocate objects on fix-fixable -
|
||||
* rewrite_file calls reiserfs_file_write which can convert tails
|
||||
/* It seems quite difficult to relocate objects on fix-fixable -
|
||||
* rewrite_file calls reiserfs_file_write which can convert tails
|
||||
* to unfm, plus unreachable, was_tail flags, etc. */
|
||||
#if 0
|
||||
if (( /* relocate = */ should_be_relocated(&ih->ih_key))) {
|
||||
@@ -483,17 +483,17 @@ static int check_semantic_pass(struct reiserfs_key *key,
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
if (fsck_mode (fs) == FSCK_FIX_FIXABLE) {
|
||||
// it looks like stat data of a directory found
|
||||
// it looks like stat data of a directory found
|
||||
if (nlink) {
|
||||
// we saw this directory already
|
||||
// we saw this directory already
|
||||
if (!dot_dot) {
|
||||
// this name is not ".." - and hard links are not allowed on directories
|
||||
// this name is not ".." - and hard links are not allowed on directories
|
||||
pathrelse (&path);
|
||||
return STAT_DATA_NOT_FOUND;
|
||||
} else {
|
||||
// ".." found
|
||||
// ".." found
|
||||
nlink ++;
|
||||
set_sd_nlink (ih, sd, &nlink);
|
||||
mark_buffer_dirty (get_bh (&path));
|
||||
@@ -506,7 +506,7 @@ static int check_semantic_pass(struct reiserfs_key *key,
|
||||
if (get_key_objectid (key) == REISERFS_ROOT_OBJECTID)
|
||||
nlink ++;
|
||||
set_sd_nlink (ih, sd, &nlink);
|
||||
mark_buffer_dirty (get_bh (&path));
|
||||
mark_buffer_dirty (get_bh (&path));
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -868,7 +868,7 @@ start_again: /* when directory was relocated */
|
||||
|
||||
nlink = 0;
|
||||
set_sd_nlink (ih, sd, &nlink);
|
||||
|
||||
|
||||
retval = rebuild_check_regular_file (&path, sd, 0); //no relocate
|
||||
pathrelse (&path);
|
||||
return retval;
|
||||
@@ -1224,7 +1224,7 @@ static void make_sure_lost_found_exists(reiserfs_filsys_t *fs)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Result of the rebuild pass will be saved in the state file which is needed to start
|
||||
/* 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)
|
||||
{
|
||||
@@ -1266,7 +1266,7 @@ void load_semantic_result(FILE * file, reiserfs_filsys_t *fs)
|
||||
|
||||
/* we need objectid map on semantic pass to be able to relocate files */
|
||||
proper_id_map(fs) = id_map_init();
|
||||
/* Not implemented yet.
|
||||
/* Not implemented yet.
|
||||
fetch_objectid_map (proper_id_map (fs), fs);
|
||||
semantic_id_map (fs) = reiserfs_objectid_map_load (file);
|
||||
*/
|
||||
|
||||
+47
-47
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2001-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 2001-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -37,11 +37,11 @@ int what_fs_version()
|
||||
fsck_log(text); \
|
||||
return exit_code; \
|
||||
}
|
||||
|
||||
|
||||
int check_sb (reiserfs_filsys_t *fs) {
|
||||
int magic = 0, version = 0;
|
||||
|
||||
if (!is_blocksize_correct (fs->fs_blocksize))
|
||||
|
||||
if (!is_blocksize_correct (fs->fs_blocksize))
|
||||
super_error(-1, "Wrong blocksize found in the super block\n");
|
||||
|
||||
if (is_reiserfs_3_6_magic_string (sb))
|
||||
@@ -50,9 +50,9 @@ int check_sb (reiserfs_filsys_t *fs) {
|
||||
magic = 1;
|
||||
else if (is_reiserfs_jr_magic_string (sb))
|
||||
magic = 3;
|
||||
else
|
||||
else
|
||||
super_error(-1, "Invalid magic found in the super block.\n");
|
||||
|
||||
|
||||
if (magic == 1 || magic == 2) {
|
||||
if (fsck_data (fs)->journal_dev_name)
|
||||
fsck_log("Reiserfs with standard journal found, but there was specified a "
|
||||
@@ -60,69 +60,69 @@ int check_sb (reiserfs_filsys_t *fs) {
|
||||
|
||||
standard_journal = 1;
|
||||
} else {
|
||||
if (!fsck_data (fs)->journal_dev_name)
|
||||
if (!fsck_data (fs)->journal_dev_name)
|
||||
super_error(-1, "Reiserfs with non standard journal found, but there was not "
|
||||
"specified any journal dev\n");
|
||||
|
||||
standard_journal = 0;
|
||||
}
|
||||
|
||||
if (get_sb_version (sb) != REISERFS_FORMAT_3_6 && get_sb_version (sb) != REISERFS_FORMAT_3_5)
|
||||
|
||||
if (get_sb_version (sb) != REISERFS_FORMAT_3_6 && get_sb_version (sb) != REISERFS_FORMAT_3_5)
|
||||
super_error(-1, "Invalid format found in the super block.\n");
|
||||
|
||||
if (is_new_sb_location(fs->fs_super_bh->b_blocknr, fs->fs_blocksize))
|
||||
if (is_new_sb_location(fs->fs_super_bh->b_blocknr, fs->fs_blocksize))
|
||||
{
|
||||
if (magic == 3)
|
||||
if (magic == 3)
|
||||
version = get_sb_version (sb) == REISERFS_FORMAT_3_6 ? 1 : 2;
|
||||
else
|
||||
version = magic == 2 ? 1 : 2;
|
||||
} else if (is_old_sb_location(fs->fs_super_bh->b_blocknr, fs->fs_blocksize)) {
|
||||
if (magic == 3)
|
||||
if (magic == 3)
|
||||
version = get_sb_version (sb) == REISERFS_FORMAT_3_6 ? 3 : 4;
|
||||
else
|
||||
else
|
||||
version = magic == 2 ? 3 : 4;
|
||||
} else
|
||||
} else
|
||||
die("Super block in the wong block(%d).\n", fs->fs_super_bh->b_blocknr);
|
||||
|
||||
if (version == 0)
|
||||
|
||||
if (version == 0)
|
||||
die ("FS format must be figured out here.\n");
|
||||
|
||||
if (get_sb_block_count (sb) > count_blocks (filename, fs->fs_blocksize))
|
||||
if (get_sb_block_count (sb) > count_blocks (filename, fs->fs_blocksize))
|
||||
super_error(-1, "Invalid block count found in the super block.\n");
|
||||
|
||||
if (get_sb_block_size (sb) != fs->fs_blocksize)
|
||||
super_error(-1, "Invalid block size found in the super block (%lu).\n",
|
||||
if (get_sb_block_size (sb) != fs->fs_blocksize)
|
||||
super_error(-1, "Invalid block size found in the super block (%lu).\n",
|
||||
get_sb_block_size (sb));
|
||||
|
||||
//Non needed from here
|
||||
p_oid_maxsize = (fs->fs_blocksize - reiserfs_super_block_size (sb)) / sizeof(__u32) / 2 * 2;
|
||||
if (get_sb_oid_maxsize (sb) != p_oid_maxsize)
|
||||
super_error(-1, "Invalid objectid map max size found in the super block (%lu).\n",
|
||||
p_oid_maxsize = (fs->fs_blocksize - reiserfs_super_block_size (sb)) / sizeof(__u32) / 2 * 2;
|
||||
if (get_sb_oid_maxsize (sb) != p_oid_maxsize)
|
||||
super_error(-1, "Invalid objectid map max size found in the super block (%lu).\n",
|
||||
get_sb_oid_maxsize (sb));
|
||||
|
||||
if (get_sb_oid_cursize (sb) == 1 || get_sb_oid_cursize (sb) > get_sb_oid_maxsize (sb))
|
||||
super_error(-1, "Invalid objectid map found in the super block (%lu).\n",
|
||||
super_error(-1, "Invalid objectid map found in the super block (%lu).\n",
|
||||
get_sb_oid_cursize (sb));
|
||||
|
||||
if (get_sb_root_block (sb) > block_count && get_sb_root_block (sb) != ~0)
|
||||
fsck_log("Invalid root block found in the super block (%lu).\n",
|
||||
if (get_sb_root_block (sb) > block_count && get_sb_root_block (sb) != ~0)
|
||||
fsck_log("Invalid root block found in the super block (%lu).\n",
|
||||
get_sb_root_block (sb));
|
||||
|
||||
if (get_sb_free_blocks (sb) > block_count)
|
||||
fsck_log ("Invalid free block count found in the super block (%lu).\n",
|
||||
if (get_sb_free_blocks (sb) > block_count)
|
||||
fsck_log ("Invalid free block count found in the super block (%lu).\n",
|
||||
get_sb_free_blocks (sb));
|
||||
|
||||
if (get_sb_tree_height (sb) && ((get_sb_tree_height (sb) < DISK_LEAF_NODE_LEVEL + 1) ||
|
||||
(get_sb_tree_height (sb) > MAX_HEIGHT) && (get_sb_tree_height (sb) != ~0)))
|
||||
super_error(-1, "Invalid tree height found in the super block (%lu).\n",
|
||||
(get_sb_tree_height (sb) > MAX_HEIGHT) && (get_sb_tree_height (sb) != ~0)))
|
||||
super_error(-1, "Invalid tree height found in the super block (%lu).\n",
|
||||
get_sb_tree_height (sb));
|
||||
|
||||
if (get_sb_hash_code (sb) && code2name (get_sb_hash_code (sb)) == 0)
|
||||
super_error(-1, "Invalid hash found in the super block (%lu).\n",
|
||||
if (get_sb_hash_code (sb) && code2name (get_sb_hash_code (sb)) == 0)
|
||||
super_error(-1, "Invalid hash found in the super block (%lu).\n",
|
||||
get_sb_hash_code (sb));
|
||||
|
||||
if (version == 1 || version == 3) {
|
||||
if (!uuid_is_correct(sb->s_uuid))
|
||||
if (!uuid_is_correct(sb->s_uuid))
|
||||
fsck_log ("Invalid uuid found, you should generate a new one.\n");
|
||||
|
||||
if (sb->s_flags & 0xfffffffe)
|
||||
@@ -132,21 +132,21 @@ int check_sb (reiserfs_filsys_t *fs) {
|
||||
//Not needed till here.
|
||||
|
||||
p_bmap_nr = (block_count + (fs->fs_blocksize * 8 - 1)) / (fs->fs_blocksize * 8);
|
||||
if (get_sb_bmap_nr (sb) != p_bmap_nr)
|
||||
super_error(-1, "Invalid bitmap number found in the super block (%lu).\n",
|
||||
if (get_sb_bmap_nr (sb) != p_bmap_nr)
|
||||
super_error(-1, "Invalid bitmap number found in the super block (%lu).\n",
|
||||
get_sb_bmap_nr (sb));
|
||||
|
||||
if (!fsck_skip_journal (fs) && standard_journal == 1) {
|
||||
if (get_jp_journal_dev (sb_jp(sb)) != 0)
|
||||
super_error(-1, "Invalid journal device found (%lu).\n", get_jp_journal_dev (sb_jp(sb)));
|
||||
|
||||
if (get_jp_journal_1st_block (sb_jp(sb)) != get_journal_start_must (fs))
|
||||
if (get_jp_journal_1st_block (sb_jp(sb)) != get_journal_start_must (fs))
|
||||
super_error(-1, "Invalid journal first block found (%lu).\n", get_jp_journal_1st_block (sb_jp(sb)));
|
||||
|
||||
if (get_jp_journal_size (sb_jp(sb)) != journal_default_size(fs->fs_super_bh->b_blocknr, fs->fs_blocksize))
|
||||
if (get_jp_journal_size (sb_jp(sb)) != journal_default_size(fs->fs_super_bh->b_blocknr, fs->fs_blocksize))
|
||||
super_error(-1, "Invalid journal size found (%lu).\n", get_jp_journal_size (sb_jp(sb)) + 1);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (get_jp_journal_max_batch (sb_jp(sb)) != advise_journal_max_batch(get_jp_journal_max_trans_len (sb_jp(sb)))) {
|
||||
fsck_conditional_log (magic_was_found, "rebuild-sb: wrong journal max batch size occured (%lu), fixed (%d)\n",
|
||||
@@ -164,7 +164,7 @@ int check_sb (reiserfs_filsys_t *fs) {
|
||||
set_jp_journal_max_trans_age (sb_jp(sb), advise_journal_max_trans_age());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -342,7 +342,7 @@ void rebuild_sb(reiserfs_filsys_t *fs, char *filename, struct fsck_data *data)
|
||||
}
|
||||
}
|
||||
|
||||
/* if no reiserfs_found or bad data found in that SB, what was checked in previous
|
||||
/* if no reiserfs_found or bad data found in that SB, what was checked in previous
|
||||
* clause */
|
||||
if (no_reiserfs_found(fs)) {
|
||||
int fd;
|
||||
@@ -638,7 +638,7 @@ void rebuild_sb(reiserfs_filsys_t *fs, char *filename, struct fsck_data *data)
|
||||
|
||||
retval = 0;
|
||||
if (magic_was_found) {
|
||||
/* Super block was found. Try to open the journal on the base of its
|
||||
/* Super block was found. Try to open the journal on the base of its
|
||||
* journal parameters. */
|
||||
|
||||
retval = reiserfs_open_journal(fs, journal_dev_name,
|
||||
@@ -654,8 +654,8 @@ void rebuild_sb(reiserfs_filsys_t *fs, char *filename, struct fsck_data *data)
|
||||
sizeof(struct journal_params));
|
||||
|
||||
if (retval) {
|
||||
/* journal parameters from the SB and from the J_Header does not
|
||||
* match. Close the jouranl, ask the user about correct journal
|
||||
/* journal parameters from the SB and from the J_Header does not
|
||||
* match. Close the jouranl, ask the user about correct journal
|
||||
* parameters. */
|
||||
reiserfs_close_journal(fs);
|
||||
}
|
||||
@@ -713,7 +713,7 @@ void rebuild_sb(reiserfs_filsys_t *fs, char *filename, struct fsck_data *data)
|
||||
}
|
||||
|
||||
/* default size if magic was not found is device size - journal_1st_block;
|
||||
default size if magic was found is found value + 1 block for journal
|
||||
default size if magic was found is found value + 1 block for journal
|
||||
header */
|
||||
if (magic_was_found == 0)
|
||||
default_value =
|
||||
@@ -772,7 +772,7 @@ void rebuild_sb(reiserfs_filsys_t *fs, char *filename, struct fsck_data *data)
|
||||
exit(retval < 0 ? EXIT_OPER : EXIT_USER);
|
||||
}
|
||||
|
||||
/* SB was found, but journal params were broken and have been recovered.
|
||||
/* SB was found, but journal params were broken and have been recovered.
|
||||
* Futher work goes as SB would not be found. */
|
||||
magic_was_found = 0;
|
||||
}
|
||||
@@ -791,7 +791,7 @@ void rebuild_sb(reiserfs_filsys_t *fs, char *filename, struct fsck_data *data)
|
||||
}
|
||||
|
||||
if (reiserfs_journal_opened(fs)) {
|
||||
/* Journal was openned. Check/fix journal parameters and copy it the journal
|
||||
/* Journal was openned. Check/fix journal parameters and copy it the journal
|
||||
* header. */
|
||||
|
||||
if (get_jp_journal_max_trans_len(sb_jp(sb)) !=
|
||||
@@ -922,7 +922,7 @@ void rebuild_sb(reiserfs_filsys_t *fs, char *filename, struct fsck_data *data)
|
||||
}
|
||||
}
|
||||
|
||||
/* whether journal header contains params with the same dev, offset, size will be
|
||||
/* whether journal header contains params with the same dev, offset, size will be
|
||||
checked in open_journal */
|
||||
|
||||
if (version == 1 || version == 3)
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
g_new_bitmap initially has marked only super block, bitmap blocks
|
||||
and bits after the end of bitmap
|
||||
|
||||
in pass 1 we go through g_disk_bitmap.
|
||||
in pass 1 we go through g_disk_bitmap.
|
||||
|
||||
If block does not look like formatted node, we skip it.
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
Allocating of new blocks: look for 0 bit in g_disk_bitmap
|
||||
(find_zero_bit_in_bitmap), make sure, that g_new_bitmap contains 0
|
||||
at the corresponding bit (is_block_used).
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/* is blocks used (marked by 1 in new bitmap) in the tree which is being built
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -77,7 +77,7 @@ static unsigned long indirect_to_direct(struct reiserfs_path *path, __u64 len,
|
||||
"Cutting it down to %d byte\n", len, &ih->ih_key, MAX_DIRECT_ITEM_LEN (fs->fs_blocksize) - 8);
|
||||
len = MAX_DIRECT_ITEM_LEN (fs->fs_blocksize) - 8;
|
||||
}
|
||||
|
||||
|
||||
if (!len) {
|
||||
buf = bad_link;
|
||||
len = strlen (bad_link);
|
||||
@@ -464,7 +464,7 @@ int are_file_items_correct(struct item_head *sd_ih, void *sd, __u64 * size,
|
||||
/*
|
||||
if (get_offset (&ih->ih_key) + get_bytes_number (ih, fs->fs_blocksize) != get_offset (next_key))
|
||||
{
|
||||
// indirect item free space is not set properly
|
||||
// indirect item free space is not set properly
|
||||
if (!is_indirect_ih (ih) ) //|| get_ih_free_space(ih) == 0)
|
||||
fsck_log ("are_file_items_correct: "
|
||||
"item must be indirect and must have invalid free space (%H)", ih);
|
||||
@@ -1299,7 +1299,7 @@ check_again:
|
||||
relocated = 1;
|
||||
|
||||
/* object has been relocated but we should not mark it as used in semantic map,
|
||||
as it does not exist at pass2 and we do not get here for relocation as
|
||||
as it does not exist at pass2 and we do not get here for relocation as
|
||||
was_in_tree == 1 */
|
||||
|
||||
goto check_again;
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -293,7 +293,7 @@ void fetch_objectid_map (struct id_map * map, reiserfs_filsys_t *fs)
|
||||
|
||||
if (map->m_page_count != 1)
|
||||
die ("fetch_objectid_map: can not fetch long map");
|
||||
|
||||
|
||||
make_id_space(map, 0);
|
||||
memcpy (map->m_begin, sb_objectid_map, get_sb_oid_cursize (fs->fs_ondisk_sb) * sizeof (__u32));
|
||||
map->m_used_slot_count = get_sb_oid_cursize (fs->fs_ondisk_sb);
|
||||
@@ -337,7 +337,7 @@ struct id_map * reiserfs_objectid_map_load (FILE * fp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
// read bit size of objectid map
|
||||
// read bit size of objectid map
|
||||
fread (&v, 4, 1, fp);
|
||||
|
||||
id_map = init_id_map (MAP_NOT_PACKED);
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
|
||||
Reference in new issue
Block a user