~csurbhi/ubuntu/maverick/e2fsprogs/e2fsprogs.fix-505719

« back to all changes in this revision

Viewing changes to lib/e2p/ls.c

  • Committer: Bazaar Package Importer
  • Author(s): Matt Zimmerman
  • Date: 2004-09-19 09:43:14 UTC
  • mto: (8.1.1 lenny) (1.2.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20040919094314-2tafd19i76fhu6ei
Tags: upstream-1.35
ImportĀ upstreamĀ versionĀ 1.35

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
#endif
113
113
}
114
114
 
 
115
static void print_mntopts(struct ext2_super_block * s, FILE *f)
 
116
{
 
117
#ifdef EXT2_DYNAMIC_REV
 
118
        int     i, printed=0;
 
119
        __u32   mask = s->s_default_mount_opts, m;
 
120
 
 
121
        fprintf(f, "Default mount options:   ");
 
122
        if (mask & EXT3_DEFM_JMODE) {
 
123
                fprintf(f, " %s", e2p_mntopt2string(mask & EXT3_DEFM_JMODE));
 
124
                printed++;
 
125
        }
 
126
        for (i=0,m=1; i < 32; i++, m<<=1) {
 
127
                if (m & EXT3_DEFM_JMODE)
 
128
                        continue;
 
129
                if (mask & m) {
 
130
                        fprintf(f, " %s", e2p_mntopt2string(m));
 
131
                        printed++;
 
132
                }
 
133
        }
 
134
        if (printed == 0)
 
135
                fprintf(f, " (none)");
 
136
        fprintf(f, "\n");
 
137
#endif
 
138
}
115
139
 
116
140
 
117
141
#ifndef EXT2_INODE_SIZE
145
169
        } else
146
170
                strcpy(buf, "<not available>");
147
171
        fprintf(f, "Last mounted on:          %s\n", buf);
148
 
        if (!e2p_is_null_uuid(sb->s_uuid)) {
149
 
                e2p_uuid_to_str(sb->s_uuid, buf);
150
 
        } else
151
 
                strcpy(buf, "<none>");
152
 
        fprintf(f, "Filesystem UUID:          %s\n", buf);
 
172
        fprintf(f, "Filesystem UUID:          %s\n", e2p_uuid2str(sb->s_uuid));
153
173
        fprintf(f, "Filesystem magic number:  0x%04X\n", sb->s_magic);
154
174
        fprintf(f, "Filesystem revision #:    %d", sb->s_rev_level);
155
175
        if (sb->s_rev_level == EXT2_GOOD_OLD_REV) {
161
181
        } else
162
182
                fprintf(f, " (unknown)\n");
163
183
        print_features(sb, f);
 
184
        print_mntopts(sb, f);
164
185
        fprintf(f, "Filesystem state:        ");
165
186
        print_fs_state (f, sb->s_state);
166
187
        fprintf(f, "\n");
186
207
        fprintf(f, "Fragments per group:      %u\n", sb->s_frags_per_group);
187
208
        fprintf(f, "Inodes per group:         %u\n", sb->s_inodes_per_group);
188
209
        fprintf(f, "Inode blocks per group:   %u\n", inode_blocks_per_group);
 
210
        if (sb->s_first_meta_bg)
 
211
                fprintf(f, "First meta block group:   %u\n",
 
212
                        sb->s_first_meta_bg);
 
213
        if (sb->s_mkfs_time) {
 
214
                tm = sb->s_mkfs_time;
 
215
                fprintf(f, "Filesystem created:       %s", ctime(&tm));
 
216
        }
189
217
        tm = sb->s_mtime;
190
 
        fprintf(f, "Last mount time:          %s", ctime(&tm));
 
218
        fprintf(f, "Last mount time:          %s",
 
219
                sb->s_mtime ? ctime(&tm) : "n/a\n");
191
220
        tm = sb->s_wtime;
192
221
        fprintf(f, "Last write time:          %s", ctime(&tm));
193
222
        fprintf(f, "Mount count:              %u\n", sb->s_mnt_count);
211
240
                fprintf(f, "First inode:              %d\n", sb->s_first_ino);
212
241
                fprintf(f, "Inode size:           %d\n", sb->s_inode_size);
213
242
        }
214
 
        if (sb->s_feature_compat & EXT3_FEATURE_COMPAT_HAS_JOURNAL) {
215
 
                if (e2p_is_null_uuid(sb->s_journal_uuid)) {
216
 
                        strcpy(buf, "<none>");
217
 
                } else
218
 
                        e2p_uuid_to_str(sb->s_journal_uuid, buf);
219
 
                fprintf(f, "Journal UUID:             %s\n", buf);
220
 
                fprintf(f, "Journal inode:            %u\n", sb->s_journal_inum);
221
 
                fprintf(f, "Journal device:               0x%04x\n", sb->s_journal_dev);
222
 
                fprintf(f, "First orphan inode:       %u\n", sb->s_last_orphan);
 
243
        if (!e2p_is_null_uuid(sb->s_journal_uuid))
 
244
                fprintf(f, "Journal UUID:             %s\n",
 
245
                        e2p_uuid2str(sb->s_journal_uuid));
 
246
        if (sb->s_journal_inum)
 
247
                fprintf(f, "Journal inode:            %u\n",
 
248
                        sb->s_journal_inum);
 
249
        if (sb->s_journal_dev)
 
250
                fprintf(f, "Journal device:               0x%04x\n",
 
251
                        sb->s_journal_dev);
 
252
        if (sb->s_last_orphan)
 
253
                fprintf(f, "First orphan inode:       %u\n",
 
254
                        sb->s_last_orphan);
 
255
        if ((sb->s_feature_compat & EXT2_FEATURE_COMPAT_DIR_INDEX) ||
 
256
            sb->s_def_hash_version)
 
257
                fprintf(f, "Default directory hash:   %s\n",
 
258
                        e2p_hash2string(sb->s_def_hash_version));
 
259
        if (!e2p_is_null_uuid(sb->s_hash_seed))
 
260
                fprintf(f, "Directory Hash Seed:      %s\n",
 
261
                        e2p_uuid2str(sb->s_hash_seed));
 
262
        if (sb->s_jnl_backup_type) {
 
263
                fprintf(f, "Journal backup:           ");
 
264
                switch (sb->s_jnl_backup_type) {
 
265
                case 1:
 
266
                        fprintf(f, "inode blocks\n");
 
267
                        break;
 
268
                default:
 
269
                        fprintf(f, "type %u\n", sb->s_jnl_backup_type);
 
270
                }
223
271
        }
224
272
}
225
273