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
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -47,12 +47,12 @@ Options:\n\
|
||||
-v\tverboes unpack, prints the block number of every block being unpacked\n\
|
||||
-Z\tzero all data.
|
||||
|
||||
To build a map of a file blocks by name:
|
||||
debugreiserfs device -a mapfile -n filename
|
||||
|
||||
To build a map of a file blocks by key:
|
||||
debugreiserfs device -a mapfile -k
|
||||
|
||||
To build a map of a file blocks by name:
|
||||
debugreiserfs device -a mapfile -n filename
|
||||
|
||||
To build a map of a file blocks by key:
|
||||
debugreiserfs device -a mapfile -k
|
||||
|
||||
To extract some:
|
||||
debugreiserfs device -a mapfile -r filename > backup
|
||||
*/
|
||||
@@ -318,7 +318,7 @@ static char *parse_options(struct debugreiserfs_data *data,
|
||||
break;
|
||||
|
||||
case 'k':
|
||||
/* read the device and print reiserfs blocks which contain
|
||||
/* read the device and print reiserfs blocks which contain
|
||||
defined key */
|
||||
data->mode = DO_SCAN;
|
||||
break;
|
||||
@@ -348,7 +348,7 @@ static char *parse_options(struct debugreiserfs_data *data,
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
/* print leaf details accordingly the bitmap - can be used
|
||||
/* print leaf details accordingly the bitmap - can be used
|
||||
with -S */
|
||||
data->options |= PRINT_DETAILS;
|
||||
break;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
#define _GNU_SOURCE
|
||||
@@ -50,10 +50,10 @@ extern reiserfs_filsys_t *fs;
|
||||
#define BE_VERBOSE 0x200
|
||||
|
||||
/* these moved to reiserfs_fs.h */
|
||||
//#define PRINT_TREE_DETAILS
|
||||
//#define PRINT_DETAILS
|
||||
//#define PRINT_ITEM_DETAILS
|
||||
//#define PRINT_DIRECT_ITEMS
|
||||
//#define PRINT_TREE_DETAILS
|
||||
//#define PRINT_DETAILS
|
||||
//#define PRINT_ITEM_DETAILS
|
||||
//#define PRINT_DIRECT_ITEMS
|
||||
|
||||
// the leaf is stored in compact form:
|
||||
// start magic number
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
|
||||
+10
-10
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -166,7 +166,7 @@ static void read_map (FILE * fp)
|
||||
if (v32 != MAP_MAGIC)
|
||||
reiserfs_panic ("read_map: no magic found");
|
||||
|
||||
// device name length and name itself
|
||||
// device name length and name itself
|
||||
fread (&v32, sizeof (v32), 1, fp);
|
||||
buf = realloc (buf, v32);
|
||||
if (!buf)
|
||||
@@ -181,7 +181,7 @@ static void read_map (FILE * fp)
|
||||
reiserfs_panic ("realloc failed");
|
||||
fread (buf, v32, 1, fp);
|
||||
|
||||
// read directory key and poined object key
|
||||
// read directory key and poined object key
|
||||
fread (ids, sizeof (ids), 1, fp);
|
||||
reiserfs_warning (stdout, "[%K]:\"%s\"-->[%K]\n",
|
||||
&ids[0], buf, &ids[2]);
|
||||
@@ -192,16 +192,16 @@ static void read_map (FILE * fp)
|
||||
// reiserfs_warning (stderr, "recovering not ready\n");
|
||||
|
||||
|
||||
// how many data blocks are there
|
||||
// how many data blocks are there
|
||||
fread (&v32, sizeof (v32), 1, fp);
|
||||
if (v32) {
|
||||
buf = realloc (buf, v32 * 4);
|
||||
if (!buf)
|
||||
reiserfs_panic ("realloc failed (%u)", v32);
|
||||
|
||||
// read list of data block numbers
|
||||
|
||||
// read list of data block numbers
|
||||
fread (buf, 4, v32, fp);
|
||||
|
||||
|
||||
if (!do_recover) {
|
||||
for (i = 0; i < v32; i ++)
|
||||
reiserfs_warning (stdout, "%d ", ((__u32 *)buf)[i]);
|
||||
@@ -209,10 +209,10 @@ static void read_map (FILE * fp)
|
||||
}
|
||||
}
|
||||
|
||||
// main tail length
|
||||
// main tail length
|
||||
fread (&v32, sizeof (v32), 1, fp);
|
||||
if (v32) {
|
||||
// there is tail
|
||||
// there is tail
|
||||
buf = realloc (buf, v32);
|
||||
if (!buf)
|
||||
reiserfs_panic ("realloc failed");
|
||||
@@ -253,7 +253,7 @@ void do_recover (reiserfs_filsys_t *fs)
|
||||
|
||||
if (fp != stdin)
|
||||
fclose (fp);
|
||||
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
+25
-25
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -405,7 +405,7 @@ static int have_to_append(struct item_head *ih)
|
||||
|
||||
tail_start = (off & ~(fs->fs_blocksize - 1)) + 1;
|
||||
|
||||
// find correct tail first
|
||||
// find correct tail first
|
||||
for (i = 0; i < map.tail_nr; i++) {
|
||||
if (map.tails[i].offset == tail_start) {
|
||||
if (map.tails[i].offset + map.tails[i].len <=
|
||||
@@ -414,7 +414,7 @@ static int have_to_append(struct item_head *ih)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
// there was no this tail yet
|
||||
// there was no this tail yet
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@@ -442,7 +442,7 @@ static void do_append(struct item_head *ih, void *data)
|
||||
} else if (is_direct_ih(ih)) {
|
||||
unsigned int tail_start, skip;
|
||||
|
||||
// find correct tail first
|
||||
// find correct tail first
|
||||
tail_start = (off & ~(fs->fs_blocksize - 1)) + 1;
|
||||
skip = (off - 1) & (fs->fs_blocksize - 1);
|
||||
for (i = 0; i < map.tail_nr; i++) {
|
||||
@@ -463,7 +463,7 @@ static void do_append(struct item_head *ih, void *data)
|
||||
return;
|
||||
}
|
||||
}
|
||||
// allocate memory for new tail
|
||||
// allocate memory for new tail
|
||||
map.tails =
|
||||
realloc(map.tails, (map.tail_nr + 1) * sizeof(struct tail));
|
||||
if (!map.tails)
|
||||
@@ -480,7 +480,7 @@ static void do_append(struct item_head *ih, void *data)
|
||||
}
|
||||
}
|
||||
|
||||
// map contains
|
||||
// map contains
|
||||
static void do_overwrite(struct item_head *ih, void *data)
|
||||
{
|
||||
unsigned long long off, skip;
|
||||
@@ -517,11 +517,11 @@ static void do_overwrite(struct item_head *ih, void *data)
|
||||
unsigned int tail_start;
|
||||
int i;
|
||||
|
||||
// find correct tail first
|
||||
// find correct tail first
|
||||
tail_start = (off & ~(fs->fs_blocksize - 1)) + 1;
|
||||
for (i = 0; i < map.tail_nr; i++) {
|
||||
if (map.tails[i].offset == tail_start) {
|
||||
// ih is a part of this tail
|
||||
// ih is a part of this tail
|
||||
skip = (off - 1) & (fs->fs_blocksize - 1);
|
||||
to_compare =
|
||||
(map.tails[i].len - skip >
|
||||
@@ -560,7 +560,7 @@ static void map_one_item(struct saved_item *item)
|
||||
struct item_head *ih;
|
||||
void *data;
|
||||
|
||||
// read the block containing the item
|
||||
// read the block containing the item
|
||||
bh = bread(fs->fs_dev, item->si_block, fs->fs_blocksize);
|
||||
if (!bh) {
|
||||
reiserfs_warning(stderr, "bread failed\n");
|
||||
@@ -580,7 +580,7 @@ static void map_one_item(struct saved_item *item)
|
||||
brelse(bh);
|
||||
}
|
||||
|
||||
// flush map which is in variable map
|
||||
// flush map which is in variable map
|
||||
static void flush_map(reiserfs_filsys_t *fs,
|
||||
struct reiserfs_key *dir,
|
||||
char *name, struct reiserfs_key *key)
|
||||
@@ -602,30 +602,30 @@ static void flush_map(reiserfs_filsys_t *fs,
|
||||
v32 = MAP_MAGIC;
|
||||
fwrite(&v32, sizeof(v32), 1, fp);
|
||||
|
||||
// device name
|
||||
// device name
|
||||
v32 = strlen(device_name(fs)) + 1;
|
||||
fwrite(&v32, sizeof(v32), 1, fp);
|
||||
fwrite(device_name(fs), v32, 1, fp);
|
||||
|
||||
// name length and the name itself
|
||||
// name length and the name itself
|
||||
v32 = strlen(name) + 1;
|
||||
fwrite(&v32, sizeof(v32), 1, fp);
|
||||
fwrite(name, v32, 1, fp);
|
||||
|
||||
// short key of a directory
|
||||
// short key of a directory
|
||||
fwrite(dir, SHORT_KEY_SIZE, 1, fp);
|
||||
|
||||
// short key of file
|
||||
// short key of file
|
||||
fwrite(key, SHORT_KEY_SIZE, 1, fp);
|
||||
|
||||
// list of data block pointers
|
||||
// list of data block pointers
|
||||
fwrite(&map.head_len, sizeof(map.head_len), 1, fp);
|
||||
fwrite(map.head, map.head_len * 4, 1, fp);
|
||||
|
||||
// find correct tail first
|
||||
// find correct tail first
|
||||
for (i = 0; i < map.tail_nr; i++) {
|
||||
if (map.tails[i].offset == map.head_len * fs->fs_blocksize) {
|
||||
// tail length and the tail itself
|
||||
// tail length and the tail itself
|
||||
fwrite(&map.tails[i].len, sizeof(map.tails[i].len), 1,
|
||||
fp);
|
||||
fwrite(map.tails[i].data, map.tails[i].len, 1, fp);
|
||||
@@ -633,7 +633,7 @@ static void flush_map(reiserfs_filsys_t *fs,
|
||||
}
|
||||
}
|
||||
if (i == map.tail_nr) {
|
||||
// no tail
|
||||
// no tail
|
||||
v32 = 0;
|
||||
fwrite(&v32, sizeof(v32), 1, fp);
|
||||
}
|
||||
@@ -644,7 +644,7 @@ static void flush_map(reiserfs_filsys_t *fs,
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
// write map of file to a map file
|
||||
// write map of file to a map file
|
||||
/*
|
||||
|
||||
static void map_item_list (const void *nodep, VISIT value, int level)
|
||||
@@ -657,7 +657,7 @@ static void map_item_list (const void *nodep, VISIT value, int level)
|
||||
|
||||
item = *(struct saved_item **)nodep;
|
||||
|
||||
// 1. find the longest item
|
||||
// 1. find the longest item
|
||||
max_bytes = get_bytes_number (&item->si_ih, fs->fs_blocksize);
|
||||
longest = item;
|
||||
while (item->si_next) {
|
||||
@@ -671,7 +671,7 @@ static void map_item_list (const void *nodep, VISIT value, int level)
|
||||
|
||||
map_one_item (longest);
|
||||
|
||||
// map other items
|
||||
// map other items
|
||||
item = *(struct saved_item **)nodep;
|
||||
while (item) {
|
||||
if (item != longest)
|
||||
@@ -691,15 +691,15 @@ static void make_file_map (const void *nodep, VISIT value, int level)
|
||||
while (name) {
|
||||
reiserfs_warning (stdout, "%d - (%d): [%K]:\"%s\":\n", ++nr, name->count,
|
||||
&name->parent_dirid, name->name);
|
||||
|
||||
|
||||
if (name->items) {
|
||||
// initialize the map
|
||||
// initialize the map
|
||||
memset (&map, 0, sizeof (struct file_map));
|
||||
|
||||
// make a map of file
|
||||
// make a map of file
|
||||
twalk (name->items, map_item_list);
|
||||
|
||||
// write map to a file
|
||||
// write map to a file
|
||||
flush_map (fs, (struct reiserfs_key *)&name->parent_dirid, name->name,
|
||||
(struct reiserfs_key *)&name->dirid);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 2002-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -37,7 +37,7 @@ static int comp_items_1(const void *p1, const void *p2)
|
||||
int retval;
|
||||
struct item_head *ih1, *ih2;
|
||||
|
||||
/*
|
||||
/*
|
||||
if (*(int *)p1 != *(int *)p2)
|
||||
retval = 1;
|
||||
else
|
||||
@@ -166,7 +166,7 @@ void do_stat(reiserfs_filsys_t *fs)
|
||||
/*
|
||||
bh = bread (fs->s_dev, 8211, fs->s_blocksize);
|
||||
stat1_the_leaf (fs, bh);
|
||||
|
||||
|
||||
return;
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -66,7 +66,7 @@ static void unpack_type(struct packed_item *pi, struct item_head *ih)
|
||||
get_pi_type(pi), ih);
|
||||
}
|
||||
|
||||
/* direntry item comes in the following format:
|
||||
/* direntry item comes in the following format:
|
||||
for each entry
|
||||
mask - 8 bits
|
||||
entry length - 16 bits
|
||||
|
||||
+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
|
||||
*/
|
||||
|
||||
|
||||
+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
|
||||
*/
|
||||
|
||||
@@ -51,7 +51,7 @@ struct buffer_head {
|
||||
#define clear_buffer_do_not_flush(bh) misc_clear_bit(BH_Do_not_flush, &(bh)->b_state)
|
||||
|
||||
/*
|
||||
printf ("%s:%s:%u %p %p %p\n",
|
||||
printf ("%s:%s:%u %p %p %p\n",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
__builtin_return_address (0),
|
||||
__builtin_return_address (1),
|
||||
|
||||
+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
|
||||
*/
|
||||
|
||||
|
||||
+16
-16
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -718,7 +718,7 @@ extern_inline __u16 unmark_item_bad( struct item_head *ih )
|
||||
#define REISERFS_ROOT_OBJECTID 2
|
||||
#define REISERFS_ROOT_PARENT_OBJECTID 1
|
||||
|
||||
/*
|
||||
/*
|
||||
* Picture represents a leaf of internal tree
|
||||
* ______________________________________________________
|
||||
* | | Array of | | |
|
||||
@@ -837,7 +837,7 @@ struct stat_data {
|
||||
union {
|
||||
__u32 sd_rdev;
|
||||
__u32 sd_generation;
|
||||
//__u32 sd_first_direct_byte;
|
||||
//__u32 sd_first_direct_byte;
|
||||
/* first byte of file which is stored in a direct item: except that if
|
||||
it equals 1 it is a symlink and if it equals ~(__u32)0 there is no
|
||||
direct item. The existence of this field really grates on me. Let's
|
||||
@@ -861,7 +861,7 @@ struct stat_data {
|
||||
/***************************************************************************/
|
||||
/* DIRECTORY STRUCTURE */
|
||||
/***************************************************************************/
|
||||
/*
|
||||
/*
|
||||
Picture represents the structure of directory items
|
||||
________________________________________________
|
||||
| Array of | | | | | |
|
||||
@@ -881,7 +881,7 @@ struct stat_data {
|
||||
/* Each directory entry has its header. This header has deh_dir_id and
|
||||
deh_objectid fields, those are key of object, entry points to */
|
||||
|
||||
/* NOT IMPLEMENTED:
|
||||
/* NOT IMPLEMENTED:
|
||||
Directory will someday contain stat data of object */
|
||||
struct reiserfs_de_head {
|
||||
__u32 deh2_offset; /* third component of the directory entry key */
|
||||
@@ -1344,7 +1344,7 @@ struct buffer_info {
|
||||
+-------------------+------------+--------------+------------+
|
||||
| stat data | 0 | 0 | no |
|
||||
+-------------------+------------+--------------+------------+
|
||||
| 1st directory item| DOT_OFFSET |DIRENTRY_UNIQUENESS| no |
|
||||
| 1st directory item| DOT_OFFSET |DIRENTRY_UNIQUENESS| no |
|
||||
| non 1st directory | hash value | | yes |
|
||||
| item | | | |
|
||||
+-------------------+------------+--------------+------------+
|
||||
@@ -1402,7 +1402,7 @@ struct buffer_info {
|
||||
#define d32_put(p, i, v) put_unaligned(cpu_to_le32(v), (p) + (i))
|
||||
|
||||
|
||||
/* get the item header */
|
||||
/* get the item header */
|
||||
#define B_N_PITEM_HEAD(bh,item_num) ( (struct item_head * )((bh)->b_data + BLKH_SIZE) + (item_num) )
|
||||
|
||||
/* get key */
|
||||
@@ -1453,9 +1453,9 @@ int are_items_mergeable (struct item_head * left, struct item_head * right, int
|
||||
|
||||
|
||||
/* fix_nodes.c */
|
||||
void * reiserfs_kmalloc (size_t size, int flags, reiserfs_filsys_t * s);
|
||||
void *reiserfs_kmalloc (size_t size, int flags, reiserfs_filsys_t * s);
|
||||
void reiserfs_kfree (/*const*/ void * vp, size_t size, reiserfs_filsys_t * s);
|
||||
int fix_nodes (/*struct reiserfs_transaction_handle *th,*/ int n_op_mode, struct tree_balance * p_s_tb,
|
||||
int fix_nodes (/*struct reiserfs_transaction_handle *th,*/ int n_op_mode, struct tree_balance * p_s_tb,
|
||||
/*int n_pos_in_item,*/ struct item_head * p_s_ins_ih);
|
||||
void unfix_nodes (/*struct reiserfs_transaction_handle *th,*/ struct tree_balance *);
|
||||
void free_buffers_in_tb (struct tree_balance * p_s_tb);
|
||||
@@ -1478,18 +1478,18 @@ void print_objectid_map (FILE * fp, reiserfs_filsys_t *fs);
|
||||
|
||||
|
||||
/* lbalance.c */
|
||||
int leaf_move_items (int shift_mode, struct tree_balance * tb,
|
||||
int leaf_move_items (int shift_mode, struct tree_balance * tb,
|
||||
int mov_num, int mov_bytes, struct buffer_head * Snew);
|
||||
int leaf_shift_left (struct tree_balance * tb, int shift_num, int shift_bytes);
|
||||
int leaf_shift_right (struct tree_balance * tb, int shift_num, int shift_bytes);
|
||||
void leaf_delete_items (reiserfs_filsys_t *, struct buffer_info * cur_bi,
|
||||
void leaf_delete_items (reiserfs_filsys_t *, struct buffer_info * cur_bi,
|
||||
int last_first, int first, int del_num, int del_bytes);
|
||||
void leaf_insert_into_buf (reiserfs_filsys_t *, struct buffer_info * bi,
|
||||
int before, struct item_head * inserted_item_ih, const char * inserted_item_body,
|
||||
void leaf_insert_into_buf (reiserfs_filsys_t *, struct buffer_info * bi,
|
||||
int before, struct item_head * inserted_item_ih, const char * inserted_item_body,
|
||||
int zeros_number);
|
||||
void leaf_paste_in_buffer (reiserfs_filsys_t *, struct buffer_info * bi, int pasted_item_num,
|
||||
void leaf_paste_in_buffer (reiserfs_filsys_t *, struct buffer_info * bi, int pasted_item_num,
|
||||
int pos_in_item, int paste_size, const char * body, int zeros_number);
|
||||
void leaf_cut_from_buffer (reiserfs_filsys_t *, struct buffer_info * bi, int cut_item_num,
|
||||
void leaf_cut_from_buffer (reiserfs_filsys_t *, struct buffer_info * bi, int cut_item_num,
|
||||
int pos_in_item, int cut_size);
|
||||
void leaf_paste_entries (struct buffer_head * bh, int item_num, int before, int new_entry_count,
|
||||
struct reiserfs_de_head * new_dehs, const char * records,
|
||||
@@ -1500,7 +1500,7 @@ void cut_entry (reiserfs_filsys_t *, struct buffer_head * bh,
|
||||
|
||||
|
||||
/* ibalance.c */
|
||||
int balance_internal (struct tree_balance * , int, int, struct item_head * ,
|
||||
int balance_internal (struct tree_balance * , int, int, struct item_head * ,
|
||||
struct buffer_head **);
|
||||
|
||||
/* do_balance.c */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 2002-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -653,9 +653,9 @@ void close_rollback_file()
|
||||
|
||||
// fprintf (stdout, "rollback: (%u) blocks saved, \n", rollback_blocks_number);
|
||||
|
||||
/* for (i = 0; i < rollback_blocks_number; i++)
|
||||
fprintf(stdout, "device (%Lu), block number (%u)\n",
|
||||
rollback_blocks_array [i].device,
|
||||
/* for (i = 0; i < rollback_blocks_number; i++)
|
||||
fprintf(stdout, "device (%Lu), block number (%u)\n",
|
||||
rollback_blocks_array [i].device,
|
||||
rollback_blocks_array [i].blocknr);
|
||||
fprintf(stdout, "\n");
|
||||
*/
|
||||
@@ -765,8 +765,8 @@ void do_fsck_rollback(int fd_device, int fd_journal_device, FILE * progress)
|
||||
} else {
|
||||
count_rollbacked++;
|
||||
/*if you want to know what gets rollbacked, uncomment it */
|
||||
/* if (log_file != 0 && log_file != stdout)
|
||||
fprintf (log_file, "rollback: block %Lu of device %Lu was restored\n",
|
||||
/* if (log_file != 0 && log_file != stdout)
|
||||
fprintf (log_file, "rollback: block %Lu of device %Lu was restored\n",
|
||||
(loff_t)offset/rollback_blocksize, b_dev);
|
||||
*/
|
||||
// fprintf (stdout, "rollback: block (%Ld) written\n", (loff_t)offset/rollback_blocksize);
|
||||
@@ -783,9 +783,9 @@ void do_fsck_rollback(int fd_device, int fd_journal_device, FILE * progress)
|
||||
static void rollback__mark_block_saved (struct block_handler * rb_e) {
|
||||
if (rollback_blocks_array == NULL)
|
||||
rollback_blocks_array = getmem (ROLLBACK__INCREASE_BLOCK_NUMBER * sizeof (*rb_e));
|
||||
|
||||
|
||||
if (rollback_blocks_number == get_mem_size ((void *)rollback_blocks_array) / sizeof (*rb_e))
|
||||
rollback_blocks_array = expandmem (rollback_blocks_array, get_mem_size((void *)rollback_blocks_array),
|
||||
rollback_blocks_array = expandmem (rollback_blocks_array, get_mem_size((void *)rollback_blocks_array),
|
||||
ROLLBACK__INCREASE_BLOCK_NUMBER * sizeof (*rb_e));
|
||||
|
||||
// checkmem ((char *)rollback_blocks_array, get_mem_size((char *)rollback_blocks_array));
|
||||
@@ -793,7 +793,7 @@ static void rollback__mark_block_saved (struct block_handler * rb_e) {
|
||||
rollback_blocks_array[rollback_blocks_number] = *rb_e;
|
||||
rollback_blocks_number ++;
|
||||
qsort (rollback_blocks_array, rollback_blocks_number, sizeof (*rb_e), rollback_compare);
|
||||
|
||||
|
||||
// printf("\ncheckmem3");
|
||||
// fflush (stdout);
|
||||
// checkmem ((char *)rollback_blocks_array, get_mem_size((char *)rollback_blocks_array));
|
||||
@@ -955,7 +955,7 @@ static void check_and_free_buffer_mem(void)
|
||||
int count = 0;
|
||||
struct buffer_head *next;
|
||||
|
||||
// printf("check and free buffer mem, hits %d misses %d reads %d writes %d\n",
|
||||
// printf("check and free buffer mem, hits %d misses %d reads %d writes %d\n",
|
||||
// buffer_hits, buffer_misses, buffer_reads, buffer_writes) ;
|
||||
/*sync_buffers (0, 0); */
|
||||
|
||||
|
||||
+13
-13
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -172,10 +172,10 @@ void freemem(void *vp)
|
||||
|
||||
typedef int (*func_t) (char *);
|
||||
|
||||
/* Lookup the @file in the @mntfile. @file is mntent.mnt_fsname if @fsname
|
||||
/* Lookup the @file in the @mntfile. @file is mntent.mnt_fsname if @fsname
|
||||
is set; mntent.mnt_dir otherwise. Return the mnt entry from the @mntfile.
|
||||
|
||||
Warning: if the root fs is mounted RO, the content of /etc/mtab may be
|
||||
|
||||
Warning: if the root fs is mounted RO, the content of /etc/mtab may be
|
||||
not correct. */
|
||||
static struct mntent *misc_mntent_lookup(char *mntfile, char *file, int path)
|
||||
{
|
||||
@@ -232,13 +232,13 @@ static struct mntent *misc_mntent_lookup(char *mntfile, char *file, int path)
|
||||
break;
|
||||
|
||||
if (path) {
|
||||
/* Either names or stats match. Make sure the st_dev of
|
||||
/* Either names or stats match. Make sure the st_dev of
|
||||
the path is same as @mnt_fsname device rdev. */
|
||||
if (stat(mnt->mnt_fsname, &st) == 0 &&
|
||||
dev == st.st_rdev)
|
||||
break;
|
||||
} else {
|
||||
/* Either names or stats match. Make sure the st_dev of
|
||||
/* Either names or stats match. Make sure the st_dev of
|
||||
the mount entry is same as the given device rdev. */
|
||||
if (stat(mnt->mnt_dir, &st) == 0 && rdev == st.st_dev)
|
||||
break;
|
||||
@@ -296,7 +296,7 @@ struct mntent *misc_mntent(char *device)
|
||||
proc = 1;
|
||||
|
||||
if (root) {
|
||||
/* Lookup the "/" entry in /proc/mounts. Special
|
||||
/* Lookup the "/" entry in /proc/mounts. Special
|
||||
case as root entry can present as:
|
||||
rootfs / rootfs rw 0 0
|
||||
Look up the mount point in this case. */
|
||||
@@ -335,7 +335,7 @@ struct mntent *misc_mntent(char *device)
|
||||
}
|
||||
#endif /* defined(MOUNTED) || defined(_PATH_MOUNTED) */
|
||||
|
||||
/* If has not been checked in neither /proc/mounts nor /etc/mtab (or
|
||||
/* If has not been checked in neither /proc/mounts nor /etc/mtab (or
|
||||
errors have occured), return INVAL_PTR, NULL otherwise. */
|
||||
return (!proc && !path) ? INVAL_PTR : NULL;
|
||||
}
|
||||
@@ -344,7 +344,7 @@ int misc_device_mounted(char *device)
|
||||
{
|
||||
struct mntent *mnt;
|
||||
|
||||
/* Check for the "/" first to avoid any possible problem with
|
||||
/* Check for the "/" first to avoid any possible problem with
|
||||
reflecting the root fs info in mtab files. */
|
||||
if (misc_root_mounted(device) == 1) {
|
||||
return misc_file_ro("/") ? MF_RO : MF_RW;
|
||||
@@ -465,7 +465,7 @@ void print_how_far(FILE * fp,
|
||||
# define BLKGETSIZE64 _IOR(0x12, 114, size_t)
|
||||
#endif
|
||||
|
||||
/* To not have problem with last sectors on the block device when switching
|
||||
/* To not have problem with last sectors on the block device when switching
|
||||
to smaller one. */
|
||||
#define MAX_BS (64 * 1024)
|
||||
|
||||
@@ -688,10 +688,10 @@ static void get_dma_support(dma_info_t *dma_info)
|
||||
dma_info->support_type = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return values:
|
||||
/*
|
||||
* Return values:
|
||||
* 0 - ok;
|
||||
* 1 - preparation cannot be done
|
||||
* 1 - preparation cannot be done
|
||||
* -1 - preparation failed
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
/* mkreiserfs is very simple. It skips first 64k of device, and then
|
||||
writes the super block, the needed amount of bitmap blocks (this
|
||||
amount is calculated based on file system size), and root block.
|
||||
Bitmap policy is primitive: it assumes, that device does not have
|
||||
unreadable blocks, and it occupies first blocks for super, bitmap
|
||||
and root blocks. bitmap blocks are interleaved across the disk,
|
||||
/* mkreiserfs is very simple. It skips first 64k of device, and then
|
||||
writes the super block, the needed amount of bitmap blocks (this
|
||||
amount is calculated based on file system size), and root block.
|
||||
Bitmap policy is primitive: it assumes, that device does not have
|
||||
unreadable blocks, and it occupies first blocks for super, bitmap
|
||||
and root blocks. bitmap blocks are interleaved across the disk,
|
||||
mainly to make resizing faster. */
|
||||
|
||||
#define _GNU_SOURCE
|
||||
@@ -477,7 +477,7 @@ static void set_journal_device_size(char *str)
|
||||
/*
|
||||
if (Journal_size < JOURNAL_MIN_SIZE)
|
||||
die ("%s: wrong journal size specified: %lu. Should be at least %u",
|
||||
program_name,
|
||||
program_name,
|
||||
Journal_size + 1, JOURNAL_MIN_SIZE + 1);
|
||||
*/
|
||||
}
|
||||
@@ -794,7 +794,7 @@ int main(int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
* Use BSD fomatting.
|
||||
* Local variables:
|
||||
* c-indentation-style: "bsd"
|
||||
|
||||
+10
-10
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
/*
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -128,10 +128,10 @@ int reiserfs_bitmap_compare(reiserfs_bitmap_t *bm1, reiserfs_bitmap_t *bm2)
|
||||
return diff;
|
||||
}
|
||||
|
||||
/*
|
||||
Does X | Y for every bit of the bitmap `to`, where
|
||||
X - bit of the `to` bitmap,
|
||||
Y - `from` bitmap.
|
||||
/*
|
||||
Does X | Y for every bit of the bitmap `to`, where
|
||||
X - bit of the `to` bitmap,
|
||||
Y - `from` bitmap.
|
||||
Save result in the `to` bitmap.
|
||||
*/
|
||||
void reiserfs_bitmap_disjunction(reiserfs_bitmap_t *to,
|
||||
@@ -152,10 +152,10 @@ void reiserfs_bitmap_disjunction(reiserfs_bitmap_t *to,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Does X & !Y for every bit of the bitmap `base`, where
|
||||
X - bit of the `base` bitmap,
|
||||
Y - `exclude` bitmap.
|
||||
/*
|
||||
Does X & !Y for every bit of the bitmap `base`, where
|
||||
X - bit of the `base` bitmap,
|
||||
Y - `exclude` bitmap.
|
||||
Save result in the `base` bitmap.
|
||||
*/
|
||||
void reiserfs_bitmap_delta(reiserfs_bitmap_t *base,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -25,14 +25,14 @@
|
||||
if lnum is larger than 0 we put items into the left node
|
||||
if rnum is larger than 0 we put items into the right node
|
||||
if snum1 is larger than 0 we put items into the new node s1
|
||||
if snum2 is larger than 0 we put items into the new node s2
|
||||
if snum2 is larger than 0 we put items into the new node s2
|
||||
Note that all *num* count new items being created.
|
||||
|
||||
It would be easier to read balance_leaf() if each of these summary
|
||||
lines was a separate procedure rather than being inlined. I think
|
||||
that there are many passages here and in balance_leaf_when_delete() in
|
||||
which two calls to one procedure can replace two passages, and it
|
||||
might save cache space and improve software maintenance costs to do so.
|
||||
might save cache space and improve software maintenance costs to do so.
|
||||
|
||||
Vladimir made the perceptive comment that we should offload most of
|
||||
the decision making in this function into fix_nodes/check_balance, and
|
||||
@@ -220,13 +220,13 @@ static int balance_leaf( /*struct reiserfs_transaction_handle *th, */
|
||||
struct buffer_head *tbS0 = PATH_PLAST_BUFFER(tb->tb_path);
|
||||
/* struct buffer_head * tbF0 = PATH_H_PPARENT (tb->tb_path, 0);
|
||||
int S0_b_item_order = PATH_H_B_ITEM_ORDER (tb->tb_path, 0);*/
|
||||
int item_pos = PATH_LAST_POSITION(tb->tb_path); /* index into the array of item headers in S[0]
|
||||
int item_pos = PATH_LAST_POSITION(tb->tb_path); /* index into the array of item headers in S[0]
|
||||
of the affected item */
|
||||
struct buffer_info bi;
|
||||
struct buffer_head *S_new[2]; /* new nodes allocated to hold what could not fit into S */
|
||||
int snum[2]; /* number of items that will be placed into S_new (includes partially shifted items) */
|
||||
int sbytes[2]; /* if an item is partially shifted into S_new then
|
||||
if it is a directory item
|
||||
int sbytes[2]; /* if an item is partially shifted into S_new then
|
||||
if it is a directory item
|
||||
it is the number of entries from the item that are shifted into S_new
|
||||
else
|
||||
it is the number of bytes from the item that are shifted into S_new
|
||||
@@ -1281,7 +1281,7 @@ static int balance_leaf( /*struct reiserfs_transaction_handle *th, */
|
||||
n_rem);
|
||||
|
||||
//B_N_PKEY(S_new[i],0)->k_offset += n_rem;
|
||||
//
|
||||
//
|
||||
|
||||
tb->insert_size[0] = n_rem;
|
||||
if (!n_rem)
|
||||
|
||||
+18
-18
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
** get_direct_parent
|
||||
** get_neighbors
|
||||
** fix_nodes
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**/
|
||||
|
||||
#include "includes.h"
|
||||
@@ -555,11 +555,11 @@ static int get_num_ver(int mode, struct tree_balance *tb, int h,
|
||||
int needed_nodes;
|
||||
int start_item, /* position of item we start filling node from */
|
||||
end_item, /* position of item we finish filling node by */
|
||||
start_bytes, /* number of first bytes (entries for directory) of start_item-th item
|
||||
start_bytes, /* number of first bytes (entries for directory) of start_item-th item
|
||||
we do not include into node that is being filled */
|
||||
end_bytes; /* number of last bytes (entries for directory) of end_item-th item
|
||||
end_bytes; /* number of last bytes (entries for directory) of end_item-th item
|
||||
we do node include into node that is being filled */
|
||||
int splitted_item_positions[2]; /* these are positions in virtual item of items,
|
||||
int splitted_item_positions[2]; /* these are positions in virtual item of items,
|
||||
that are splitted between S[0] and S1new and S1new and S2new */
|
||||
|
||||
max_node_size = MAX_CHILD_SIZE(tb->tb_fs->fs_blocksize);
|
||||
@@ -816,7 +816,7 @@ static int item_length(struct tree_balance *tb, int item_num)
|
||||
|
||||
/* Set parameters for balancing.
|
||||
* Performs write of results of analysis of balancing into structure tb,
|
||||
* where it will later be used by the functions that actually do the balancing.
|
||||
* where it will later be used by the functions that actually do the balancing.
|
||||
* Parameters:
|
||||
* tb tree_balance structure;
|
||||
* h current level of the node;
|
||||
@@ -1542,7 +1542,7 @@ static inline int can_node_be_removed(int mode, int lfree, int sfree, int rfree,
|
||||
* h current level of the node;
|
||||
* inum item number in S[h];
|
||||
* mode i - insert, p - paste;
|
||||
* Returns: 1 - schedule occured;
|
||||
* Returns: 1 - schedule occured;
|
||||
* 0 - balancing for higher levels needed;
|
||||
* -1 - no balancing for higher levels needed;
|
||||
* -2 - no disk space.
|
||||
@@ -1575,7 +1575,7 @@ static int ip_check_balance( /*struct reiserfs_transaction_handle *th, */ struct
|
||||
|
||||
/* we perform 8 calls to get_num_ver(). For each call we calculate five
|
||||
parameters. where 4th parameter is s1bytes and 5th - s2bytes */
|
||||
short snum012[40] = { 0, }; /* s0num, s1num, s2num for 8 cases
|
||||
short snum012[40] = { 0, }; /* s0num, s1num, s2num for 8 cases
|
||||
0,1 - do not shift and do not shift but bottle
|
||||
2 - shift only whole item to left
|
||||
3 - shift to left and bottle as much as possible
|
||||
@@ -1680,7 +1680,7 @@ static int ip_check_balance( /*struct reiserfs_transaction_handle *th, */ struct
|
||||
|
||||
{
|
||||
int lpar, rpar, nset, lset, rset, lrset;
|
||||
/*
|
||||
/*
|
||||
* regular overflowing of the node
|
||||
*/
|
||||
|
||||
@@ -1870,7 +1870,7 @@ static int ip_check_balance( /*struct reiserfs_transaction_handle *th, */ struct
|
||||
* h current level of the node;
|
||||
* inum item number in S[h];
|
||||
* mode i - insert, p - paste;
|
||||
* Returns: 1 - schedule occured;
|
||||
* Returns: 1 - schedule occured;
|
||||
* 0 - balancing for higher levels needed;
|
||||
* -1 - no balancing for higher levels needed;
|
||||
* -2 - no disk space.
|
||||
@@ -2058,7 +2058,7 @@ static int dc_check_balance_internal(struct tree_balance *tb, int h)
|
||||
* h current level of the node;
|
||||
* inum item number in S[h];
|
||||
* mode i - insert, p - paste;
|
||||
* Returns: 1 - schedule occured;
|
||||
* Returns: 1 - schedule occured;
|
||||
* 0 - balancing for higher levels needed;
|
||||
* -1 - no balancing for higher levels needed;
|
||||
* -2 - no disk space.
|
||||
@@ -2135,7 +2135,7 @@ static int dc_check_balance_leaf(struct tree_balance *tb, int h)
|
||||
* h current level of the node;
|
||||
* inum item number in S[h];
|
||||
* mode d - delete, c - cut.
|
||||
* Returns: 1 - schedule occured;
|
||||
* Returns: 1 - schedule occured;
|
||||
* 0 - balancing for higher levels needed;
|
||||
* -1 - no balancing for higher levels needed;
|
||||
* -2 - no disk space.
|
||||
@@ -2161,7 +2161,7 @@ static int dc_check_balance(struct tree_balance *tb, int h)
|
||||
* h current level of the node;
|
||||
* inum item number in S[h];
|
||||
* mode i - insert, p - paste, d - delete, c - cut.
|
||||
* Returns: 1 - schedule occured;
|
||||
* Returns: 1 - schedule occured;
|
||||
* 0 - balancing for higher levels needed;
|
||||
* -1 - no balancing for higher levels needed;
|
||||
* -2 - no disk space.
|
||||
@@ -2322,15 +2322,15 @@ static void free_virtual_node_mem(struct tree_balance *tb)
|
||||
* analyze what and where should be moved;
|
||||
* get sufficient number of new nodes;
|
||||
* Balancing will start only after all resources will be collected at a time.
|
||||
*
|
||||
*
|
||||
* When ported to SMP kernels, only at the last moment after all needed nodes
|
||||
* are collected in cache, will the resources be locked using the usual
|
||||
* textbook ordered lock acquisition algorithms. Note that ensuring that
|
||||
* this code neither write locks what it does not need to write lock nor locks out of order
|
||||
* will be a pain in the butt that could have been avoided. Grumble grumble. -Hans
|
||||
*
|
||||
*
|
||||
* fix is meant in the sense of render unchanging
|
||||
*
|
||||
*
|
||||
* Latency might be improved by first gathering a list of what buffers are needed
|
||||
* and then getting as many of them in parallel as possible? -Hans
|
||||
*
|
||||
@@ -2342,7 +2342,7 @@ static void free_virtual_node_mem(struct tree_balance *tb)
|
||||
* ins_ih & ins_sd are used when inserting
|
||||
* Returns: 1 - schedule occurred while the function worked;
|
||||
* 0 - schedule didn't occur while the function worked;
|
||||
* -1 - if no_disk_space
|
||||
* -1 - if no_disk_space
|
||||
*/
|
||||
|
||||
int fix_nodes(int n_op_mode, struct tree_balance *p_s_tb,
|
||||
|
||||
@@ -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 @@
|
||||
* (see Applied Cryptography, 2nd edition, p448).
|
||||
*
|
||||
* Jeremy Fitzhardinge <jeremy@zip.com.au> 1998
|
||||
*
|
||||
*
|
||||
* Jeremy has agreed to the contents of reiserfs/README. -Hans
|
||||
* Yura's function is added (04/07/2000)
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -126,7 +126,7 @@ static void internal_insert_childs(reiserfs_filsys_t *fs,
|
||||
bh[i]->b_blocknr);
|
||||
/*
|
||||
set_dc_child_size (new_dc + i,
|
||||
MAX_CHILD_SIZE(bh[i]->b_size) -
|
||||
MAX_CHILD_SIZE(bh[i]->b_size) -
|
||||
get_blkh_free_space (B_BLK_HEAD (bh[i])));
|
||||
set_dc_child_blocknr (new_dc + i, bh[i]->b_blocknr); */
|
||||
}
|
||||
@@ -227,7 +227,7 @@ static void internal_delete_childs(reiserfs_filsys_t *fs,
|
||||
|
||||
/* copy cpy_num node pointers and cpy_num - 1 items from buffer src to buffer dest
|
||||
* last_first == FIRST_TO_LAST means, that we copy first items from src to tail of dest
|
||||
* last_first == LAST_TO_FIRST means, that we copy last items from src to head of dest
|
||||
* last_first == LAST_TO_FIRST means, that we copy last items from src to head of dest
|
||||
*/
|
||||
static void internal_copy_pointers_items(reiserfs_filsys_t *fs,
|
||||
struct buffer_info *dest_bi,
|
||||
@@ -314,7 +314,7 @@ static void internal_move_pointers_items(reiserfs_filsys_t *fs,
|
||||
if (last_first == FIRST_TO_LAST) { /* shift_left occurs */
|
||||
first_pointer = 0;
|
||||
first_item = 0;
|
||||
/* delete cpy_num - del_par pointers and keys starting for pointers with first_pointer,
|
||||
/* delete cpy_num - del_par pointers and keys starting for pointers with first_pointer,
|
||||
for key - with first_item */
|
||||
internal_delete_pointers_items(fs, src_bi, first_pointer,
|
||||
first_item, cpy_num - del_par);
|
||||
@@ -367,7 +367,7 @@ static void internal_insert_key(reiserfs_filsys_t *fs, struct buffer_info *dest_
|
||||
}
|
||||
}
|
||||
|
||||
/* Insert d_key'th (delimiting) key from buffer cfl to tail of dest.
|
||||
/* Insert d_key'th (delimiting) key from buffer cfl to tail of dest.
|
||||
* Copy pointer_amount node pointers and pointer_amount - 1 items from buffer src to buffer dest.
|
||||
* Replace d_key'th key in buffer cfl.
|
||||
* Delete pointer_amount items and node pointers from buffer src.
|
||||
@@ -432,7 +432,7 @@ static void internal_shift1_left(struct tree_balance *tb,
|
||||
FIRST_TO_LAST, pointer_amount, 1);
|
||||
}
|
||||
|
||||
/* Insert d_key'th (delimiting) key from buffer cfr to head of dest.
|
||||
/* Insert d_key'th (delimiting) key from buffer cfr to head of dest.
|
||||
* Copy n node pointers and n - 1 items from buffer src to buffer dest.
|
||||
* Replace d_key'th key in buffer cfr.
|
||||
* Delete n items and node pointers from buffer src.
|
||||
@@ -610,7 +610,7 @@ int balance_internal(struct tree_balance *tb, /* tree_balance structure
|
||||
this means that new pointers and items must be inserted AFTER *
|
||||
child_pos
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
it is the position of the leftmost pointer that must be deleted (together with
|
||||
its corresponding key to the left of the pointer)
|
||||
@@ -691,7 +691,7 @@ int balance_internal(struct tree_balance *tb, /* tree_balance structure
|
||||
set_dc(dc, MAX_CHILD_SIZE(insert_ptr[k]->b_size) -
|
||||
get_blkh_free_space(B_BLK_HEAD(insert_ptr[k])),
|
||||
insert_ptr[k]->b_blocknr);
|
||||
/*
|
||||
/*
|
||||
set_dc_child_size (dc, MAX_CHILD_SIZE(insert_ptr[k]->b_size) -
|
||||
get_blkh_free_space (B_BLK_HEAD(insert_ptr[k])));
|
||||
set_dc_child_blocknr (dc, insert_ptr[k]->b_blocknr);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 2002-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -546,7 +546,7 @@ int reiserfs_open_journal(reiserfs_filsys_t *fs, char *j_filename, int flags)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* initialize super block's journal related fields and journal header fields.
|
||||
/* initialize super block's journal related fields and journal header fields.
|
||||
* If len is 0 - make journal of default size */
|
||||
int reiserfs_create_journal(reiserfs_filsys_t *fs, char *j_device, /* journal device name */
|
||||
unsigned long offset, /* journal offset on the j_device */
|
||||
@@ -562,7 +562,7 @@ int reiserfs_create_journal(reiserfs_filsys_t *fs, char *j_device, /* journal de
|
||||
sb = fs->fs_ondisk_sb;
|
||||
|
||||
if (!j_device || !strcmp(j_device, fs->fs_file_name)) {
|
||||
/* Journal is to be on the host device, check the amount space for the
|
||||
/* Journal is to be on the host device, check the amount space for the
|
||||
* journal on it. */
|
||||
len =
|
||||
len ? len : journal_default_size(fs->fs_super_bh->b_blocknr,
|
||||
@@ -847,7 +847,7 @@ int replay_journal(reiserfs_filsys_t *fs)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Smth strange with journal header or journal. We cannot say for sure what was the last
|
||||
/* Smth strange with journal header or journal. We cannot say for sure what was the last
|
||||
replaied transaction, but relying on JH data is preferable. */
|
||||
|
||||
replayed = 0;
|
||||
|
||||
+10
-10
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 1996-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -125,8 +125,8 @@ static void leaf_copy_dir_entries(reiserfs_filsys_t *fs,
|
||||
DEH_SIZE * copy_count + copy_records_len);
|
||||
}
|
||||
|
||||
/* Copy the first (if last_first == FIRST_TO_LAST) or last (last_first == LAST_TO_FIRST) item or
|
||||
part of it or nothing (see the return 0 below) from SOURCE to the end
|
||||
/* Copy the first (if last_first == FIRST_TO_LAST) or last (last_first == LAST_TO_FIRST) item or
|
||||
part of it or nothing (see the return 0 below) from SOURCE to the end
|
||||
(if last_first) or beginning (!last_first) of the DEST */
|
||||
/* returns 1 if anything was copied, else 0 */
|
||||
static int leaf_copy_boundary_item(reiserfs_filsys_t *fs,
|
||||
@@ -345,7 +345,7 @@ static void leaf_item_bottle(reiserfs_filsys_t *fs,
|
||||
else {
|
||||
struct item_head n_ih;
|
||||
|
||||
/* copy part of the body of the item number 'item_num' of SOURCE to the end of the DEST
|
||||
/* copy part of the body of the item number 'item_num' of SOURCE to the end of the DEST
|
||||
part defined by 'cpy_bytes'; create new item header; change old item_header (????);
|
||||
n_ih = new item_header;
|
||||
*/
|
||||
@@ -372,7 +372,7 @@ static void leaf_item_bottle(reiserfs_filsys_t *fs,
|
||||
else {
|
||||
struct item_head n_ih;
|
||||
|
||||
/* copy part of the body of the item number 'item_num' of SOURCE to the begin of the DEST
|
||||
/* copy part of the body of the item number 'item_num' of SOURCE to the begin of the DEST
|
||||
part defined by 'cpy_bytes'; create new item header;
|
||||
n_ih = new item_header;
|
||||
*/
|
||||
@@ -638,7 +638,7 @@ static void leaf_delete_items_entirely(reiserfs_filsys_t *sb,
|
||||
struct buffer_info *bi,
|
||||
int first, int del_num);
|
||||
/* If del_bytes == -1, starting from position 'first' delete del_num items in whole in buffer CUR.
|
||||
If not.
|
||||
If not.
|
||||
If last_first == 0. Starting from position 'first' delete del_num-1 items in whole. Delete part of body of
|
||||
the first item. Part defined by del_bytes. Don't delete first item header
|
||||
If last_first == 1. Starting from position 'first+1' delete del_num-1 items in whole. Delete part of body of
|
||||
@@ -689,7 +689,7 @@ void leaf_delete_items(reiserfs_filsys_t *fs,
|
||||
/* len = body len of item */
|
||||
len = get_ih_item_len(ih);
|
||||
|
||||
/* delete the part of the last item of the bh
|
||||
/* delete the part of the last item of the bh
|
||||
do not delete item header
|
||||
*/
|
||||
leaf_cut_from_buffer(fs, cur_bi, B_NR_ITEMS(bh) - 1,
|
||||
@@ -774,7 +774,7 @@ void leaf_insert_into_buf(reiserfs_filsys_t *s,
|
||||
bh->b_blocknr, bh);
|
||||
}
|
||||
|
||||
/* paste paste_size bytes to affected_item_num-th item.
|
||||
/* paste paste_size bytes to affected_item_num-th item.
|
||||
When item is a directory, this only prepare space for new entries */
|
||||
void leaf_paste_in_buffer(reiserfs_filsys_t *fs,
|
||||
struct buffer_info *bi,
|
||||
@@ -813,7 +813,7 @@ void leaf_paste_in_buffer(reiserfs_filsys_t *fs,
|
||||
//if (mem_mode == REISERFS_USER_MEM) {
|
||||
//memset (bh->b_data + unmoved_loc - paste_size, 0, zeros_number);
|
||||
//copy_from_user (bh->b_data + unmoved_loc - paste_size + zeros_number, body, paste_size - zeros_number);
|
||||
//} else
|
||||
//} else
|
||||
{
|
||||
if (!pos_in_item) {
|
||||
/* shift data to right */
|
||||
@@ -939,7 +939,7 @@ static int leaf_cut_entries(struct buffer_head *bh,
|
||||
/* when cut item is part of regular file
|
||||
pos_in_item - first byte that must be cut
|
||||
cut_size - number of bytes to be cut beginning from pos_in_item
|
||||
|
||||
|
||||
when cut item is part of directory
|
||||
pos_in_item - number of first deleted entry
|
||||
cut_size - count of deleted entries
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -248,9 +248,9 @@ int is_any_reiserfs_magic_string(struct reiserfs_super_block *rs)
|
||||
|
||||
int get_reiserfs_format(struct reiserfs_super_block *sb)
|
||||
{
|
||||
/* after conversion to 3.6 format we change magic correctly,
|
||||
but do not change sb_format. When we create non-standard journal
|
||||
field format in sb get adjusted correctly. Thereby, for standard
|
||||
/* after conversion to 3.6 format we change magic correctly,
|
||||
but do not change sb_format. When we create non-standard journal
|
||||
field format in sb get adjusted correctly. Thereby, for standard
|
||||
journal we should rely on magic and for non-standard - on format */
|
||||
if (is_reiserfs_3_5_magic_string(sb) ||
|
||||
(is_reiserfs_jr_magic_string(sb) &&
|
||||
@@ -1015,7 +1015,7 @@ void set_type(int format, struct reiserfs_key *key, int type)
|
||||
set_key_type_v2(key, type);
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
void set_offset(int format, struct reiserfs_key *key, loff_t offset)
|
||||
{
|
||||
if (format == KEY_FORMAT_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
|
||||
*/
|
||||
|
||||
@@ -811,7 +811,7 @@ void print_tb(int mode, int item_pos, int pos_in_item, struct tree_balance *tb,
|
||||
tbSh = PATH_H_PBUFFER(tb->tb_path, h);
|
||||
tbFh = PATH_H_PPARENT(tb->tb_path, h);
|
||||
} else {
|
||||
/* printk ("print_tb: h=%d, PATH_H_PATH_OFFSET=%d, path_length=%d\n",
|
||||
/* printk ("print_tb: h=%d, PATH_H_PATH_OFFSET=%d, path_length=%d\n",
|
||||
h, PATH_H_PATH_OFFSET (tb->tb_path, h), tb->tb_path->path_length); */
|
||||
tbSh = 0;
|
||||
tbFh = 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
|
||||
@@ -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,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
/*
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/*
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
/*
|
||||
* Copyright 2000-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Written by Alexander Zarochentcev.
|
||||
*
|
||||
* FS resize utility
|
||||
*
|
||||
* FS resize utility
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -38,7 +38,7 @@ static long long int calc_new_fs_size(unsigned long count,
|
||||
rel = bytes_str[0] == '+' || bytes_str[0] == '-';
|
||||
bytes = strtoll(bytes_str, &bytes_str, 10);
|
||||
|
||||
/* Some error occured while convertion or the specified
|
||||
/* Some error occured while convertion or the specified
|
||||
string is not valid. */
|
||||
if (bytes == LONG_LONG_MIN || bytes == LONG_LONG_MAX ||
|
||||
(bytes_str != end && bytes_str != end + 1))
|
||||
@@ -129,7 +129,7 @@ static int expand_fs(reiserfs_filsys_t *fs, long long int block_count_new)
|
||||
** haven't actually added any bitmap blocks, the bitmap won't be dirtied.
|
||||
**
|
||||
** In memory, reiserfsprogs puts zeros for the bits past the end of
|
||||
** the old filesystem. But, on disk that bitmap is full of ones.
|
||||
** the old filesystem. But, on disk that bitmap is full of ones.
|
||||
** we explicitly dirty the bitmap here to make sure the zeros get written
|
||||
** to disk
|
||||
*/
|
||||
@@ -287,7 +287,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
sb = fs->fs_ondisk_sb;
|
||||
|
||||
/* If size change was specified by user, calculate it,
|
||||
/* If size change was specified by user, calculate it,
|
||||
otherwise take the whole device. */
|
||||
block_count_new = bytes_count_str ?
|
||||
calc_new_fs_size(get_sb_block_count(sb),
|
||||
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 2002-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -90,7 +90,7 @@ static int should_make_journal_standard(reiserfs_filsys_t *fs,
|
||||
{
|
||||
if (!is_reiserfs_jr_magic_string(fs->fs_ondisk_sb))
|
||||
return 0;
|
||||
/*
|
||||
/*
|
||||
if (!user_confirmed (stderr, "ATTENTION! Filesystem with non-standard journal "
|
||||
"found. Continue? (y/n):", "y\n")) {
|
||||
exit(1);
|
||||
@@ -375,7 +375,7 @@ static void add_badblocks(reiserfs_filsys_t *fs)
|
||||
}
|
||||
|
||||
if (Bads == 1) {
|
||||
/* fs->fs_badblocks_bm contains blocks which are not in the bad
|
||||
/* fs->fs_badblocks_bm contains blocks which are not in the bad
|
||||
block list yet. Merge it with what is in the tree already. */
|
||||
badblock_list(fs, mark_badblock, NULL);
|
||||
}
|
||||
@@ -615,7 +615,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* now we try to open journal, it makes sence if there is no the flag
|
||||
NEED_TUNE in ondisk superblock and --no-journal available is not
|
||||
NEED_TUNE in ondisk superblock and --no-journal available is not
|
||||
specified. */
|
||||
if (get_jp_journal_magic(sb_jp(fs->fs_ondisk_sb)) != NEED_TUNE &&
|
||||
!(Options & OPT_SKIP_J)) {
|
||||
@@ -638,7 +638,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* in spite of journal was opened, the file system can be non-consistent or
|
||||
there are non-replayed transaction in journal,
|
||||
there are non-replayed transaction in journal,
|
||||
make sure it isn't (if there is no the flag NEED_TUNE in ondisk superblock */
|
||||
if (get_jp_journal_magic(sb_jp(fs->fs_ondisk_sb)) != NEED_TUNE &&
|
||||
reiserfs_journal_opened(fs)) {
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2004 by Hans Reiser, licensing governed by
|
||||
* Copyright 2002-2004 by Hans Reiser, licensing governed by
|
||||
* reiserfsprogs/README
|
||||
*/
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
# include <uuid/uuid.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
/*
|
||||
* options
|
||||
*/
|
||||
#define OPT_SUPER_FORCE 0x0010
|
||||
|
||||
Reference in new issue
Block a user