The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/servers/is/dmp_fs.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* This file contains procedures to dump to FS' data structures.
    2  *
    3  * The entry points into this file are
    4  *   dtab_dump:         display device <-> driver mappings        
    5  *   fproc_dump:        display FS process table          
    6  *
    7  * Created:
    8  *   Oct 01, 2004:      by Jorrit N. Herder
    9  */
   10 
   11 #include "inc.h"
   12 #include "../fs/const.h"
   13 #include "../fs/fproc.h"
   14 #include <minix/dmap.h>
   15 
   16 PUBLIC struct fproc fproc[NR_PROCS];
   17 PUBLIC struct dmap dmap[NR_DEVICES];
   18 
   19 /*===========================================================================*
   20  *                              fproc_dmp                                    *
   21  *===========================================================================*/
   22 PUBLIC void fproc_dmp()
   23 {
   24   struct fproc *fp;
   25   int i, n=0;
   26   static int prev_i;
   27 
   28   getsysinfo(FS_PROC_NR, SI_PROC_TAB, fproc);
   29 
   30   printf("File System (FS) process table dump\n");
   31   printf("-nr- -pid- -tty- -umask- --uid-- --gid-- -ldr- -sus-rev-proc- -cloexec-\n");
   32   for (i=prev_i; i<NR_PROCS; i++) {
   33         fp = &fproc[i];
   34         if (fp->fp_pid <= 0) continue;
   35         if (++n > 22) break;
   36         printf("%3d  %4d  %2d/%d  0x%05x %2d (%d)  %2d (%d)  %3d   %3d %3d %4d    0x%05x\n",
   37                 i, fp->fp_pid, 
   38                 ((fp->fp_tty>>MAJOR)&BYTE), ((fp->fp_tty>>MINOR)&BYTE), 
   39                 fp->fp_umask,
   40                 fp->fp_realuid, fp->fp_effuid, fp->fp_realgid, fp->fp_effgid,
   41                 fp->fp_sesldr,
   42                 fp->fp_suspended, fp->fp_revived, fp->fp_task,
   43                 fp->fp_cloexec
   44         );
   45   }
   46   if (i >= NR_PROCS) i = 0;
   47   else printf("--more--\r");
   48   prev_i = i;
   49 }
   50 
   51 /*===========================================================================*
   52  *                              dmap_flags                                   *
   53  *===========================================================================*/
   54 PRIVATE char * dmap_flags(int flags)
   55 {
   56         static char fl[10];
   57         strcpy(fl, "---");
   58         if(flags & DMAP_MUTABLE) fl[0] = 'M';
   59         if(flags & DMAP_BUSY)    fl[1] = 'S';
   60         if(flags & DMAP_BABY)    fl[2] = 'B';
   61         return fl;
   62 }
   63 
   64 /*===========================================================================*
   65  *                              dtab_dmp                                     *
   66  *===========================================================================*/
   67 PUBLIC void dtab_dmp()
   68 {
   69     int i;
   70 
   71     getsysinfo(FS_PROC_NR, SI_DMAP_TAB, dmap);
   72     
   73     printf("File System (FS) device <-> driver mappings\n");
   74     printf("Major  Proc  Flags\n");
   75     printf("-----  ----  -----\n");
   76     for (i=0; i<NR_DEVICES; i++) {
   77         if (dmap[i].dmap_driver == NONE) continue;
   78         printf("%5d  %4d  %s\n",
   79                 i, dmap[i].dmap_driver, dmap_flags(dmap[i].dmap_flags));
   80     }
   81 }
   82 

Cache object: ce8c471ed5616a957b2ac3a3dc43d429


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.