1 /* This file contains procedures to dump to FS' data structures.
3 * The entry points into this file are
4 * dtab_dump: display device <-> driver mappings
5 * fproc_dump: display FS process table
8 * Oct 01, 2004: by Jorrit N. Herder
12 #include "../mfs/const.h"
13 #include "../vfs/const.h"
14 #include "../vfs/fproc.h"
15 #include "../vfs/dmap.h"
16 #include <minix/dmap.h>
18 PUBLIC
struct fproc fproc
[NR_PROCS
];
19 PUBLIC
struct dmap dmap
[NR_DEVICES
];
21 /*===========================================================================*
23 *===========================================================================*/
24 PUBLIC
void fproc_dmp()
30 getsysinfo(FS_PROC_NR
, SI_PROC_TAB
, fproc
);
32 printf("File System (FS) process table dump\n");
33 printf("-nr- -pid- -tty- -umask- --uid-- --gid-- -ldr- -sus-rev-proc-\n");
34 for (i
=prev_i
; i
<NR_PROCS
; i
++) {
36 if (fp
->fp_pid
<= 0) continue;
38 printf("%3d %4d %2d/%d 0x%05x %2d (%2d) %2d (%2d) %3d %3d %3d ",
40 ((fp
->fp_tty
>>MAJOR
)&BYTE
), ((fp
->fp_tty
>>MINOR
)&BYTE
),
42 fp
->fp_realuid
, fp
->fp_effuid
, fp
->fp_realgid
, fp
->fp_effgid
,
44 fp
->fp_blocked_on
, !!fp
->fp_revived
46 if (fp
->fp_blocked_on
== FP_BLOCKED_ON_OTHER
)
47 printf("%4d\n", fp
->fp_task
);
51 if (i
>= NR_PROCS
) i
= 0;
52 else printf("--more--\r");
56 /*===========================================================================*
58 *===========================================================================*/
59 PRIVATE
char * dmap_flags(int flags
)
63 if(flags
& DRV_FORCED
) fl
[0] = 'F';
67 /*===========================================================================*
69 *===========================================================================*/
70 PRIVATE
char * dmap_style(int dev_style
)
74 case STYLE_DEV
: strcpy(str
, "STYLE_DEV"); break;
75 case STYLE_DEVA
: strcpy(str
, "STYLE_DEVA"); break;
76 case STYLE_TTY
: strcpy(str
, "STYLE_TTY"); break;
77 case STYLE_CTTY
: strcpy(str
, "STYLE_CTTY"); break;
78 case STYLE_CLONE
: strcpy(str
, "STYLE_CLONE"); break;
79 default: strcpy(str
, "UNKNOWN"); break;
85 /*===========================================================================*
87 *===========================================================================*/
88 PUBLIC
void dtab_dmp()
92 getsysinfo(FS_PROC_NR
, SI_DMAP_TAB
, dmap
);
94 printf("File System (FS) device <-> driver mappings\n");
95 printf(" Label Major Driver ept Flags Style \n");
96 printf("------------- ----- ---------- ----- -------------\n");
97 for (i
=0; i
<NR_DEVICES
; i
++) {
98 if (dmap
[i
].dmap_driver
== NONE
) continue;
99 printf("%13s %5d %10d %s %-13s\n",
100 dmap
[i
].dmap_label
, i
, dmap
[i
].dmap_driver
,
101 dmap_flags(dmap
[i
].dmap_flags
), dmap_style(dmap
[i
].dmap_style
));