#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE
+#include "config.h"
#include <stdio.h>
#include <string.h>
#ifdef HAVE_ERRNO_H
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
+#include <time.h>
#include "et/com_err.h"
#include "e2p/e2p.h"
void check_plausibility(const char *device)
{
int val;
-#ifdef HAVE_OPEN64
- struct stat64 s;
+ ext2fs_struct_stat s;
- val = stat64(device, &s);
-#else
- struct stat s;
-
- val = stat(device, &s);
-#endif
+ val = ext2fs_stat(device, &s);
if(val == -1) {
fprintf(stderr, _("Could not stat %s --- %s\n"),
if (strcmp(token, "device") == 0) {
journal_device = blkid_get_devname(NULL, arg, NULL);
if (!journal_device) {
+ if (arg)
+ fprintf(stderr, _("\nCould not find "
+ "journal device matching %s\n"),
+ arg);
journal_usage++;
continue;
}
return j_blocks;
}
-void print_check_message(ext2_filsys fs)
+void print_check_message(int mnt, unsigned int check)
{
+ if (mnt < 0)
+ mnt = 0;
+ if (!mnt && !check)
+ return;
printf(_("This filesystem will be automatically "
"checked every %d mounts or\n"
"%g days, whichever comes first. "
"Use tune2fs -c or -i to override.\n"),
- fs->super->s_max_mnt_count,
- (double)fs->super->s_checkinterval / (3600 * 24));
+ mnt, ((double) check) / (3600 * 24));
+}
+
+void dump_mmp_msg(struct mmp_struct *mmp, const char *msg)
+{
+
+ if (msg)
+ printf("MMP check failed: %s\n", msg);
+ if (mmp) {
+ time_t t = mmp->mmp_time;
+
+ printf("MMP error info: last update: %s node: %s device: %s\n",
+ ctime(&t), mmp->mmp_nodename, mmp->mmp_bdevname);
+ }
}