Imported reiserfsprogs-3.6.19

This commit is contained in:
Jeff Mahoney committed 2012-10-11 11:31:31 -04:00
1 parent 3078c83c48
commit 0ed773997f
34 files changed
+724 -560

No files matched your search

+11 -6
View File
@@ -25,19 +25,24 @@ static void quit_resizer(reiserfs_filsys_t * fs)
/* save changes to bitmap blocks */
reiserfs_close (fs);
/* leave fs in ERROR state */
DIE ("fs shrinking was not completed successfully, run reiserfsck.");
reiserfs_exit(1, "fs shrinking was not completed successfully, "
"run reiserfsck.");
}
/* block moving */
static unsigned long move_generic_block(reiserfs_filsys_t * fs, unsigned long block, unsigned long bnd, int h)
static unsigned long move_generic_block(reiserfs_filsys_t * fs,
unsigned long block,
unsigned long bnd, int h)
{
struct buffer_head * bh, * bh2;
/* primitive fsck */
if (block > get_sb_block_count(ondisk_sb)) {
fprintf(stderr, "resize_reiserfs: invalid block number (%lu) found.\n", block);
fprintf(stderr, "resize_reiserfs: invalid block number "
"(%lu) found.\n", block);
quit_resizer(fs);
}
/* progress bar, 3D style :) */
if (opt_verbose)
print_how_far(stderr, &total_node_cnt, blocks_used, 1, 0);
@@ -57,7 +62,7 @@ static unsigned long move_generic_block(reiserfs_filsys_t * fs, unsigned long bl
bh = bread(fs->fs_dev, block, fs->fs_blocksize);
if (!bh)
reiserfs_panic ("move_generic_block: bread failed.\n");
reiserfs_exit (1, "move_generic_block: bread failed.\n");
reiserfs_bitmap_find_zero_bit(bmp, &unused_block);
if (unused_block == 0 || unused_block >= bnd) {
@@ -103,7 +108,7 @@ static unsigned long move_formatted_block(reiserfs_filsys_t * fs, unsigned long
bh = bread(fs->fs_dev, block, fs->fs_blocksize);
if (!bh)
reiserfs_panic ("move_formatted_block: bread failed");
reiserfs_exit (1, "move_formatted_block: bread failed");
if (is_leaf_node (bh)) {
@@ -208,7 +213,7 @@ int shrink_fs(reiserfs_filsys_t * fs, long long int blocks)
reiserfs_reopen(fs, O_RDWR);
if (reiserfs_open_ondisk_bitmap (fs))
DIE("cannot open ondisk bitmap");
reiserfs_exit(1, "cannot open ondisk bitmap");
bmp = fs->fs_bitmap2;
ondisk_sb = fs->fs_ondisk_sb;
+1 -1
View File
@@ -1,7 +1,7 @@
.\" -*- nroff -*-
.\" Copyright 1996-2004 Hans Reiser.
.\"
.TH RESIZE_REISERFS 8 "January 2004" "Reiserfsprogs-3.6.18"
.TH RESIZE_REISERFS 8 "January 2004" "Reiserfsprogs-3.6.19"
.SH NAME
resize_reiserfs \- resizer tool for the ReiserFS filesystem
.SH SYNOPSIS
+26 -14
View File
@@ -99,7 +99,7 @@ static int expand_fs (reiserfs_filsys_t * fs, long long int block_count_new) {
reiserfs_reopen(fs, O_RDWR);
if (reiserfs_open_ondisk_bitmap (fs))
DIE("cannot open ondisk bitmap");
reiserfs_exit(1, "cannot open ondisk bitmap");
sb = fs->fs_ondisk_sb;
@@ -109,7 +109,7 @@ static int expand_fs (reiserfs_filsys_t * fs, long long int block_count_new) {
if (reiserfs_expand_bitmap(fs->fs_bitmap2, block_count_new))
DIE("cannot expand bitmap\n");
reiserfs_exit(1, "cannot expand bitmap\n");
/* count bitmap blocks in new fs */
@@ -201,12 +201,12 @@ int main(int argc, char *argv[]) {
switch (c) {
case 's' :
if (!optarg)
DIE("Missing argument to -s option");
reiserfs_exit(1, "Missing argument to -s option");
bytes_count_str = optarg;
break;
case 'j' :
if (!optarg)
DIE("Missing argument to -j option");
reiserfs_exit(1, "Missing argument to -j option");
jdevice_name = optarg;
case 'f':
opt_force = 1;
@@ -244,26 +244,38 @@ int main(int argc, char *argv[]) {
devname = argv[optind];
fs = reiserfs_open(devname, O_RDONLY, &error, 0, 1);
if (!fs)
DIE ("cannot open '%s': %s", devname, strerror(error));
if (!fs) {
if (error) {
reiserfs_exit(1, "cannot open '%s': %s",
devname, strerror(error));
} else {
exit(1);
}
}
if (reiserfs_open_journal (fs, jdevice_name, O_RDWR | O_LARGEFILE))
DIE ("Failed to open the journal device (%s).", jdevice_name);
if (reiserfs_open_journal (fs, jdevice_name, O_RDWR | O_LARGEFILE)) {
reiserfs_exit(1, "Failed to open the journal device (%s).",
jdevice_name);
}
if (reiserfs_journal_params_check(fs)) {
if (!opt_skipj)
DIE ("Wrong journal parameters detected on (%s)", jdevice_name);
else
if (!opt_skipj) {
reiserfs_exit(1, "Wrong journal parameters detected on (%s)",
jdevice_name);
} else {
reiserfs_close_journal(fs);
}
}
/* forced to continue without journal available/specified */
if (no_reiserfs_found (fs)) {
DIE ("no reiserfs found on the device.");
reiserfs_exit(1, "no reiserfs found on the device.");
}
if (!spread_bitmaps (fs)) {
DIE ("cannot resize reiserfs in old (not spread bitmap) format.");
reiserfs_exit(1, "cannot resize reiserfs in old (not spread "
"bitmap) format.");
}
sb = fs->fs_ondisk_sb;
@@ -295,7 +307,7 @@ int main(int argc, char *argv[]) {
if (get_sb_umount_state(sb) != FS_CLEANLY_UMOUNTED)
/* fixme: shouldn't we check for something like: fsck guarantees: fs is ok */
DIE ("the file system isn't in valid state.");
reiserfs_exit(1, "the file system isn't in valid state.");
/* Needed to keep idiot compiler from issuing false warning */
sb_old = 0;