* scantest.c - test the speed of the inode scan routine
*/
+#include "config.h"
#include <string.h>
#include <fcntl.h>
#include <ctype.h>
#include <getopt.h>
#endif
#include <unistd.h>
-#ifdef HAVE_MNTENT_H
-#include <mntent.h>
-#endif
#include <sys/ioctl.h>
+#ifdef HAVE_MALLOC_H
#include <malloc.h>
+#endif
#include <sys/resource.h>
#include "et/com_err.h"
#include <sys/types.h>
#include <sys/time.h>
-#include <linux/ext2_fs.h>
-
+#include "ext2fs/ext2_fs.h"
#include "ext2fs/ext2fs.h"
void init_resource_track(struct resource_track *track)
{
struct rusage r;
-
+
track->brk_start = sbrk(0);
gettimeofday(&track->time_start, 0);
getrusage(RUSAGE_SELF, &r);
gettimeofday(&time_end, 0);
getrusage(RUSAGE_SELF, &r);
- printf(_("Memory used: %d, elapsed time: %6.3f/%6.3f/%6.3f\n"),
- (int) (((char *) sbrk(0)) - ((char *) track->brk_start)),
+ printf(_("Memory used: %lu, elapsed time: %6.3f/%6.3f/%6.3f\n"),
+ (unsigned long)((char *)sbrk(0) - (char *)track->brk_start),
timeval_subtract(&time_end, &track->time_start),
timeval_subtract(&r.ru_utime, &track->user_start),
timeval_subtract(&r.ru_stime, &track->system_start));
printf(_("size of inode=%d\n"), sizeof(inode));
device_name = "/dev/hda3";
-
+
init_resource_track(&global_rtrack);
retval = ext2fs_open(device_name, 0,
exit(1);
}
}
-
- ext2fs_close(fs);
-
+
+ ext2fs_close_free(&fs);
+
print_resource_track(&global_rtrack);
-
+
return exit_value;
}