Whamcloud - gitweb
LU-14712 e2fsprogs: support EXT2_FLAG_BG_TRIMMED and EXT2_FLAGS_TRACK_TRIM
[tools/e2fsprogs.git] / lib / e2p / ls.c
index 9511d2c..b40929c 100644 (file)
@@ -162,6 +162,14 @@ static void print_super_flags(struct ext2_super_block * s, FILE *f)
                fputs("test_filesystem ", f);
                flags_found++;
        }
+       if (s->s_flags & EXT2_FLAGS_TRACK_TRIM) {
+               fputs("track_trim ", f);
+               flags_found++;
+       }
+       if (s->s_flags & EXT2_FLAGS_HAS_IOPS) {
+               fputs("iops ", f);
+               flags_found++;
+       }
        if (flags_found)
                fputs("\n", f);
        else
@@ -313,27 +321,23 @@ void list_super2(struct ext2_super_block * sb, FILE *f)
        if (sb->s_log_groups_per_flex)
                fprintf(f, "Flex block group size:    %u\n",
                        1U << sb->s_log_groups_per_flex);
-       if (sb->s_mkfs_time) {
-               tm = sb->s_mkfs_time;
+       tm = ext2fs_get_tstamp(sb, s_mkfs_time);
+       if (tm)
                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;
+       tm = ext2fs_get_tstamp(sb, s_mtime);
+       fprintf(f, "Last mount time:          %s", tm ? ctime(&tm) : "n/a\n");
+       tm = ext2fs_get_tstamp(sb, s_wtime);
        fprintf(f, "Last write time:          %s", ctime(&tm));
        fprintf(f, "Mount count:              %u\n", sb->s_mnt_count);
        fprintf(f, "Maximum mount count:      %d\n", sb->s_max_mnt_count);
-       tm = sb->s_lastcheck;
+       tm = ext2fs_get_tstamp(sb, s_lastcheck);
        fprintf(f, "Last checked:             %s", ctime(&tm));
        fprintf(f, "Check interval:           %u (%s)\n", sb->s_checkinterval,
               interval_string(sb->s_checkinterval));
        if (sb->s_checkinterval)
        {
-               time_t next;
-
-               next = sb->s_lastcheck + sb->s_checkinterval;
-               fprintf(f, "Next check after:         %s", ctime(&next));
+               tm += sb->s_checkinterval;
+               fprintf(f, "Next check after:         %s", ctime(&tm));
        }
 #define POW2(x) ((__u64) 1 << (x))
        if (sb->s_kbytes_written) {
@@ -360,7 +364,7 @@ void list_super2(struct ext2_super_block * sb, FILE *f)
        print_group(sb->s_def_resgid, f);
        if (sb->s_rev_level >= EXT2_DYNAMIC_REV) {
                fprintf(f, "First inode:              %d\n", sb->s_first_ino);
-               fprintf(f, "Inode size:           %d\n", sb->s_inode_size);
+               fprintf(f, "Inode size:               %d\n", sb->s_inode_size);
                if (sb->s_min_extra_isize)
                        fprintf(f, "Required extra isize:     %d\n",
                                sb->s_min_extra_isize);
@@ -375,7 +379,7 @@ void list_super2(struct ext2_super_block * sb, FILE *f)
                fprintf(f, "Journal inode:            %u\n",
                        sb->s_journal_inum);
        if (sb->s_journal_dev)
-               fprintf(f, "Journal device:               0x%04x\n",
+               fprintf(f, "Journal device:           0x%04x\n",
                        sb->s_journal_dev);
        if (sb->s_last_orphan)
                fprintf(f, "First orphan inode:       %u\n",
@@ -419,8 +423,8 @@ void list_super2(struct ext2_super_block * sb, FILE *f)
        if (sb->s_error_count)
                fprintf(f, "FS Error count:           %u\n",
                        sb->s_error_count);
-       if (sb->s_first_error_time) {
-               tm = sb->s_first_error_time;
+       tm = ext2fs_get_tstamp(sb, s_first_error_time);
+       if (tm) {
                fprintf(f, "First error time:         %s", ctime(&tm));
                fprintf(f, "First error function:     %.*s\n",
                        EXT2_LEN_STR(sb->s_first_error_func));
@@ -436,8 +440,8 @@ void list_super2(struct ext2_super_block * sb, FILE *f)
                        fprintf(f, "First error err:          %s\n",
                                e2p_errcode2str(sb->s_first_error_errcode));
        }
-       if (sb->s_last_error_time) {
-               tm = sb->s_last_error_time;
+       tm = ext2fs_get_tstamp(sb, s_last_error_time);
+       if (tm) {
                fprintf(f, "Last error time:          %s", ctime(&tm));
                fprintf(f, "Last error function:      %.*s\n",
                        EXT2_LEN_STR(sb->s_last_error_func));
@@ -482,6 +486,9 @@ void list_super2(struct ext2_super_block * sb, FILE *f)
        if (ext2fs_has_feature_casefold(sb))
                fprintf(f, "Character encoding:       %s\n",
                        e2p_encoding2str(sb->s_encoding));
+       if (ext2fs_has_feature_orphan_file(sb))
+               fprintf(f, "Orphan file inode:        %u\n",
+                       sb->s_orphan_file_inum);
 }
 
 void list_super (struct ext2_super_block * s)