+ e2p_list_journal_super(stdout, buf, fs->blocksize, 0);
+}
+
+static int check_mmp(ext2_filsys fs)
+{
+ int retval;
+
+ /* This won't actually start MMP on the filesystem, since fs is opened
+ * readonly, but it will do the proper activity checking for us. */
+ retval = ext2fs_mmp_start(fs);
+ if (retval) {
+ com_err(program_name, retval, _("while trying to open %s"),
+ fs->device_name);
+ if (retval == EXT2_ET_MMP_FAILED ||
+ retval == EXT2_ET_MMP_FSCK_ON ||
+ retval == EXT2_ET_MMP_CSUM_INVALID ||
+ retval == EXT2_ET_MMP_UNKNOWN_SEQ) {
+ if (fs->mmp_buf) {
+ struct mmp_struct *mmp = fs->mmp_buf;
+ time_t mmp_time = mmp->mmp_time;
+
+ fprintf(stderr,
+ "%s: MMP last updated by '%s' on %s",
+ program_name, mmp->mmp_nodename,
+ ctime(&mmp_time));
+ }
+ retval = 1;
+ } else {
+ retval = 2;
+ }
+ } else {
+ printf("%s: it is safe to mount '%s', MMP is clean\n",
+ program_name, fs->device_name);
+ }
+
+ return retval;
+}
+
+static void print_mmp_block(ext2_filsys fs)
+{
+ struct mmp_struct *mmp;
+ time_t mmp_time;
+ errcode_t retval;
+
+ if (fs->mmp_buf == NULL) {
+ retval = ext2fs_get_mem(fs->blocksize, &fs->mmp_buf);
+ if (retval) {
+ com_err(program_name, retval,
+ _("failed to alloc MMP buffer\n"));
+ return;
+ }
+ }