Add a new superblock field, s_mkfs_time, which indicates when
the filesystem was created. It is set via mke2fs, and printed
via list_super2() (which is called by dumpe2fs).
Also, list_super2() will now print "n/a" if the last mount time
(s_mtime) is zero.
diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog
index 5d0974f..079615c 100644
--- a/lib/ext2fs/ChangeLog
+++ b/lib/ext2fs/ChangeLog
@@ -1,3 +1,11 @@
+2002-10-25 Theodore Ts'o <tytso@mit.edu>
+
+ * ext2_fs.h: Add a new superblock field, s_mkfs_time, so that we
+ know when a filesystem was created. (Sometimes this can
+ be useful...)
+
+ * initialize.c (ext2fs_initialize): Set the s_mkfs_time field.
+
2002-10-20 Theodore Ts'o <tytso@valinux.com>
* ext2_fs.h (EXT3_DEFM_JMODE): Add new default mount options for
diff --git a/lib/ext2fs/ext2_fs.h b/lib/ext2fs/ext2_fs.h
index ca53902..7cd679d 100644
--- a/lib/ext2fs/ext2_fs.h
+++ b/lib/ext2fs/ext2_fs.h
@@ -440,7 +440,8 @@
__u16 s_reserved_word_pad;
__u32 s_default_mount_opts;
__u32 s_first_meta_bg; /* First metablock group */
- __u32 s_reserved[190]; /* Padding to the end of the block */
+ __u32 s_mkfs_time; /* When the filesystem was created */
+ __u32 s_reserved[189]; /* Padding to the end of the block */
};
/*
diff --git a/lib/ext2fs/initialize.c b/lib/ext2fs/initialize.c
index d9be945..ecb27d7 100644
--- a/lib/ext2fs/initialize.c
+++ b/lib/ext2fs/initialize.c
@@ -127,7 +127,7 @@
}
set_field(s_checkinterval, EXT2_DFL_CHECKINTERVAL);
- super->s_lastcheck = time(NULL);
+ super->s_mkfs_time = super->s_lastcheck = time(NULL);
super->s_creator_os = CREATOR_OS;