diff options
author | Theodore Ts'o <tytso@mit.edu> | 2002-10-25 17:29:55 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2002-10-25 17:29:55 -0400 |
commit | 9d2aefb3bc0a48b1540d06e1983aa96c56d39e17 (patch) | |
tree | 0217048a951708c11aa6c6cb33b736f9004780c3 /lib/e2p/ls.c | |
parent | d90a23e2f52904326764619481fa8f209a40e226 (diff) | |
download | e2fsprogs-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/e2p/ls.c')
-rw-r--r-- | lib/e2p/ls.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/e2p/ls.c b/lib/e2p/ls.c index cc3e3ca3..9e2b1b52 100644 --- a/lib/e2p/ls.c +++ b/lib/e2p/ls.c @@ -207,11 +207,16 @@ void list_super2(struct ext2_super_block * sb, FILE *f) fprintf(f, "Fragments per group: %u\n", sb->s_frags_per_group); fprintf(f, "Inodes per group: %u\n", sb->s_inodes_per_group); fprintf(f, "Inode blocks per group: %u\n", inode_blocks_per_group); - tm = sb->s_mtime; if (sb->s_first_meta_bg) fprintf(f, "First meta block group: %u\n", sb->s_first_meta_bg); - fprintf(f, "Last mount time: %s", ctime(&tm)); + if (sb->s_mkfs_time) { + tm = sb->s_mkfs_time; + fprintf(f, "Filesystem created: %s", ctime(&tm)); + } + tm = sb->s_mtime; + fprintf(f, "Last mount time: %s", + sb->s_mtime ? ctime(&tm) : "n/a\n"); tm = sb->s_wtime; fprintf(f, "Last write time: %s", ctime(&tm)); fprintf(f, "Mount count: %u\n", sb->s_mnt_count); |