diff options
author | Theodore Ts'o <tytso@mit.edu> | 1997-10-03 17:48:10 +0000 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 1997-10-03 17:48:10 +0000 |
commit | 1b6bf1759af884957234b7dce768b785f792abd0 (patch) | |
tree | 275137be213c5a3d049080df8febbeac4b857684 /e2fsck/swapfs.c | |
parent | d163b0948731e6d84bd3efe75075a2d0a8009272 (diff) | |
download | e2fsprogs-1b6bf1759af884957234b7dce768b785f792abd0.tar.gz |
Many files:
pass*.c, super.c: Massive changes to avoid using printf and com_err
routines. All diagnostic messages are now routed through the
fix_problem interface.
pass2.c (check_dir_block): Check for duplicate '.' and '..' entries.
problem.c, problem.h: Add new problem codes PR_2_DUP_DOT and
PR_2_DUP_DOT_DOT.
problem.c: Added new problem codes for some of the superblock
corruption checks, and for the pass header messages. ("Pass
1: xxxxx")
util.c (print_resource_track): Now takes a description argument.
super.c, unix.c, e2fsck.c: New files to separate out the
operating-specific operations out from e2fsck.c. e2fsck.c now
contains the global e2fsck context management routines, and
super.c contains the "pass 0" initial validation of the
superblock and global block group descriptors.
pass1.c, pass2.c, pass3.c, pass4.c, pass5.c, util.c: Eliminate
(nearly) all global variables and moved them to the e2fsck
context structure.
problem.c, problem.h: Added new problem codes PR_0_SB_CORRUPT,
PR_0_FS_SIZE_WRONG, PR_0_NO_FRAGMENTS, PR_0_BLOCKS_PER_GROUP,
PR_0_FIRST_DATA_BLOCK
expect.1, expect.2:
Updated tests to align with e2fsck problem.c changes.
Diffstat (limited to 'e2fsck/swapfs.c')
-rw-r--r-- | e2fsck/swapfs.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/e2fsck/swapfs.c b/e2fsck/swapfs.c index a317cc78..64d4775a 100644 --- a/e2fsck/swapfs.c +++ b/e2fsck/swapfs.c @@ -102,8 +102,9 @@ static void swap_inode_blocks(ext2_filsys fs, ino_t ino, char *block_buf, } } -static void swap_inodes(ext2_filsys fs) +static void swap_inodes(e2fsck_t ctx) { + ext2_filsys fs = ctx->fs; int i, group; ino_t ino = 1; char *buf, *block_buf; @@ -135,8 +136,8 @@ static void swap_inodes(ext2_filsys fs) inode = (struct ext2_inode *) buf; for (i=0; i < fs->super->s_inodes_per_group; i++, ino++, inode++) { - stashed_ino = ino; - stashed_inode = inode; + ctx->stashed_ino = ino; + ctx->stashed_inode = inode; if (fs->flags & EXT2_FLAG_SWAP_BYTES_READ) ext2fs_swap_inode(fs, inode, inode, 0); @@ -173,13 +174,14 @@ static void swap_inodes(ext2_filsys fs) fs->get_blocks = 0; } -void swap_filesys(ext2_filsys fs) +void swap_filesys(e2fsck_t ctx) { + ext2_filsys fs = ctx->fs; struct resource_track rtrack; init_resource_track(&rtrack); - if (!preen) + if (!(ctx->options & E2F_OPT_PREEN)) printf("Pass 0: Doing byte-swap of filesystem\n"); #ifdef MTRACE @@ -190,7 +192,7 @@ void swap_filesys(ext2_filsys fs) fprintf(stderr, "%s: the filesystem must be freshly " "checked using fsck\n" "and not mounted before trying to " - "byte-swap it.\n", device_name); + "byte-swap it.\n", ctx->device_name); fatal_error(0); } if (fs->flags & EXT2_FLAG_SWAP_BYTES) { @@ -201,17 +203,15 @@ void swap_filesys(ext2_filsys fs) fs->flags &= ~EXT2_FLAG_SWAP_BYTES_READ; fs->flags |= EXT2_FLAG_SWAP_BYTES_WRITE; } - swap_inodes(fs); + swap_inodes(ctx); if (fs->flags & EXT2_FLAG_SWAP_BYTES_WRITE) fs->flags |= EXT2_FLAG_SWAP_BYTES; fs->flags &= ~(EXT2_FLAG_SWAP_BYTES_READ| EXT2_FLAG_SWAP_BYTES_WRITE); ext2fs_flush(fs); - if (tflag > 1) { - printf("Byte swap: "); - print_resource_track(&rtrack); - } + if (ctx->options & E2F_OPT_TIME2) + print_resource_track("Byte swap", &rtrack); } |