summaryrefslogtreecommitdiff
path: root/lib/ext2fs
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2002-10-25 17:29:55 -0400
committerTheodore Ts'o <tytso@mit.edu>2002-10-25 17:29:55 -0400
commit9d2aefb3bc0a48b1540d06e1983aa96c56d39e17 (patch)
tree0217048a951708c11aa6c6cb33b736f9004780c3 /lib/ext2fs
parentd90a23e2f52904326764619481fa8f209a40e226 (diff)
downloade2fsprogs-9d2aefb3bc0a48b1540d06e1983aa96c56d39e17.tar.gz
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.
Diffstat (limited to 'lib/ext2fs')
-rw-r--r--lib/ext2fs/ChangeLog8
-rw-r--r--lib/ext2fs/ext2_fs.h3
-rw-r--r--lib/ext2fs/initialize.c2
3 files changed, 11 insertions, 2 deletions
diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog
index 5d0974f3..079615c5 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 ca539025..7cd679d8 100644
--- a/lib/ext2fs/ext2_fs.h
+++ b/lib/ext2fs/ext2_fs.h
@@ -440,7 +440,8 @@ struct ext2_super_block {
__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 d9be945d..ecb27d7b 100644
--- a/lib/ext2fs/initialize.c
+++ b/lib/ext2fs/initialize.c
@@ -127,7 +127,7 @@ errcode_t ext2fs_initialize(const char *name, int flags,
}
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;