2007-05-22 Theodore Tso <tytso@mit.edu>
+ * pass1.c (e2fsck_pass1_check_device_inode): Mark the fs parameter
+ as unused.
+ (e2fsck_setup_tdb_icount): Use profile_get_uint() function
+ for reading the threshold. Remove unused variables.
+
+ * dirinfo.c (setup_tdb): Use the profile_get_uint() function for
+ reading the threshold.
+ (setup_db): Declare it as static
+ (setup_tdb): #include uuid.h since we use a uuid function
+ (e2fsck_get_dir_info, e2fsck_dir_info_iter_begin): Remove
+ unused variables
+ (e2fsck_dir_info_iter_end): Mark the ctx parameter as
+ unused.
+
* profile.h, profile.c (profile_get_uint): New function which
returns an unsigned integer.
#include "e2fsck.h"
#include <sys/stat.h>
#include <fcntl.h>
+#include "uuid/uuid.h"
#include <ext2fs/tdb.h>
static void setup_tdb(e2fsck_t ctx, ext2_ino_t num_dirs)
{
struct dir_info_db *db = ctx->dir_info;
+ unsigned int threshold;
errcode_t retval;
char *tdb_dir, uuid[40];
- int fd, threshold, enable;
+ int fd, enable;
profile_get_string(ctx->profile, "scratch_files", "directory", 0, 0,
&tdb_dir);
- profile_get_integer(ctx->profile, "scratch_files",
- "numdirs_threshold", 0, 0, &threshold);
+ profile_get_uint(ctx->profile, "scratch_files",
+ "numdirs_threshold", 0, 0, &threshold);
profile_get_boolean(ctx->profile, "scratch_files",
"dirinfo", 0, 1, &enable);
close(fd);
}
-void setup_db(e2fsck_t ctx)
+static void setup_db(e2fsck_t ctx)
{
struct dir_info_db *db;
ext2_ino_t num_dirs;
static struct dir_info *e2fsck_get_dir_info(e2fsck_t ctx, ext2_ino_t ino)
{
struct dir_info_db *db = ctx->dir_info;
- int low, high, mid, ret;
- struct dir_info_ent *buf;
+ int low, high, mid;
+ struct dir_info_ent *buf;
static struct dir_info ret_dir_info;
if (!db)
{
struct dir_info_iter *iter;
struct dir_info_db *db = ctx->dir_info;
- int ret;
iter = e2fsck_allocate_memory(ctx, sizeof(struct dir_info_iter),
"dir_info iterator");
return iter;
}
-extern void e2fsck_dir_info_iter_end(e2fsck_t ctx,
+extern void e2fsck_dir_info_iter_end(e2fsck_t ctx EXT2FS_ATTR((unused)),
struct dir_info_iter *iter)
{
if (iter->tdb_iter.dptr)
* since they have the same requirement; the i_block fields should be
* zero.
*/
-int e2fsck_pass1_check_device_inode(ext2_filsys fs, struct ext2_inode *inode)
+int e2fsck_pass1_check_device_inode(ext2_filsys fs EXT2FS_ATTR((unused)),
+ struct ext2_inode *inode)
{
int i;
extern void e2fsck_setup_tdb_icount(e2fsck_t ctx, int flags,
ext2_icount_t *ret)
{
+ unsigned int threshold;
ext2_ino_t num_dirs;
errcode_t retval;
- char *tdb_dir, uuid[40];
- int fd, threshold, enable;
+ char *tdb_dir;
+ int enable;
*ret = 0;
profile_get_string(ctx->profile, "scratch_files", "directory", 0, 0,
&tdb_dir);
- profile_get_integer(ctx->profile, "scratch_files",
- "numdirs_threshold", 0, 0, &threshold);
+ profile_get_uint(ctx->profile, "scratch_files",
+ "numdirs_threshold", 0, 0, &threshold);
profile_get_boolean(ctx->profile, "scratch_files",
"icount", 0, 1, &enable);