4 |
* |
* |
5 |
* Copyright 1995, 1996, 1997, 1998, 1999, 2000 by Theodore Ts'o. |
* Copyright 1995, 1996, 1997, 1998, 1999, 2000 by Theodore Ts'o. |
6 |
* |
* |
7 |
* %Begin-Header% |
* Licensed under GPLv2, see file LICENSE in this tarball for details. |
|
* This file may be redistributed under the terms of the GNU Public |
|
|
* License. |
|
|
* %End-Header% |
|
8 |
*/ |
*/ |
9 |
|
|
10 |
#include <stdio.h> |
#include <stdio.h> |
35 |
if (force) |
if (force) |
36 |
return; |
return; |
37 |
if (val == -1) |
if (val == -1) |
38 |
bb_perror_msg_and_die("cannot stat %s", device); |
bb_perror_msg_and_die("can't stat %s", device); |
39 |
if (!S_ISBLK(s.st_mode)) { |
if (!S_ISBLK(s.st_mode)) { |
40 |
printf("%s is not a block special device.\n", device); |
printf("%s is not a block special device.\n", device); |
41 |
proceed_question(); |
proceed_question(); |
79 |
|
|
80 |
retval = ext2fs_check_if_mounted(device, &mount_flags); |
retval = ext2fs_check_if_mounted(device, &mount_flags); |
81 |
if (retval) { |
if (retval) { |
82 |
bb_error_msg("cannot determine if %s is mounted", device); |
bb_error_msg("can't determine if %s is mounted", device); |
83 |
return; |
return; |
84 |
} |
} |
85 |
if (mount_flags & EXT2_MF_MOUNTED) { |
if (mount_flags & EXT2_MF_MOUNTED) { |
216 |
EXT2_FLAG_JOURNAL_DEV_OK, 0, |
EXT2_FLAG_JOURNAL_DEV_OK, 0, |
217 |
fs->blocksize, io_ptr, &jfs); |
fs->blocksize, io_ptr, &jfs); |
218 |
if (retval) |
if (retval) |
219 |
bb_error_msg_and_die("cannot journal device %s", journal_device); |
bb_error_msg_and_die("can't journal device %s", journal_device); |
220 |
if (!quiet) |
if (!quiet) |
221 |
printf("Adding journal to device %s: ", journal_device); |
printf("Adding journal to device %s: ", journal_device); |
222 |
fflush(stdout); |
fflush(stdout); |
245 |
retval = ext2fs_add_journal_inode(fs, journal_blocks, |
retval = ext2fs_add_journal_inode(fs, journal_blocks, |
246 |
journal_flags); |
journal_flags); |
247 |
if (retval) |
if (retval) |
248 |
bb_error_msg_and_die("cannot create journal"); |
bb_error_msg_and_die("can't create journal"); |
249 |
if (!quiet) |
if (!quiet) |
250 |
puts("done"); |
puts("done"); |
251 |
} |
} |