Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 1 | /* |
| 2 | * ls.c - List the contents of an ext2fs superblock |
| 3 | * |
| 4 | * Copyright (C) 1992, 1993, 1994 Remy Card <card@masi.ibp.fr> |
| 5 | * Laboratoire MASI, Institut Blaise Pascal |
| 6 | * Universite Pierre et Marie Curie (Paris VI) |
| 7 | * |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 8 | * Copyright (C) 1995, 1996, 1997 Theodore Ts'o <tytso@mit.edu> |
| 9 | * |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 10 | * This file can be redistributed under the terms of the GNU Library General |
| 11 | * Public License |
| 12 | */ |
| 13 | |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 14 | #include <stdio.h> |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 15 | #include <sys/types.h> |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 16 | #include <string.h> |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 17 | #include <grp.h> |
| 18 | #include <pwd.h> |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 19 | #include <time.h> |
| 20 | |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 21 | #include "e2p.h" |
| 22 | |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 23 | /* |
| 24 | * The ext2fs library private definition of the ext2 superblock, so we |
| 25 | * don't have to depend on the kernel's definition of the superblock, |
| 26 | * which might not have the latest features. |
| 27 | */ |
| 28 | struct ext2fs_sb { |
| 29 | __u32 s_inodes_count; /* Inodes count */ |
| 30 | __u32 s_blocks_count; /* Blocks count */ |
| 31 | __u32 s_r_blocks_count; /* Reserved blocks count */ |
| 32 | __u32 s_free_blocks_count; /* Free blocks count */ |
| 33 | __u32 s_free_inodes_count; /* Free inodes count */ |
| 34 | __u32 s_first_data_block; /* First Data Block */ |
| 35 | __u32 s_log_block_size; /* Block size */ |
| 36 | __s32 s_log_frag_size; /* Fragment size */ |
| 37 | __u32 s_blocks_per_group; /* # Blocks per group */ |
| 38 | __u32 s_frags_per_group; /* # Fragments per group */ |
| 39 | __u32 s_inodes_per_group; /* # Inodes per group */ |
| 40 | __u32 s_mtime; /* Mount time */ |
| 41 | __u32 s_wtime; /* Write time */ |
| 42 | __u16 s_mnt_count; /* Mount count */ |
| 43 | __s16 s_max_mnt_count; /* Maximal mount count */ |
| 44 | __u16 s_magic; /* Magic signature */ |
| 45 | __u16 s_state; /* File system state */ |
| 46 | __u16 s_errors; /* Behaviour when detecting errors */ |
| 47 | __u16 s_minor_rev_level; /* minor revision level */ |
| 48 | __u32 s_lastcheck; /* time of last check */ |
| 49 | __u32 s_checkinterval; /* max. time between checks */ |
| 50 | __u32 s_creator_os; /* OS */ |
| 51 | __u32 s_rev_level; /* Revision level */ |
| 52 | __u16 s_def_resuid; /* Default uid for reserved blocks */ |
| 53 | __u16 s_def_resgid; /* Default gid for reserved blocks */ |
| 54 | /* |
| 55 | * These fields are for EXT2_DYNAMIC_REV superblocks only. |
| 56 | * |
| 57 | * Note: the difference between the compatible feature set and |
| 58 | * the incompatible feature set is that if there is a bit set |
| 59 | * in the incompatible feature set that the kernel doesn't |
| 60 | * know about, it should refuse to mount the filesystem. |
| 61 | * |
| 62 | * e2fsck's requirements are more strict; if it doesn't know |
| 63 | * about a feature in either the compatible or incompatible |
| 64 | * feature set, it must abort and not try to meddle with |
| 65 | * things it doesn't understand... |
| 66 | */ |
| 67 | __u32 s_first_ino; /* First non-reserved inode */ |
| 68 | __u16 s_inode_size; /* size of inode structure */ |
| 69 | __u16 s_block_group_nr; /* block group # of this superblock */ |
| 70 | __u32 s_feature_compat; /* compatible feature set */ |
| 71 | __u32 s_feature_incompat; /* incompatible feature set */ |
| 72 | __u32 s_feature_ro_compat; /* readonly-compatible feature set */ |
| 73 | __u8 s_uuid[16]; /* 128-bit uuid for volume */ |
| 74 | char s_volume_name[16]; /* volume name */ |
| 75 | char s_last_mounted[64]; /* directory where last mounted */ |
Theodore Ts'o | 19c6891 | 2000-07-07 03:25:13 +0000 | [diff] [blame] | 76 | __u32 s_algorithm_usage_bitmap; /* For compression */ |
| 77 | /* |
| 78 | * Performance hints. Directory preallocation should only |
| 79 | * happen if the EXT2_FEATURE_COMPAT_DIR_PREALLOC flag is on. |
| 80 | */ |
| 81 | __u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/ |
| 82 | __u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */ |
| 83 | __u16 s_padding1; |
| 84 | /* |
| 85 | * Journaling support. |
| 86 | */ |
| 87 | __u8 s_journal_uuid[16]; /* uuid of journal superblock */ |
| 88 | __u32 s_journal_inum; /* inode number of journal file */ |
| 89 | __u32 s_journal_dev; /* device number of journal file */ |
| 90 | __u32 s_last_orphan; /* start of list of inodes to delete */ |
| 91 | |
| 92 | __u32 s_reserved[197]; /* Padding to the end of the block */ |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 93 | }; |
| 94 | |
Theodore Ts'o | 521e368 | 1997-04-29 17:48:10 +0000 | [diff] [blame] | 95 | #ifndef EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER |
| 96 | #define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 |
| 97 | #endif |
| 98 | |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 99 | static void print_user (unsigned short uid, FILE *f) |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 100 | { |
| 101 | struct passwd *pw; |
| 102 | |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 103 | fprintf(f, "%u ", uid); |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 104 | pw = getpwuid (uid); |
| 105 | if (pw == NULL) |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 106 | fprintf(f, "(user unknown)\n"); |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 107 | else |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 108 | fprintf(f, "(user %s)\n", pw->pw_name); |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 109 | } |
| 110 | |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 111 | static void print_group (unsigned short gid, FILE *f) |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 112 | { |
| 113 | struct group *gr; |
| 114 | |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 115 | fprintf(f, "%u ", gid); |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 116 | gr = getgrgid (gid); |
| 117 | if (gr == NULL) |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 118 | fprintf(f, "(group unknown)\n"); |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 119 | else |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 120 | fprintf(f, "(group %s)\n", gr->gr_name); |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 121 | } |
| 122 | |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 123 | #define MONTH_INT (86400 * 30) |
| 124 | #define WEEK_INT (86400 * 7) |
| 125 | #define DAY_INT (86400) |
| 126 | #define HOUR_INT (60 * 60) |
| 127 | #define MINUTE_INT (60) |
| 128 | |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 129 | static const char *interval_string(unsigned int secs) |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 130 | { |
| 131 | static char buf[256], tmp[80]; |
| 132 | int hr, min, num; |
| 133 | |
| 134 | buf[0] = 0; |
| 135 | |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 136 | if (secs == 0) |
| 137 | return "<none>"; |
| 138 | |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 139 | if (secs >= MONTH_INT) { |
| 140 | num = secs / MONTH_INT; |
| 141 | secs -= num*MONTH_INT; |
| 142 | sprintf(buf, "%d month%s", num, (num>1) ? "s" : ""); |
| 143 | } |
| 144 | if (secs >= WEEK_INT) { |
| 145 | num = secs / WEEK_INT; |
| 146 | secs -= num*WEEK_INT; |
| 147 | sprintf(tmp, "%s%d week%s", buf[0] ? ", " : "", |
| 148 | num, (num>1) ? "s" : ""); |
| 149 | strcat(buf, tmp); |
| 150 | } |
| 151 | if (secs >= DAY_INT) { |
| 152 | num = secs / DAY_INT; |
| 153 | secs -= num*DAY_INT; |
| 154 | sprintf(tmp, "%s%d day%s", buf[0] ? ", " : "", |
| 155 | num, (num>1) ? "s" : ""); |
| 156 | strcat(buf, tmp); |
| 157 | } |
| 158 | if (secs > 0) { |
| 159 | hr = secs / HOUR_INT; |
| 160 | secs -= hr*HOUR_INT; |
| 161 | min = secs / MINUTE_INT; |
| 162 | secs -= min*MINUTE_INT; |
| 163 | sprintf(tmp, "%s%d:%02d:%02d", buf[0] ? ", " : "", |
| 164 | hr, min, secs); |
| 165 | strcat(buf, tmp); |
| 166 | } |
| 167 | return buf; |
| 168 | } |
| 169 | |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 170 | static void print_features(struct ext2_super_block * s, FILE *f) |
Theodore Ts'o | d7b701d | 1999-09-14 20:17:38 +0000 | [diff] [blame] | 171 | { |
| 172 | #ifdef EXT2_DYNAMIC_REV |
| 173 | int i, j, printed=0; |
| 174 | __u32 *mask = &s->s_feature_compat, m; |
| 175 | |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 176 | fprintf(f, "Filesystem features: "); |
Theodore Ts'o | d7b701d | 1999-09-14 20:17:38 +0000 | [diff] [blame] | 177 | for (i=0; i <3; i++,mask++) { |
| 178 | for (j=0,m=1; j < 32; j++, m<<=1) { |
| 179 | if (*mask & m) { |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 180 | fprintf(f, " %s", e2p_feature2string(i, m)); |
Theodore Ts'o | d7b701d | 1999-09-14 20:17:38 +0000 | [diff] [blame] | 181 | printed++; |
| 182 | } |
| 183 | } |
| 184 | } |
| 185 | if (printed == 0) |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 186 | fprintf(f, "(none)"); |
| 187 | fprintf(f, "\n"); |
Theodore Ts'o | d7b701d | 1999-09-14 20:17:38 +0000 | [diff] [blame] | 188 | #endif |
| 189 | } |
| 190 | |
| 191 | |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 192 | |
Theodore Ts'o | 7f88b04 | 1997-04-26 14:48:50 +0000 | [diff] [blame] | 193 | #ifndef EXT2_INODE_SIZE |
| 194 | #define EXT2_INODE_SIZE(s) sizeof(struct ext2_inode) |
| 195 | #endif |
| 196 | |
Theodore Ts'o | a29f4d3 | 1997-04-29 21:26:48 +0000 | [diff] [blame] | 197 | #ifndef EXT2_GOOD_OLD_REV |
| 198 | #define EXT2_GOOD_OLD_REV 0 |
| 199 | #endif |
| 200 | |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 201 | void list_super2(struct ext2_super_block * s, FILE *f) |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 202 | { |
Theodore Ts'o | 7f88b04 | 1997-04-26 14:48:50 +0000 | [diff] [blame] | 203 | int inode_blocks_per_group; |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 204 | struct ext2fs_sb *sb = (struct ext2fs_sb *) s; |
| 205 | char buf[80]; |
| 206 | const char *os; |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 207 | time_t tm; |
Theodore Ts'o | 7f88b04 | 1997-04-26 14:48:50 +0000 | [diff] [blame] | 208 | |
| 209 | inode_blocks_per_group = (((s->s_inodes_per_group * |
| 210 | EXT2_INODE_SIZE(s)) + |
| 211 | EXT2_BLOCK_SIZE(s) - 1) / |
| 212 | EXT2_BLOCK_SIZE(s)); |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 213 | if (sb->s_volume_name[0]) { |
| 214 | memset(buf, 0, sizeof(buf)); |
| 215 | strncpy(buf, sb->s_volume_name, sizeof(sb->s_volume_name)); |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 216 | } else |
| 217 | strcpy(buf, "<none>"); |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 218 | fprintf(f, "Filesystem volume name: %s\n", buf); |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 219 | if (sb->s_last_mounted[0]) { |
| 220 | memset(buf, 0, sizeof(buf)); |
| 221 | strncpy(buf, sb->s_last_mounted, sizeof(sb->s_last_mounted)); |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 222 | } else |
| 223 | strcpy(buf, "<not available>"); |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 224 | fprintf(f, "Last mounted on: %s\n", buf); |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 225 | if (!e2p_is_null_uuid(sb->s_uuid)) { |
| 226 | e2p_uuid_to_str(sb->s_uuid, buf); |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 227 | } else |
| 228 | strcpy(buf, "<none>"); |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 229 | fprintf(f, "Filesystem UUID: %s\n", buf); |
| 230 | fprintf(f, "Filesystem magic number: 0x%04X\n", s->s_magic); |
| 231 | fprintf(f, "Filesystem revision #: %d", s->s_rev_level); |
Theodore Ts'o | 521e368 | 1997-04-29 17:48:10 +0000 | [diff] [blame] | 232 | if (s->s_rev_level == EXT2_GOOD_OLD_REV) { |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 233 | fprintf(f, " (original)\n"); |
Theodore Ts'o | 521e368 | 1997-04-29 17:48:10 +0000 | [diff] [blame] | 234 | #ifdef EXT2_DYNAMIC_REV |
| 235 | } else if (s->s_rev_level == EXT2_DYNAMIC_REV) { |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 236 | fprintf(f, " (dynamic)\n"); |
Theodore Ts'o | 521e368 | 1997-04-29 17:48:10 +0000 | [diff] [blame] | 237 | #endif |
| 238 | } else |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 239 | fprintf(f, "\n"); |
| 240 | print_features(s, f); |
| 241 | fprintf(f, "Filesystem state: "); |
| 242 | print_fs_state (f, s->s_state); |
| 243 | fprintf(f, "\n"); |
| 244 | fprintf(f, "Errors behavior: "); |
| 245 | print_fs_errors(f, s->s_errors); |
| 246 | fprintf(f, "\n"); |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 247 | switch (s->s_creator_os) { |
| 248 | case EXT2_OS_LINUX: os = "Linux"; break; |
Theodore Ts'o | 4ea0a11 | 2000-05-08 13:33:17 +0000 | [diff] [blame] | 249 | case EXT2_OS_HURD: os = "GNU/Hurd"; break; |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 250 | case EXT2_OS_MASIX: os = "Masix"; break; |
| 251 | default: os = "unknown"; break; |
| 252 | } |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 253 | fprintf(f, "Filesystem OS type: %s\n", os); |
| 254 | fprintf(f, "Inode count: %u\n", s->s_inodes_count); |
| 255 | fprintf(f, "Block count: %u\n", s->s_blocks_count); |
| 256 | fprintf(f, "Reserved block count: %u\n", s->s_r_blocks_count); |
| 257 | fprintf(f, "Free blocks: %u\n", s->s_free_blocks_count); |
| 258 | fprintf(f, "Free inodes: %u\n", s->s_free_inodes_count); |
| 259 | fprintf(f, "First block: %u\n", s->s_first_data_block); |
| 260 | fprintf(f, "Block size: %u\n", EXT2_BLOCK_SIZE(s)); |
| 261 | fprintf(f, "Fragment size: %u\n", EXT2_FRAG_SIZE(s)); |
| 262 | fprintf(f, "Blocks per group: %u\n", s->s_blocks_per_group); |
| 263 | fprintf(f, "Fragments per group: %u\n", s->s_frags_per_group); |
| 264 | fprintf(f, "Inodes per group: %u\n", s->s_inodes_per_group); |
| 265 | fprintf(f, "Inode blocks per group: %u\n", inode_blocks_per_group); |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 266 | tm = s->s_mtime; |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 267 | fprintf(f, "Last mount time: %s", ctime(&tm)); |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 268 | tm = s->s_wtime; |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 269 | fprintf(f, "Last write time: %s", ctime(&tm)); |
| 270 | fprintf(f, "Mount count: %u\n", s->s_mnt_count); |
| 271 | fprintf(f, "Maximum mount count: %d\n", s->s_max_mnt_count); |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 272 | tm = s->s_lastcheck; |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 273 | fprintf(f, "Last checked: %s", ctime(&tm)); |
| 274 | fprintf(f, "Check interval: %u (%s)\n", s->s_checkinterval, |
Theodore Ts'o | 21c84b7 | 1997-04-29 16:15:03 +0000 | [diff] [blame] | 275 | interval_string(s->s_checkinterval)); |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 276 | if (s->s_checkinterval) |
| 277 | { |
| 278 | time_t next; |
| 279 | |
| 280 | next = s->s_lastcheck + s->s_checkinterval; |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 281 | fprintf(f, "Next check after: %s", ctime(&next)); |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 282 | } |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 283 | fprintf(f, "Reserved blocks uid: "); |
| 284 | print_user(s->s_def_resuid, f); |
| 285 | fprintf(f, "Reserved blocks gid: "); |
| 286 | print_group(s->s_def_resgid, f); |
Theodore Ts'o | 7f88b04 | 1997-04-26 14:48:50 +0000 | [diff] [blame] | 287 | if (s->s_rev_level >= EXT2_DYNAMIC_REV) { |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 288 | fprintf(f, "First inode: %d\n", s->s_first_ino); |
| 289 | fprintf(f, "Inode size: %d\n", s->s_inode_size); |
Theodore Ts'o | 7f88b04 | 1997-04-26 14:48:50 +0000 | [diff] [blame] | 290 | } |
Theodore Ts'o | 19c6891 | 2000-07-07 03:25:13 +0000 | [diff] [blame] | 291 | if (s->s_feature_compat & EXT3_FEATURE_COMPAT_HAS_JOURNAL) { |
| 292 | if (e2p_is_null_uuid(sb->s_journal_uuid)) { |
| 293 | strcpy(buf, "<none>"); |
| 294 | } else |
| 295 | e2p_uuid_to_str(sb->s_uuid, buf); |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 296 | fprintf(f, "Journal UUID: %s\n", buf); |
| 297 | fprintf(f, "Journal inode: %u\n", s->s_journal_inum); |
| 298 | fprintf(f, "Journal device: 0x%04x\n", s->s_journal_dev); |
| 299 | fprintf(f, "First orphan inode: %u\n", s->s_last_orphan); |
Theodore Ts'o | 19c6891 | 2000-07-07 03:25:13 +0000 | [diff] [blame] | 300 | } |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 301 | } |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 302 | |
Theodore Ts'o | 53d3955 | 2000-08-14 20:13:32 +0000 | [diff] [blame] | 303 | void list_super (struct ext2_super_block * s) |
| 304 | { |
| 305 | list_super2(s, stdout); |
| 306 | } |
Theodore Ts'o | 1e3472c | 1997-04-29 14:53:37 +0000 | [diff] [blame] | 307 | |