just whitespace
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
* mkjournal.c --- make a journal for a filesystem
|
||||
*
|
||||
* Copyright (C) 2000 Theodore Ts'o.
|
||||
*
|
||||
*
|
||||
* %Begin-Header%
|
||||
* This file may be redistributed under the terms of the GNU Public
|
||||
* License.
|
||||
@ -155,7 +155,7 @@ static int mkjournal_proc(ext2_filsys fs,
|
||||
blk_t new_blk;
|
||||
static blk_t last_blk = 0;
|
||||
errcode_t retval;
|
||||
|
||||
|
||||
if (*blocknr) {
|
||||
last_blk = *blocknr;
|
||||
return 0;
|
||||
@ -186,7 +186,7 @@ static int mkjournal_proc(ext2_filsys fs,
|
||||
return (BLOCK_CHANGED | BLOCK_ABORT);
|
||||
else
|
||||
return BLOCK_CHANGED;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@ -202,7 +202,7 @@ static errcode_t write_journal_inode(ext2_filsys fs, ext2_ino_t journal_ino,
|
||||
|
||||
if ((retval = ext2fs_create_journal_superblock(fs, size, flags, &buf)))
|
||||
return retval;
|
||||
|
||||
|
||||
if ((retval = ext2fs_read_bitmaps(fs)))
|
||||
return retval;
|
||||
|
||||
@ -227,7 +227,7 @@ static errcode_t write_journal_inode(ext2_filsys fs, ext2_ino_t journal_ino,
|
||||
if ((retval = ext2fs_read_inode(fs, journal_ino, &inode)))
|
||||
goto errout;
|
||||
|
||||
inode.i_size += fs->blocksize * size;
|
||||
inode.i_size += fs->blocksize * size;
|
||||
inode.i_blocks += (fs->blocksize / 512) * es.newblocks;
|
||||
inode.i_mtime = inode.i_ctime = time(0);
|
||||
inode.i_links_count = 1;
|
||||
@ -262,7 +262,7 @@ errcode_t ext2fs_add_journal_device(ext2_filsys fs, ext2_filsys journal_dev)
|
||||
/* Make sure the device exists and is a block device */
|
||||
if (stat(journal_dev->device_name, &st) < 0)
|
||||
return errno;
|
||||
|
||||
|
||||
if (!S_ISBLK(st.st_mode))
|
||||
return EXT2_ET_JOURNAL_NOT_BLOCK; /* Must be a block device */
|
||||
|
||||
@ -297,7 +297,7 @@ errcode_t ext2fs_add_journal_device(ext2_filsys fs, ext2_filsys journal_dev)
|
||||
/* Writeback the journal superblock */
|
||||
if ((retval = io_channel_write_blk(journal_dev->io, start, -1024, buf)))
|
||||
return retval;
|
||||
|
||||
|
||||
fs->super->s_journal_inum = 0;
|
||||
fs->super->s_journal_dev = st.st_rdev;
|
||||
memcpy(fs->super->s_journal_uuid, jsb->s_uuid,
|
||||
@ -328,7 +328,7 @@ errcode_t ext2fs_add_journal_inode(ext2_filsys fs, blk_t size, int flags)
|
||||
strcat(jfile, "/.journal");
|
||||
|
||||
/*
|
||||
* If .../.journal already exists, make sure any
|
||||
* If .../.journal already exists, make sure any
|
||||
* immutable or append-only flags are cleared.
|
||||
*/
|
||||
#if defined(HAVE_CHFLAGS) && defined(UF_NODUMP)
|
||||
@ -350,7 +350,7 @@ errcode_t ext2fs_add_journal_inode(ext2_filsys fs, blk_t size, int flags)
|
||||
|
||||
if ((retval = write_journal_file(fs, jfile, size, flags)))
|
||||
goto errout;
|
||||
|
||||
|
||||
/* Get inode number of the journal file */
|
||||
if (fstat(fd, &st) < 0)
|
||||
goto errout;
|
||||
@ -365,7 +365,7 @@ errcode_t ext2fs_add_journal_inode(ext2_filsys fs, blk_t size, int flags)
|
||||
#endif
|
||||
if (retval)
|
||||
goto errout;
|
||||
|
||||
|
||||
close(fd);
|
||||
journal_ino = st.st_ino;
|
||||
} else {
|
||||
@ -374,7 +374,7 @@ errcode_t ext2fs_add_journal_inode(ext2_filsys fs, blk_t size, int flags)
|
||||
size, flags)))
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
fs->super->s_journal_inum = journal_ino;
|
||||
fs->super->s_journal_dev = 0;
|
||||
memset(fs->super->s_journal_uuid, 0,
|
||||
@ -393,14 +393,14 @@ main(int argc, char **argv)
|
||||
{
|
||||
errcode_t retval;
|
||||
char *device_name;
|
||||
ext2_filsys fs;
|
||||
ext2_filsys fs;
|
||||
|
||||
if (argc < 2) {
|
||||
fprintf(stderr, "Usage: %s filesystem\n", argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
device_name = argv[1];
|
||||
|
||||
|
||||
retval = ext2fs_open (device_name, EXT2_FLAG_RW, 0, 0,
|
||||
unix_io_manager, &fs);
|
||||
if (retval) {
|
||||
@ -420,6 +420,6 @@ main(int argc, char **argv)
|
||||
}
|
||||
ext2fs_close(fs);
|
||||
exit(0);
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user