Annotation of kernel/bsd/ufs/lfs/lfs_debug.c, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
                      3:  *
                      4:  * @APPLE_LICENSE_HEADER_START@
                      5:  * 
                      6:  * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
                      7:  * Reserved.  This file contains Original Code and/or Modifications of
                      8:  * Original Code as defined in and that are subject to the Apple Public
                      9:  * Source License Version 1.1 (the "License").  You may not use this file
                     10:  * except in compliance with the License.  Please obtain a copy of the
                     11:  * License at http://www.apple.com/publicsource and read it before using
                     12:  * this file.
                     13:  * 
                     14:  * The Original Code and all software distributed under the License are
                     15:  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
                     16:  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
                     17:  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
                     18:  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
                     19:  * License for the specific language governing rights and limitations
                     20:  * under the License.
                     21:  * 
                     22:  * @APPLE_LICENSE_HEADER_END@
                     23:  */
                     24: 
                     25: /*     $NetBSD: lfs_debug.c,v 1.2 1994/06/29 06:46:54 cgd Exp $        */
                     26: 
                     27: /*
                     28:  * Copyright (c) 1991, 1993
                     29:  *     The Regents of the University of California.  All rights reserved.
                     30:  *
                     31:  * Redistribution and use in source and binary forms, with or without
                     32:  * modification, are permitted provided that the following conditions
                     33:  * are met:
                     34:  * 1. Redistributions of source code must retain the above copyright
                     35:  *    notice, this list of conditions and the following disclaimer.
                     36:  * 2. Redistributions in binary form must reproduce the above copyright
                     37:  *    notice, this list of conditions and the following disclaimer in the
                     38:  *    documentation and/or other materials provided with the distribution.
                     39:  * 3. All advertising materials mentioning features or use of this software
                     40:  *    must display the following acknowledgement:
                     41:  *     This product includes software developed by the University of
                     42:  *     California, Berkeley and its contributors.
                     43:  * 4. Neither the name of the University nor the names of its contributors
                     44:  *    may be used to endorse or promote products derived from this software
                     45:  *    without specific prior written permission.
                     46:  *
                     47:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     48:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     49:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     50:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     51:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     52:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     53:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     54:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     55:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     56:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     57:  * SUCH DAMAGE.
                     58:  *
                     59:  *     @(#)lfs_debug.c 8.1 (Berkeley) 6/11/93
                     60:  */
                     61: 
                     62: #ifdef DEBUG
                     63: #include <sys/param.h>
                     64: #include <sys/namei.h>
                     65: #include <sys/vnode.h>
                     66: #include <sys/mount.h>
                     67: 
                     68: #include <ufs/ufs/quota.h>
                     69: #include <ufs/ufs/inode.h>
                     70: #include <ufs/lfs/lfs.h>
                     71: #include <ufs/lfs/lfs_extern.h>
                     72: 
                     73: void 
                     74: lfs_dump_super(lfsp)
                     75:        struct lfs *lfsp;
                     76: {
                     77:        int i;
                     78: 
                     79:        (void)printf("%s%lx\t%s%lx\t%s%d\t%s%d\n",
                     80:                "magic    ", lfsp->lfs_magic,
                     81:                "version  ", lfsp->lfs_version,
                     82:                "size     ", lfsp->lfs_size,
                     83:                "ssize    ", lfsp->lfs_ssize);
                     84:        (void)printf("%s%d\t%s%d\t%s%d\t%s%d\n",
                     85:                "dsize    ", lfsp->lfs_dsize,
                     86:                "bsize    ", lfsp->lfs_bsize,
                     87:                "fsize    ", lfsp->lfs_fsize,
                     88:                "frag     ", lfsp->lfs_frag);
                     89: 
                     90:        (void)printf("%s%d\t%s%d\t%s%d\t%s%d\n",
                     91:                "minfree  ", lfsp->lfs_minfree,
                     92:                "inopb    ", lfsp->lfs_inopb,
                     93:                "ifpb     ", lfsp->lfs_ifpb,
                     94:                "nindir   ", lfsp->lfs_nindir);
                     95: 
                     96:        (void)printf("%s%d\t%s%d\t%s%d\t%s%d\n",
                     97:                "nseg     ", lfsp->lfs_nseg,
                     98:                "nspf     ", lfsp->lfs_nspf,
                     99:                "cleansz  ", lfsp->lfs_cleansz,
                    100:                "segtabsz ", lfsp->lfs_segtabsz);
                    101: 
                    102:        (void)printf("%s%lx\t%s%d\t%s%lx\t%s%d\n",
                    103:                "segmask  ", lfsp->lfs_segmask,
                    104:                "segshift ", lfsp->lfs_segshift,
                    105:                "bmask    ", lfsp->lfs_bmask,
                    106:                "bshift   ", lfsp->lfs_bshift);
                    107: 
                    108:        (void)printf("%s%lx\t%s%d\t%s%lx\t%s%d\n",
                    109:                "ffmask   ", lfsp->lfs_ffmask,
                    110:                "ffshift  ", lfsp->lfs_ffshift,
                    111:                "fbmask   ", lfsp->lfs_fbmask,
                    112:                "fbshift  ", lfsp->lfs_fbshift);
                    113: 
                    114:        (void)printf("%s%d\t%s%d\t%s%lx\t%s%qx\n", 
                    115:                "sushift  ", lfsp->lfs_sushift,
                    116:                "fsbtodb  ", lfsp->lfs_fsbtodb,
                    117:                "cksum    ", lfsp->lfs_cksum,
                    118:                "maxfilesize ", lfsp->lfs_maxfilesize);
                    119: 
                    120:        (void)printf("Superblock disk addresses:");
                    121:        for (i = 0; i < LFS_MAXNUMSB; i++)
                    122:                (void)printf(" %lx", lfsp->lfs_sboffs[i]);
                    123:        (void)printf("\n");
                    124: 
                    125:        (void)printf("Checkpoint Info\n");
                    126:        (void)printf("%s%d\t%s%lx\t%s%d\n",
                    127:                "free     ", lfsp->lfs_free,
                    128:                "idaddr   ", lfsp->lfs_idaddr,
                    129:                "ifile    ", lfsp->lfs_ifile);
                    130:        (void)printf("%s%lx\t%s%d\t%s%lx\t%s%lx\t%s%lx\t%s%lx\n",
                    131:                "bfree    ", lfsp->lfs_bfree,
                    132:                "nfiles   ", lfsp->lfs_nfiles,
                    133:                "lastseg  ", lfsp->lfs_lastseg,
                    134:                "nextseg  ", lfsp->lfs_nextseg,
                    135:                "curseg   ", lfsp->lfs_curseg,
                    136:                "offset   ", lfsp->lfs_offset);
                    137:        (void)printf("tstamp   %lx\n", lfsp->lfs_tstamp);
                    138: }
                    139: 
                    140: void
                    141: lfs_dump_dinode(dip)
                    142:        struct dinode *dip;
                    143: {
                    144:        int i;
                    145: 
                    146:        (void)printf("%s%u\t%s%d\t%s%u\t%s%u\t%s%lu\n",
                    147:                "mode  ", dip->di_mode,
                    148:                "nlink ", dip->di_nlink,
                    149:                "uid   ", dip->di_uid,
                    150:                "gid   ", dip->di_gid,
                    151:                "size  ", dip->di_size);
                    152:        (void)printf("inum  %ld\n", dip->di_inumber);
                    153:        (void)printf("Direct Addresses\n");
                    154:        for (i = 0; i < NDADDR; i++) {
                    155:                (void)printf("\t%lx", dip->di_db[i]);
                    156:                if ((i % 6) == 5)
                    157:                        (void)printf("\n");
                    158:        }
                    159:        for (i = 0; i < NIADDR; i++)
                    160:                (void)printf("\t%lx", dip->di_ib[i]);
                    161:        (void)printf("\n");
                    162: }
                    163: #endif /* DEBUG */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.