This fixes the last set of gcc -Wall complaints.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
void do_extent_open(int argc, char *argv[])
{
- struct ext3_extent_header *eh;
ext2_ino_t inode;
- int i, ret;
+ int ret;
errcode_t retval;
char *cp;
{
struct ext2fs_extent extent;
errcode_t retval;
- int err;
if (common_extent_args_process(argc, argv, 1, 1, "delete_node",
"", CHECK_FS_RW | CHECK_FS_BITMAPS))
void do_split_node(int argc, char *argv[])
{
errcode_t retval;
- struct ext2fs_extent extent;
- int err;
if (common_extent_args_process(argc, argv, 1, 1, "split_node",
"", CHECK_FS_RW | CHECK_FS_BITMAPS))
void do_fix_parents(int argc, char **argv)
{
- struct ext2fs_extent extent;
- struct ext2_extent_info info;
errcode_t retval;
if (common_extent_args_process(argc, argv, 1, 1, "fix_parents", "",
void do_goto_block(int argc, char **argv)
{
- struct ext2fs_extent extent;
errcode_t retval;
- int op = EXT2_EXTENT_NEXT_LEAF;
blk64_t blk;
int level = 0, err;
char *buf = NULL;
struct ext2_dx_root_info *rootnode;
struct ext2_dx_entry *ent;
- struct ext2_dx_countlimit *limit;
errcode_t errcode;
if (check_fs_open(argv[0]))
fprintf(pager, "\t Flags: %d\n", rootnode->unused_flags);
ent = (struct ext2_dx_entry *) (buf + 24 + rootnode->info_length);
- limit = (struct ext2_dx_countlimit *) ent;
htree_dump_int_node(current_fs, ino, &inode, rootnode, ent,
buf + current_fs->blocksize,
ext2_ino_t inode;
errcode_t errcode;
blk64_t block;
- int retval;
char *file = NULL;
- char *in_file = NULL;
int c, err;
int offset = -1;
int length = -1;
void do_dump_block(int argc, char *argv[])
{
- unsigned long pattern = 0;
unsigned char *buf;
ext2_ino_t inode;
errcode_t errcode;
blk64_t block;
- int retval;
char *file = NULL;
- char *in_file = NULL;
int c, err, i, j;
int suppress = -1;
struct ext2_super_block *sb = ctx->fs->super;
struct ext2_inode_large *inode;
struct ext2_ext_attr_entry *entry;
- char *start, *end;
+ char *start;
unsigned int storage_size, remain;
int problem = 0;
inode->i_extra_isize;
start = ((char *) inode) + EXT2_GOOD_OLD_INODE_SIZE +
inode->i_extra_isize + sizeof(__u32);
- end = (char *) inode + EXT2_INODE_SIZE(ctx->fs->super);
entry = (struct ext2_ext_attr_entry *) start;
/* scan all entry's headers first */
int journal_skip_recovery(journal_t *journal)
{
int err;
- journal_superblock_t * sb;
-
struct recovery_info info;
memset (&info, 0, sizeof(info));
- sb = journal->j_superblock;
err = do_one_pass(journal, &info, PASS_SCAN);
int tag_bytes = journal_tag_bytes(journal);
__u32 crc32_sum = ~0; /* Transactional Checksums */
- /* Precompute the maximum metadata descriptors in a descriptor block */
- int MAX_BLOCKS_PER_DESC;
- MAX_BLOCKS_PER_DESC = ((journal->j_blocksize-sizeof(journal_header_t))
- / tag_bytes);
-
/*
* First thing is to establish what we expect to find in the log
* (in terms of transaction IDs), and where (in terms of log
struct dir_info_iter * dirinfo_iter = 0;
ext2_ino_t ino;
errcode_t retval;
- int cur, max, all_dirs, dir_index, first = 1;
+ int cur, max, all_dirs, first = 1;
init_resource_track(&rtrack, ctx->fs->io);
all_dirs = ctx->options & E2F_OPT_COMPRESS_DIRS;
clear_problem_context(&pctx);
- dir_index = ctx->fs->super->s_feature_compat & EXT2_FEATURE_COMPAT_DIR_INDEX;
cur = 0;
if (all_dirs) {
dirinfo_iter = e2fsck_dir_info_iter_begin(ctx);
ctx->fs_blockdev_count), ctx->fs_blockdev_count);
log_out(ctx, P_("%12u fifo\n", "%12u fifos\n", ctx->fs_fifo_count),
ctx->fs_fifo_count);
- log_out(ctx, P_("%12u link\n", "%12u links\n",
- ctx->fs_links_count - dir_links),
+ log_out(ctx, P_("%12u link\n", "%12u links\n", num_links),
ctx->fs_links_count - dir_links);
log_out(ctx, P_("%12u symbolic link", "%12u symbolic links",
ctx->fs_symlinks_count), ctx->fs_symlinks_count);
ctx->fs_sockets_count),
ctx->fs_sockets_count);
log_out(ctx, "------------\n");
- log_out(ctx, P_("%12u file\n", "%12u files\n",
- ctx->fs_total_count - dir_links),
- ctx->fs_total_count - dir_links);
+ log_out(ctx, P_("%12u file\n", "%12u files\n", num_files),
+ num_files);
}
static void check_mount(e2fsck_t ctx)
errcode_t e2fsck_zero_blocks(ext2_filsys fs, blk_t blk, int num,
blk_t *ret_blk, int *ret_count)
{
- int j, count, next_update, next_update_incr;
+ int j, count;
static char *buf;
errcode_t retval;
memset(buf, 0, fs->blocksize * STRIDE_LENGTH);
}
/* OK, do the write loop */
- next_update = 0;
- next_update_incr = num / 100;
- if (next_update_incr < 1)
- next_update_incr = 1;
for (j = 0; j < num; j += STRIDE_LENGTH, blk += STRIDE_LENGTH) {
count = num - j;
if (count > STRIDE_LENGTH)
r = ioctl (fd, EXT2_IOC_GETVERSION, &ver);
*version = ver;
- return 0;
+ return r;
#else /* ! HAVE_EXT2_IOCTLS */
extern int errno;
errno = EOPNOTSUPP;
unsigned char *cp = in;
size_t i;
int first_set = -1;
- int ret;
bp = (struct ext2fs_rb_private *) bitmap->private;
for (i = 0; i < num; i++) {
- if (i & 7 == 0) {
+ if ((i & 7) == 0) {
unsigned char c = cp[i/8];
if (c == 0xFF) {
if (first_set == -1)
errcode_t ext2fs_image_bitmap_write(ext2_filsys fs, int fd, int flags)
{
ext2fs_generic_bitmap bmap;
- errcode_t err, retval;
+ errcode_t retval;
ssize_t actual;
__u32 itr, cnt, size;
int c, total_size;
return retval;
}
bmap = fs->inode_map;
- err = EXT2_ET_MAGIC_INODE_BITMAP;
itr = 1;
cnt = EXT2_INODES_PER_GROUP(fs->super) * fs->group_desc_count;
size = (EXT2_INODES_PER_GROUP(fs->super) / 8);
return retval;
}
bmap = fs->block_map;
- err = EXT2_ET_MAGIC_BLOCK_BITMAP;
itr = fs->super->s_first_data_block;
cnt = EXT2_BLOCKS_PER_GROUP(fs->super) * fs->group_desc_count;
size = EXT2_BLOCKS_PER_GROUP(fs->super) / 8;
errcode_t ext2fs_image_bitmap_read(ext2_filsys fs, int fd, int flags)
{
ext2fs_generic_bitmap bmap;
- errcode_t err, retval;
+ errcode_t retval;
__u32 itr, cnt;
char buf[1024];
unsigned int size;
return retval;
}
bmap = fs->inode_map;
- err = EXT2_ET_MAGIC_INODE_BITMAP;
itr = 1;
cnt = EXT2_INODES_PER_GROUP(fs->super) * fs->group_desc_count;
size = (EXT2_INODES_PER_GROUP(fs->super) / 8);
return retval;
}
bmap = fs->block_map;
- err = EXT2_ET_MAGIC_BLOCK_BITMAP;
itr = fs->super->s_first_data_block;
cnt = EXT2_BLOCKS_PER_GROUP(fs->super) * fs->group_desc_count;
size = EXT2_BLOCKS_PER_GROUP(fs->super) / 8;
errcode_t retval;
unsigned long i, first_meta_bg;
__u32 features;
- unsigned int groups_per_block, blocks_per_group, io_flags;
+ unsigned int blocks_per_group, io_flags;
blk64_t group_block, blk;
char *dest, *cp;
#ifdef WORDS_BIGENDIAN
+ unsigned int groups_per_block;
struct ext2_group_desc *gdp;
int j;
#endif
if (group_block == 0 && fs->blocksize == 1024)
group_block = 1; /* Deal with 1024 blocksize && bigalloc */
dest = (char *) fs->group_desc;
+#ifdef WORDS_BIGENDIAN
groups_per_block = EXT2_DESC_PER_BLOCK(fs->super);
+#endif
if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG)
first_meta_bg = fs->super->s_first_meta_bg;
else
#include "../version.h"
#include "nls-enable.h"
-const char * program_name = "get_fstab";
+const char * program_name = "e2initrd_helper";
char * device_name;
static int open_flag;
static int root_type;
usage();
device_name = blkid_get_devname(NULL, argv[optind], NULL);
if (!device_name) {
- com_err("tune2fs", 0, _("Unable to resolve '%s'"),
+ com_err(program_name, 0, _("Unable to resolve '%s'"),
argv[optind]);
exit(1);
}
int ret;
retval = get_file(fs, "/etc/fstab", &file);
+ if (retval) {
+ com_err(program_name, retval, "couldn't open /etc/fstab");
+ exit(1);
+ }
while (!mem_file_eof(&file)) {
buf = get_line(&file);
static struct statfs fsinfo;
ext2fs_struct_stat st;
int blk_shift;
- int bs;
long fd;
unsigned long numblocks;
int data_blocks_per_cyl = 1;
*io_options++ = 0;
device_name = blkid_get_devname(NULL, argv[optind], NULL);
if (!device_name) {
- com_err("tune2fs", 0, _("Unable to resolve '%s'"),
+ com_err(program_name, 0, _("Unable to resolve '%s'"),
argv[optind]);
exit(1);
}