Fsanalyze v4.1 Patch #2

Michael J. Young mjy at sdti.SDTI.COM
Sat Jan 21 02:18:54 AEST 1989


This is an official patch to fsanalyze v4.1.  There is nothing major in
here, but it is necessary to bring everything up to date for the next
patch, which will have some new features.

Description:
   1.   I have been informed that XENIX/386 still looks more like
        XENIX/286 than standard System V, at least for our purposes.
        So XENIX/286 and XENIX/386 have been merged into OS_XENIX.

   2.   Some debugging statements in chkfile.c had some bugs!

   3.   A faulty test in error() caused some floating-point errors
        when invoked on a non-existent filesystem.

   4.   The old format of the IS_SPECIAL macro causes some braindamaged
        compilers to barf on degenerate conditionals.

   5.   I finally understand the s_state field of the superblock,
        thanks to Mark Nudelman (UNIX386!mark).  Is_ok() was corrected,
        and a new macro, is_mounted(), was added, to enhance filesystem
        integrity checks where possible.

   6.   Some conditionals for NFS file systems were inadvertently
        omitted.  Thanks to Rob McMahon (cudcv at warwick.ac.uk) for catching
        this.

Fix:
        Apply the following patch, then reinstall.
--------------------------------------------------
Index: Mkfile.sun
Prereq: 4.1
*** ../prev/Mkfile.sun	Tue Jan 10 10:52:01 1989
--- Mkfile.sun	Tue Jan 10 10:51:14 1989
***************
*** 1,4
! ## @(#)$Id: Mkfile.sun, V4.1 88/11/16 17:27:58 $
  ##
  ## FSANALYZE makefile
  ## Version  : 4.1 - 88/11/16 17:27:58

--- 1,4 -----
! ## @(#)$Id: Mkfile.sun, V4.1.1.1 89/01/10 10:48:45 $
  ##
  ## FSANALYZE makefile
  ## Version  : 4.1.1.1 - 89/01/10 10:48:45
***************
*** 1,7
  ## @(#)$Id: Mkfile.sun, V4.1 88/11/16 17:27:58 $
  ##
  ## FSANALYZE makefile
! ## Version  : 4.1 - 88/11/16 17:27:58
  
  ## One of the things FSANALYZE displays is a list of the most fragmented
  ## files.  OFFEND determines how many of those files to report.

--- 1,7 -----
  ## @(#)$Id: Mkfile.sun, V4.1.1.1 89/01/10 10:48:45 $
  ##
  ## FSANALYZE makefile
! ## Version  : 4.1.1.1 - 89/01/10 10:48:45
  
  ## One of the things FSANALYZE displays is a list of the most fragmented
  ## files.  OFFEND determines how many of those files to report.
***************
*** 26,32
  #OS = OS_ATT
  OS = OS_BSD
  #OS  = OS_UPORT_286 # Microport System V/AT (286-based - use _ATT for /386)
! #OS = OS_XENIX_286 # XENIX/286 (use _ATT for XENIX/386)
  
  ## Uncomment the next line if you have the fsstat(1) command.  Note that if
  ## you are installing fsanalyze on a Microport System V/AT, this command

--- 26,32 -----
  #OS = OS_ATT
  OS = OS_BSD
  #OS  = OS_UPORT_286 # Microport System V/AT (286-based - use _ATT for /386)
! #OS = OS_XENIX # XENIX/286 and XENIX/386
  
  ## Uncomment the next line if you have the fsstat(1) command.  
  #FSSTAT = -DHAVE_FSSTAT
***************
*** 28,37
  #OS  = OS_UPORT_286 # Microport System V/AT (286-based - use _ATT for /386)
  #OS = OS_XENIX_286 # XENIX/286 (use _ATT for XENIX/386)
  
! ## Uncomment the next line if you have the fsstat(1) command.  Note that if
! ## you are installing fsanalyze on a Microport System V/AT, this command
! ## should be uncommented, since the is_ok macro as defined in fsconfig.h
! ## will not work.
  #FSSTAT = -DHAVE_FSSTAT
  
  ## Where the executable should be placed...

--- 28,34 -----
  #OS  = OS_UPORT_286 # Microport System V/AT (286-based - use _ATT for /386)
  #OS = OS_XENIX # XENIX/286 and XENIX/386
  
! ## Uncomment the next line if you have the fsstat(1) command.  
  #FSSTAT = -DHAVE_FSSTAT
  
  ## Where the executable should be placed...

Index: Mkfile.sys5
Prereq: 4.1
*** ../prev/Mkfile.sys5	Tue Jan 10 10:52:02 1989
--- Mkfile.sys5	Tue Jan 10 10:51:15 1989
***************
*** 1,4
! ## @(#)$Id: Mkfile.sys5, V4.1 88/11/16 17:28:35 $
  ##
  ## FSANALYZE makefile
  ## Version  : 4.1 - 88/11/16 17:28:35

--- 1,4 -----
! ## @(#)$Id: Mkfile.sys5, V4.1.1.1 89/01/10 10:48:48 $
  ##
  ## FSANALYZE makefile
  ## Version  : 4.1.1.1 - 89/01/10 10:48:48
***************
*** 1,7
  ## @(#)$Id: Mkfile.sys5, V4.1 88/11/16 17:28:35 $
  ##
  ## FSANALYZE makefile
! ## Version  : 4.1 - 88/11/16 17:28:35
  
  ## One of the things FSANALYZE displays is a list of the most fragmented
  ## files.  OFFEND determines how many of those files to report.

--- 1,7 -----
  ## @(#)$Id: Mkfile.sys5, V4.1.1.1 89/01/10 10:48:48 $
  ##
  ## FSANALYZE makefile
! ## Version  : 4.1.1.1 - 89/01/10 10:48:48
  
  ## One of the things FSANALYZE displays is a list of the most fragmented
  ## files.  OFFEND determines how many of those files to report.
***************
*** 26,32
  OS = OS_ATT
  #OS = OS_BSD
  #OS = OS_UPORT_286 # Microport System V/AT (286-based - use _ATT for /386)
! #OS = OS_XENIX_286 # XENIX/286 (use _ATT for XENIX/386)
  
  ## Uncomment the next line if you have the fsstat(1) command.  Note that if
  ## you are installing fsanalyze on a Microport System V/AT, this command

--- 26,32 -----
  OS = OS_ATT
  #OS = OS_BSD
  #OS = OS_UPORT_286 # Microport System V/AT (286-based - use _ATT for /386)
! #OS = OS_XENIX # XENIX/286 and XENIX/386
  
  ## Uncomment the next line if you have the fsstat(1) command.  
  #FSSTAT = -DHAVE_FSSTAT
***************
*** 28,37
  #OS = OS_UPORT_286 # Microport System V/AT (286-based - use _ATT for /386)
  #OS = OS_XENIX_286 # XENIX/286 (use _ATT for XENIX/386)
  
! ## Uncomment the next line if you have the fsstat(1) command.  Note that if
! ## you are installing fsanalyze on a Microport System V/AT, this command
! ## should be uncommented, since the is_ok macro as defined in fsconfig.h
! ## will not work.
  #FSSTAT = -DHAVE_FSSTAT
  
  ## Where the executable should be placed...

--- 28,34 -----
  #OS = OS_UPORT_286 # Microport System V/AT (286-based - use _ATT for /386)
  #OS = OS_XENIX # XENIX/286 and XENIX/386
  
! ## Uncomment the next line if you have the fsstat(1) command.  
  #FSSTAT = -DHAVE_FSSTAT
  
  ## Where the executable should be placed...

Index: Mkfile.uport
Prereq: 4.1
*** ../prev/Mkfile.uport	Tue Jan 10 10:52:03 1989
--- Mkfile.uport	Tue Jan 10 10:51:15 1989
***************
*** 1,4
! ## @(#)$Id: Mkfile.uport, V4.1 88/11/16 17:28:47 $
  ##
  ## FSANALYZE makefile
  ## Version  : 4.1 - 88/11/16 17:28:47

--- 1,4 -----
! ## @(#)$Id: Mkfile.uport, V4.1.1.1 89/01/10 10:48:51 $
  ##
  ## FSANALYZE makefile
  ## Version  : 4.1.1.1 - 89/01/10 10:48:51
***************
*** 1,7
  ## @(#)$Id: Mkfile.uport, V4.1 88/11/16 17:28:47 $
  ##
  ## FSANALYZE makefile
! ## Version  : 4.1 - 88/11/16 17:28:47
  
  ## One of the things FSANALYZE displays is a list of the most fragmented
  ## files.  OFFEND determines how many of those files to report.

--- 1,7 -----
  ## @(#)$Id: Mkfile.uport, V4.1.1.1 89/01/10 10:48:51 $
  ##
  ## FSANALYZE makefile
! ## Version  : 4.1.1.1 - 89/01/10 10:48:51
  
  ## One of the things FSANALYZE displays is a list of the most fragmented
  ## files.  OFFEND determines how many of those files to report.
***************
*** 26,32
  #OS = OS_ATT
  #OS = OS_BSD
  OS  = OS_UPORT_286 # Microport System V/AT (286-based - use _ATT for /386)
! #OS = OS_XENIX_286 # XENIX/286 (use _ATT for XENIX/386)
  
  ## Uncomment the next line if you have the fsstat(1) command.  Note that if
  ## you are installing fsanalyze on a Microport System V/AT, this command

--- 26,32 -----
  #OS = OS_ATT
  #OS = OS_BSD
  OS  = OS_UPORT_286 # Microport System V/AT (286-based - use _ATT for /386)
! #OS = OS_XENIX # XENIX/286 and XENIX/386
  
  ## Uncomment the next line if you have the fsstat(1) command.
  FSSTAT = -DHAVE_FSSTAT
***************
*** 28,37
  OS  = OS_UPORT_286 # Microport System V/AT (286-based - use _ATT for /386)
  #OS = OS_XENIX_286 # XENIX/286 (use _ATT for XENIX/386)
  
! ## Uncomment the next line if you have the fsstat(1) command.  Note that if
! ## you are installing fsanalyze on a Microport System V/AT, this command
! ## should be uncommented, since the is_ok macro as defined in fsconfig.h
! ## will not work.
  FSSTAT = -DHAVE_FSSTAT
  
  ## Where the executable should be placed...

--- 28,34 -----
  OS  = OS_UPORT_286 # Microport System V/AT (286-based - use _ATT for /386)
  #OS = OS_XENIX # XENIX/286 and XENIX/386
  
! ## Uncomment the next line if you have the fsstat(1) command.
  FSSTAT = -DHAVE_FSSTAT
  
  ## Where the executable should be placed...

Index: Mkfile.xenix
Prereq: 4.1
*** ../prev/Mkfile.xenix	Tue Jan 10 10:52:04 1989
--- Mkfile.xenix	Tue Jan 10 10:51:15 1989
***************
*** 1,4
! ## @(#)$Id: Mkfile.xenix, V4.1 88/11/16 17:29:01 $
  ##
  ## FSANALYZE makefile
  ## Version  : 4.1 - 88/11/16 17:29:01

--- 1,4 -----
! ## @(#)$Id: Mkfile.xenix, V4.1.1.1 89/01/10 10:48:54 $
  ##
  ## FSANALYZE makefile
  ## Version  : 4.1.1.1 - 89/01/10 10:48:54
***************
*** 1,7
  ## @(#)$Id: Mkfile.xenix, V4.1 88/11/16 17:29:01 $
  ##
  ## FSANALYZE makefile
! ## Version  : 4.1 - 88/11/16 17:29:01
  
  ## One of the things FSANALYZE displays is a list of the most fragmented
  ## files.  OFFEND determines how many of those files to report.

--- 1,7 -----
  ## @(#)$Id: Mkfile.xenix, V4.1.1.1 89/01/10 10:48:54 $
  ##
  ## FSANALYZE makefile
! ## Version  : 4.1.1.1 - 89/01/10 10:48:54
  
  ## One of the things FSANALYZE displays is a list of the most fragmented
  ## files.  OFFEND determines how many of those files to report.
***************
*** 26,32
  #OS = OS_ATT
  #OS = OS_BSD
  #OS  = OS_UPORT_286 # Microport System V/AT (286-based - use _ATT for /386)
! OS = OS_XENIX_286 # XENIX/286 (use _ATT for XENIX/386)
  
  ## Uncomment the next line if you have the fsstat(1) command.  Note that if
  ## you are installing fsanalyze on a Microport System V/AT, this command

--- 26,32 -----
  #OS = OS_ATT
  #OS = OS_BSD
  #OS  = OS_UPORT_286 # Microport System V/AT (286-based - use _ATT for /386)
! OS = OS_XENIX # XENIX/286 and XENIX/386
  
  ## Uncomment the next line if you have the fsstat(1) command.  
  #FSSTAT = -DHAVE_FSSTAT
***************
*** 28,37
  #OS  = OS_UPORT_286 # Microport System V/AT (286-based - use _ATT for /386)
  OS = OS_XENIX_286 # XENIX/286 (use _ATT for XENIX/386)
  
! ## Uncomment the next line if you have the fsstat(1) command.  Note that if
! ## you are installing fsanalyze on a Microport System V/AT, this command
! ## should be uncommented, since the is_ok macro as defined in fsconfig.h
! ## will not work.
  #FSSTAT = -DHAVE_FSSTAT
  
  ## Where the executable should be placed...

--- 28,34 -----
  #OS  = OS_UPORT_286 # Microport System V/AT (286-based - use _ATT for /386)
  OS = OS_XENIX # XENIX/286 and XENIX/386
  
! ## Uncomment the next line if you have the fsstat(1) command.  
  #FSSTAT = -DHAVE_FSSTAT
  
  ## Where the executable should be placed...

Index: chkfile.c
Prereq: 4.1
*** ../prev/chkfile.c	Tue Jan 10 10:52:40 1989
--- chkfile.c	Tue Jan 10 10:51:17 1989
***************
*** 1,4
! static char sccsid[] = "@(#)$Id: chkfile.c, V4.1 88/11/16 17:29:30 $";
  
  /*
   * chkfile.c - analyze file

--- 1,4 -----
! static char sccsid[] = "@(#)$Id: chkfile.c, V4.1.1.1 89/01/10 10:48:57 $";
  
  /*
   * chkfile.c - analyze file
***************
*** 2,8
  
  /*
   * chkfile.c - analyze file
!  * Version  : 4.1 - 88/11/16 17:29:30
   *
   * Author   : Michael J. Young
   * USmail   : Software Development Technologies, Inc.

--- 2,8 -----
  
  /*
   * chkfile.c - analyze file
!  * Version  : 4.1.1.1 - 89/01/10 10:48:57
   *
   * Author   : Michael J. Young
   * USmail   : Software Development Technologies, Inc.
***************
*** 36,41
   *
   * Wed Nov 16 11:31:32 EST 1988 - M. Young (mjy at sdti.SDTI.COM),
   *    Placed under SCCS
   */
  
  #include "fsconfig.h"

--- 36,44 -----
   *
   * Wed Nov 16 11:31:32 EST 1988 - M. Young (mjy at sdti.SDTI.COM),
   *    Placed under SCCS
+  *
+  * Thu Jan  5 10:53:25 EST 1989 - Gerry Swislow (gerry at certif.UUCP),
+  *    Fixed bugs in some debugging statements!
   */
  
  #include "fsconfig.h"
***************
*** 281,287
          }
  
      data->data_blocks = data->total_blocks = (blk_size(fil_sys, inode, 1) / fsize (fil_sys));
!     if (debug)printf ("blk_size returns %ld\n", blk_size (fil_sys, inode, 1));
  
      /*
       * scan the data blocks looking for numbers out of sequence

--- 284,290 -----
          }
  
      data->data_blocks = data->total_blocks = (blk_size(fil_sys, inode, 1) / fsize (fil_sys));
!     if (debug)printf ("blk_size returns %ld\n", (long) blk_size (fil_sys, inode, 1));
  
      /*
       * scan the data blocks looking for numbers out of sequence
***************
*** 298,304
              }
          data->data_blocks += (blk_size (fil_sys, inode, i) / fsize (fil_sys));
          data->total_blocks += (blk_size (fil_sys, inode, i) / fsize (fil_sys));
! 	if (debug)printf ("  blk_size returns %ld\n", blk_size(fil_sys,inode,i));
          test_fragmentation (new_pos, pos, data);
          pos = new_pos;
          }

--- 301,307 -----
              }
          data->data_blocks += (blk_size (fil_sys, inode, i) / fsize (fil_sys));
          data->total_blocks += (blk_size (fil_sys, inode, i) / fsize (fil_sys));
! 	if (debug)printf ("  blk_size returns %ld\n", (long) blk_size(fil_sys,inode,i));
          test_fragmentation (new_pos, pos, data);
          pos = new_pos;
          }

Index: fsanalyze.c
Prereq: 4.1.1.1
*** ../prev/fsanalyze.c	Tue Jan 10 10:52:59 1989
--- fsanalyze.c	Tue Jan 10 10:51:18 1989
***************
*** 1,4
! static char sccsid[] = "@(#)$Id: fsanalyze.c, V4.1.1.1 88/12/14 11:01:28 $";
  
  /*
   * fsanalyze.c - file system analyzer

--- 1,4 -----
! static char sccsid[] = "@(#)$Id: fsanalyze.c, V4.1.1.2 89/01/10 10:49:05 $";
  
  /*
   * fsanalyze.c - file system analyzer
***************
*** 2,8
  
  /*
   * fsanalyze.c - file system analyzer
!  * Version  : 4.1.1.1 - 88/12/14 11:01:28
   *
   * Author   : Michael J. Young
   * USmail   : Software Development Technologies, Inc.

--- 2,8 -----
  
  /*
   * fsanalyze.c - file system analyzer
!  * Version  : 4.1.1.2 - 89/01/10 10:49:05
   *
   * Author   : Michael J. Young
   * USmail   : Software Development Technologies, Inc.
***************
*** 75,80
   * Tue Dec 13 13:19:48 EST 1988 - M. Young (mjy at sdti.SDTI.COM),
   *    Changed use of IS_SPECIAL macro to avoid bug in some USG
   *    compilers.
   */
  
  /*

--- 75,84 -----
   * Tue Dec 13 13:19:48 EST 1988 - M. Young (mjy at sdti.SDTI.COM),
   *    Changed use of IS_SPECIAL macro to avoid bug in some USG
   *    compilers.
+  *
+  * Mon Jan  9 13:08:04 EST 1989 - Wietse Z. Venema (wietse at wzv.UUCP),
+  *    Fixed faulty test in error() which caused floating-point error
+  *    when invoked on an non-existent filesystem.
   */
  
  /*
***************
*** 120,126
      /*
       * print out partial report, if possible
       */
!     if (fil_sys != NULL)print_report ();
      exit(1);                      /* exit with error status */
      }
  

--- 124,130 -----
      /*
       * print out partial report, if possible
       */
!     if (isize(fil_sys) != 0)print_report ();
      exit(1);                      /* exit with error status */
      }

Index: fsanalyze.h
Prereq: 4.1.1.2
*** ../prev/fsanalyze.h	Tue Jan 10 10:53:00 1989
--- fsanalyze.h	Tue Jan 10 11:20:28 1989
***************
*** 1,4
! /* @(#)$Id: fsanalyze.h, V4.1.1.2 88/12/15 15:47:33 $ */
  
  /*
   * fsanalyze.h - file system analyzer header file

--- 1,4 -----
! /* @(#)$Id: fsanalyze.h, V4.1.1.3 89/01/10 11:19:58 $ */
  
  /*
   * fsanalyze.h - file system analyzer header file
***************
*** 2,8
  
  /*
   * fsanalyze.h - file system analyzer header file
!  * Version  : 4.1.1.2 - 88/12/15 15:47:33
   *
   * Author   : Michael J. Young
   * USmail   : Software Development Technologies, Inc.

--- 2,8 -----
  
  /*
   * fsanalyze.h - file system analyzer header file
!  * Version  : 4.1.1.3 - 89/01/10 11:19:58
   *
   * Author   : Michael J. Young
   * USmail   : Software Development Technologies, Inc.
***************
*** 47,53
   *    "fs_type_flag" declaration
   *
   * Thu Dec 15 15:23:45 EST 1988 - M. Young (mjy at sdti.SDTI.COM),
!  *    Fixed IS_SPECIAL to handle systems without fifos
   */
  
  #include <sys/stat.h>

--- 47,57 -----
   *    "fs_type_flag" declaration
   *
   * Thu Dec 15 15:23:45 EST 1988 - M. Young (mjy at sdti.SDTI.COM),
!  *    Fixed IS_SPECIAL to handle systems without fifos.
!  *
!  * Tue Jan 10 11:19:30 EST 1989 - M. Young (mjy at sdti.SDTI.COM),
!  *    Changed format of IS_SPECIAL to prevent some braindamaged
!  *    compilers from barfing on degenerate conditionals
   */
  
  #include <sys/stat.h>
***************
*** 83,89
   * S_IFLNK for BSD style symbolic links
   */
  #ifdef  S_IFNAM
! # define IS_NAM(a) (((a) & S_IFMT) == S_IFNAM)
  #else
  # define IS_NAM(a) FALSE
  #endif	/* XENIX IFNAM devices */

--- 87,93 -----
   * S_IFLNK for BSD style symbolic links
   */
  #ifdef  S_IFNAM
! # define IS_NAM(a) || (((a) & S_IFMT) == S_IFNAM)
  #else
  # define IS_NAM(a)
  #endif	/* XENIX IFNAM devices */
***************
*** 85,91
  #ifdef  S_IFNAM
  # define IS_NAM(a) (((a) & S_IFMT) == S_IFNAM)
  #else
! # define IS_NAM(a) FALSE
  #endif	/* XENIX IFNAM devices */
  
  #ifdef  S_IFLNK

--- 89,95 -----
  #ifdef  S_IFNAM
  # define IS_NAM(a) || (((a) & S_IFMT) == S_IFNAM)
  #else
! # define IS_NAM(a)
  #endif	/* XENIX IFNAM devices */
  
  #ifdef  S_IFLNK
***************
*** 89,95
  #endif	/* XENIX IFNAM devices */
  
  #ifdef  S_IFLNK
! # define IS_LNK(a) (((a) & S_IFMT) == S_IFLNK)
  #else
  # define IS_LNK(a) FALSE
  #endif /* BSD symlinks */

--- 93,99 -----
  #endif	/* XENIX IFNAM devices */
  
  #ifdef  S_IFLNK
! # define IS_LNK(a) || (((a) & S_IFMT) == S_IFLNK)
  #else
  # define IS_LNK(a)
  #endif /* BSD symlinks */
***************
*** 91,97
  #ifdef  S_IFLNK
  # define IS_LNK(a) (((a) & S_IFMT) == S_IFLNK)
  #else
! # define IS_LNK(a) FALSE
  #endif /* BSD symlinks */
  
  #ifdef  S_IFSOCK

--- 95,101 -----
  #ifdef  S_IFLNK
  # define IS_LNK(a) || (((a) & S_IFMT) == S_IFLNK)
  #else
! # define IS_LNK(a)
  #endif /* BSD symlinks */
  
  #ifdef  S_IFSOCK
***************
*** 95,101
  #endif /* BSD symlinks */
  
  #ifdef  S_IFSOCK
! # define IS_SOK(a) (((a) & S_IFMT) == S_IFSOCK)
  #else
  # define IS_SOK(a) FALSE
  #endif /* BSD sockets */

--- 99,105 -----
  #endif /* BSD symlinks */
  
  #ifdef  S_IFSOCK
! # define IS_SOK(a) || (((a) & S_IFMT) == S_IFSOCK)
  #else
  # define IS_SOK(a)
  #endif /* BSD sockets */
***************
*** 97,103
  #ifdef  S_IFSOCK
  # define IS_SOK(a) (((a) & S_IFMT) == S_IFSOCK)
  #else
! # define IS_SOK(a) FALSE
  #endif /* BSD sockets */
  
  #ifdef	S_IFIFO

--- 101,107 -----
  #ifdef  S_IFSOCK
  # define IS_SOK(a) || (((a) & S_IFMT) == S_IFSOCK)
  #else
! # define IS_SOK(a)
  #endif /* BSD sockets */
  
  #ifdef	S_IFIFO
***************
*** 101,107
  #endif /* BSD sockets */
  
  #ifdef	S_IFIFO
! # define IS_FIFO(a) (((a) & S_IFMT) == S_IFIFO)
  #else
  # define IS_FIFO(a) FALSE
  #endif

--- 105,111 -----
  #endif /* BSD sockets */
  
  #ifdef	S_IFIFO
! # define IS_FIFO(a) || (((a) & S_IFMT) == S_IFIFO)
  #else
  # define IS_FIFO(a)
  #endif
***************
*** 103,109
  #ifdef	S_IFIFO
  # define IS_FIFO(a) (((a) & S_IFMT) == S_IFIFO)
  #else
! # define IS_FIFO(a) FALSE
  #endif
  
  #define IS_SPECIAL(a) \

--- 107,113 -----
  #ifdef	S_IFIFO
  # define IS_FIFO(a) || (((a) & S_IFMT) == S_IFIFO)
  #else
! # define IS_FIFO(a)
  #endif
  
  #define IS_SPECIAL(a) \
***************
*** 108,115
  
  #define IS_SPECIAL(a) \
          ((((a) & S_IFMT) == S_IFBLK) || \
!         (((a) & S_IFMT) == S_IFCHR) || \
!         IS_FIFO(a) || IS_NAM(a) || IS_LNK(a) || IS_SOK(a))
  
  /*
   * per-file statistics structure

--- 112,119 -----
  
  #define IS_SPECIAL(a) \
          ((((a) & S_IFMT) == S_IFBLK) || \
!         (((a) & S_IFMT) == S_IFCHR) \
!         IS_FIFO(a) IS_NAM(a) IS_LNK(a) IS_SOK(a))
  
  /*
   * per-file statistics structure

Index: fsconfig.h
Prereq: 4.1.1.2
*** ../prev/fsconfig.h	Tue Jan 10 10:53:03 1989
--- fsconfig.h	Tue Jan 10 10:51:20 1989
***************
*** 1,4
! /* @(#)$Id: fsconfig.h, V4.1.1.2 88/12/14 11:00:19 $ */
  
  /*
   * fsconfig.h - fsanalyze configuration-specific definitions

--- 1,4 -----
! /* @(#)$Id: fsconfig.h, V4.1.1.3 89/01/10 10:49:14 $ */
  
  /*
   * fsconfig.h - fsanalyze configuration-specific definitions
***************
*** 2,8
  
  /*
   * fsconfig.h - fsanalyze configuration-specific definitions
!  * Version  : 4.1.1.2 - 88/12/14 11:00:19
   *
   * Author   : Michael J. Young
   * USmail   : Software Development Technologies, Inc.

--- 2,8 -----
  
  /*
   * fsconfig.h - fsanalyze configuration-specific definitions
!  * Version  : 4.1.1.3 - 89/01/10 10:49:14
   *
   * Author   : Michael J. Young
   * USmail   : Software Development Technologies, Inc.
***************
*** 58,63
   *    directly, rather than in fsanalyze.h.  Also, added support for
   *    fs_type_flag, a kludge to permit some macros (like FsBSIZE) to
   *    be used from <sys/param.h> on System V derivatives.
   */
  
  /*

--- 58,71 -----
   *    directly, rather than in fsanalyze.h.  Also, added support for
   *    fs_type_flag, a kludge to permit some macros (like FsBSIZE) to
   *    be used from <sys/param.h> on System V derivatives.
+  *
+  * Thu Jan  5 10:43:32 EST 1989 - M. Young (mjy at sdti.SDTI.COM),
+  *    OS_XENIX now defines all System V variants of XENIX, replacing
+  *    OS_XENIX_286.  Apparently, the XENIX/386 file system is identical
+  *    to XENIX/286 after all (thanks to Chip Rosenthal [chip at vector.UUCP]).
+  *
+  * Tue Jan 10 10:07:41 EST 1989 - M. Young (mjy at sdti.SDTI.COM),
+  *    Modified is_ok() and added is_mounted() macros.
   */
  
  /*
***************
*** 90,96
  #define OS_ATT         1       /* Generic AT&T OS, no special cases */
  #define OS_BSD         2       /* Generic BSD 4.2 or later FFS, no special
                                  * cases */
! #define OS_XENIX_286   4       /* XENIX/286 */
  #define OS_UPORT_286   5       /* Microport System V/AT */
  
  #ifndef FS_TYPE

--- 98,104 -----
  #define OS_ATT         1       /* Generic AT&T OS, no special cases */
  #define OS_BSD         2       /* Generic BSD 4.2 or later FFS, no special
                                  * cases */
! #define OS_XENIX       4       /* XENIX/286 and XENIX/386 */
  #define OS_UPORT_286   5       /* Microport System V/AT */
  
  #ifndef FS_TYPE
***************
*** 168,173
   *                              a given file system
   *    is_ok(fs)                 TRUE if the file system is not in need of
   *                              checking (with fsck(1M))
   *    opt_interleave(fs)        The optimum sector interleave which will result
   *                              in minimum rotational delay.
   *    Sec_per_blk               Number of sectors per logical block

--- 176,182 -----
   *                              a given file system
   *    is_ok(fs)                 TRUE if the file system is not in need of
   *                              checking (with fsck(1M))
+  *    is_mounted(fs)            TRUE if the file system is currently mounted
   *    opt_interleave(fs)        The optimum sector interleave which will result
   *                              in minimum rotational delay.
   *    Sec_per_blk               Number of sectors per logical block
***************
*** 207,214
  typedef struct filsys superblk_t;       /* superblock structure definition */
  
  /* SCO XENIX doesn't have SUPERBOFF, so we must set it explicitly.  Note
!  * that XENIX/286 seems to want the value BSIZE*SUPERB (==1024L), yet
!  * XENIX/386 is "normal" SystemV (512L).
   */
  # if (OS_TYPE == OS_XENIX_286)
  #   define SUPERBOFF	(BSIZE*SUPERB)

--- 216,222 -----
  typedef struct filsys superblk_t;       /* superblock structure definition */
  
  /* SCO XENIX doesn't have SUPERBOFF, so we must set it explicitly.  Note
!  * that XENIX/286 seems to want the value BSIZE*SUPERB (==1024L).
   */
  # if (OS_TYPE == OS_XENIX)
  #   define SUPERBOFF	(BSIZE*SUPERB)
***************
*** 210,216
   * that XENIX/286 seems to want the value BSIZE*SUPERB (==1024L), yet
   * XENIX/386 is "normal" SystemV (512L).
   */
! # if (OS_TYPE == OS_XENIX_286)
  #   define SUPERBOFF	(BSIZE*SUPERB)
  # endif
  

--- 218,224 -----
  /* SCO XENIX doesn't have SUPERBOFF, so we must set it explicitly.  Note
   * that XENIX/286 seems to want the value BSIZE*SUPERB (==1024L).
   */
! # if (OS_TYPE == OS_XENIX)
  #   define SUPERBOFF	(BSIZE*SUPERB)
  # endif
  
***************
*** 282,292
  # define sec_per_cyl(fs) ((fs)->s_dinfo[1])
  
  /*
!  * Note that the standard check for file system integrity does not work
!  * on Microport systems because a clean, unmounted file system is not set
!  * to FsOKAY, but some other undocumented constant.  It is therefore
!  * strongly recommended that the HAVE_FSSTAT macro be defined for Microport
!  * systems.
   */
  # if (OS_TYPE == OS_UPORT_286)
  #  define is_ok(fs) (TRUE)

--- 290,301 -----
  # define sec_per_cyl(fs) ((fs)->s_dinfo[1])
  
  /*
!  * is_ok() attempts to determine directly from the superblock whether or
!  * not the file system is in need of checking.  is_mounted() is attempts
!  * to determine if the filesystem is mounted.  XENIX superblocks do not
!  * have the required fields to determine these facts without using other
!  * system files, so we don't even try.  Note that if HAVE_FSSTAT is defined,
!  * these macros aren't even used.
   */
  # if (OS_TYPE == OS_XENIX)
  #  define is_ok(fs)       (TRUE)
***************
*** 288,298
   * strongly recommended that the HAVE_FSSTAT macro be defined for Microport
   * systems.
   */
! # if (OS_TYPE == OS_UPORT_286)
! #  define is_ok(fs) (TRUE)
! #  ifndef HAVE_FSSTAT
! #   define HAVE_FSSTAT
! #  endif
  # else
  #  if (OS_TYPE == OS_XENIX_286)
  #   define is_ok(fs) (TRUE)

--- 297,305 -----
   * system files, so we don't even try.  Note that if HAVE_FSSTAT is defined,
   * these macros aren't even used.
   */
! # if (OS_TYPE == OS_XENIX)
! #  define is_ok(fs)       (TRUE)
! #  define is_mounted(fs)  (FALSE)
  # else
  #  ifdef FsOKAY
  #   define is_ok(fs)      (((fs)->s_state + (fs)->s_time) == FsOKAY)
***************
*** 294,301
  #   define HAVE_FSSTAT
  #  endif
  # else
! #  if (OS_TYPE == OS_XENIX_286)
! #   define is_ok(fs) (TRUE)
  #  else
  #   ifdef FsOKAY
  #    define is_ok(fs) (((fs)->s_state == FsOKAY) || ((fs)->s_state == FsACTIVE))

--- 301,309 -----
  #  define is_ok(fs)       (TRUE)
  #  define is_mounted(fs)  (FALSE)
  # else
! #  ifdef FsOKAY
! #   define is_ok(fs)      (((fs)->s_state + (fs)->s_time) == FsOKAY)
! #   define is_mounted(fs) ((fs)->s_state == FsACTIVE)
  #  else
  #   define is_ok(fs)      (TRUE)
  #   define is_mounted(fs) (FALSE)
***************
*** 297,307
  #  if (OS_TYPE == OS_XENIX_286)
  #   define is_ok(fs) (TRUE)
  #  else
! #   ifdef FsOKAY
! #    define is_ok(fs) (((fs)->s_state == FsOKAY) || ((fs)->s_state == FsACTIVE))
! #   else
! #    define is_ok(fs) (TRUE)
! #   endif
  #  endif
  # endif
  

--- 305,312 -----
  #   define is_ok(fs)      (((fs)->s_state + (fs)->s_time) == FsOKAY)
  #   define is_mounted(fs) ((fs)->s_state == FsACTIVE)
  #  else
! #   define is_ok(fs)      (TRUE)
! #   define is_mounted(fs) (FALSE)
  #  endif
  # endif
  
***************
*** 359,364
   * How do we determine file system integrity on a BSD file system?
   */
  # define is_ok(fs)        (TRUE)
  
  # define opt_interleave(fs) \
           (((fs)->fs_rps * (fs)->fs_nsect * (fs)->fs_rotdelay /* sectors */\

--- 364,370 -----
   * How do we determine file system integrity on a BSD file system?
   */
  # define is_ok(fs)        (TRUE)
+ # define is_mounted(fs)   (FALSE)
  
  # define opt_interleave(fs) \
           (((fs)->fs_rps * (fs)->fs_nsect * (fs)->fs_rotdelay /* sectors */\

Index: init.c
Prereq: 4.1.1.1
*** ../prev/init.c	Tue Jan 10 10:53:05 1989
--- init.c	Tue Jan 10 10:51:21 1989
***************
*** 1,4
! static char sccsid[] = "@(#)$Id: init.c, V4.1.1.1 88/12/14 11:00:33 $";
  
  /*
   * init.c - initialization and usage code

--- 1,4 -----
! static char sccsid[] = "@(#)$Id: init.c, V4.1.1.2 89/01/10 10:49:22 $";
  
  /*
   * init.c - initialization and usage code
***************
*** 2,8
  
  /*
   * init.c - initialization and usage code
!  * Version  : 4.1.1.1 - 88/12/14 11:00:33
   *
   * Author   : Michael J. Young
   * USmail   : Software Development Technologies, Inc.

--- 2,8 -----
  
  /*
   * init.c - initialization and usage code
!  * Version  : 4.1.1.2 - 89/01/10 10:49:22
   *
   * Author   : Michael J. Young
   * USmail   : Software Development Technologies, Inc.
***************
*** 40,45
   * Wed Dec 14 10:46:13 EST 1988 - M. Young (mjy at sdti.SDTI.COM),
   *    Added code to set "fs_type_flag" variable according to file
   *    system type (System V derivatives)
   */
  
  #include "fsconfig.h"

--- 40,49 -----
   * Wed Dec 14 10:46:13 EST 1988 - M. Young (mjy at sdti.SDTI.COM),
   *    Added code to set "fs_type_flag" variable according to file
   *    system type (System V derivatives)
+  *
+  * Tue Jan 10 10:10:38 EST 1989 - M. Young (mjy at sdti.SDTI.COM),
+  *    Is_ok() and is_mounted() macros now work correctly, thanks to
+  *    enlightenment from Mark Nudelman (UNIX386!mark).
   */
  
  #include "fsconfig.h"
***************
*** 82,88
   */
  void version(){
      printf ("\nFile System Analyzer\n");
!     printf ("Version : 4.1 - 88/12/14 11:00:33, Patch Level #%d\n", patch_level);
      }
  
  /*

--- 86,92 -----
   */
  void version(){
      printf ("\nFile System Analyzer\n");
!     printf ("Version : 4.1 - 89/01/10 10:49:22, Patch Level #%d\n", patch_level);
      }
  
  /*
***************
*** 189,196
       * Check the integrity of the file system manually, if possible.
       */
      if (!is_ok(fil_sys) && !override){
!         fprintf (stderr, "\"%s\" needs checking\n", fs);
!         return (FALSE);
          }
  
  #endif  /* HAVE_FSSTAT */

--- 193,205 -----
       * Check the integrity of the file system manually, if possible.
       */
      if (!is_ok(fil_sys) && !override){
!         if (is_mounted(fil_sys)){
!             fprintf (stderr, "warning: \"%s\" is mounted\n", fs);
! 	    }
!         else {
!             fprintf (stderr, "\"%s\" needs checking\n", fs);
!             return (FALSE);
! 	    }
          }
  
  #endif  /* HAVE_FSSTAT */

Index: patchlevel.h
Prereq: 4.1.1.1
*** ../prev/patchlevel.h	Tue Jan 10 10:53:06 1989
--- patchlevel.h	Tue Jan 10 10:51:21 1989
***************
*** 1,4
! /* @(#)$Id: patchlevel.h, V4.1.1.1 88/12/02 16:36:19 $ */
  
  /*
   * patchlevel.h - current patch level

--- 1,4 -----
! /* @(#)$Id: patchlevel.h, V4.1.1.2 89/01/10 10:49:29 $ */
  
  /*
   * patchlevel.h - current patch level
***************
*** 2,8
  
  /*
   * patchlevel.h - current patch level
!  * Version  : 4.1.1.1 - 88/12/02 16:36:19
   *
   * Author   : Michael J. Young
   * USmail   : Software Development Technologies, Inc.

--- 2,8 -----
  
  /*
   * patchlevel.h - current patch level
!  * Version  : 4.1.1.2 - 89/01/10 10:49:29
   *
   * Author   : Michael J. Young
   * USmail   : Software Development Technologies, Inc.
***************
*** 22,26
   * =========================================================================
   */
  
! #define patch_level 1
  

--- 22,26 -----
   * =========================================================================
   */
  
! #define patch_level 2

Index: report.c
Prereq: 4.1.1.1
*** ../prev/report.c	Tue Jan 10 10:53:08 1989
--- report.c	Tue Jan 10 10:51:22 1989
***************
*** 1,4
! static char sccsid[] = "@(#)$Id: report.c, V4.1.1.1 88/12/15 16:10:35 $";
  
  /*
   * report.c - print analysis report

--- 1,4 -----
! static char sccsid[] = "@(#)$Id: report.c, V4.1.1.2 89/01/10 10:49:31 $";
  
  /*
   * report.c - print analysis report
***************
*** 2,8
  
  /*
   * report.c - print analysis report
!  * Version  : 4.1.1.1 - 88/12/15 16:10:35
   *
   * Author   : Michael J. Young
   * USmail   : Software Development Technologies, Inc.

--- 2,8 -----
  
  /*
   * report.c - print analysis report
!  * Version  : 4.1.1.2 - 89/01/10 10:49:31
   *
   * Author   : Michael J. Young
   * USmail   : Software Development Technologies, Inc.
***************
*** 37,42
   * Thu Dec 15 15:32:39 EST 1988 - M. Young (mjy at sdti.SDTI.COM),
   *    Removed some potential divide-by-zero errors, added support for
   *    BSD filesystems without fs_optim
   */
  
  #include "fsconfig.h"

--- 37,45 -----
   * Thu Dec 15 15:32:39 EST 1988 - M. Young (mjy at sdti.SDTI.COM),
   *    Removed some potential divide-by-zero errors, added support for
   *    BSD filesystems without fs_optim
+  * 
+  * Thu Jan  5 10:31:21 EST 1989 - Rob McMahon (cudcv at warwick.ac.uk),
+  *    Added conditionals for NFS file systems
   */
  
  #include "fsconfig.h"
***************
*** 100,106
          fil_sys->s_fname, fil_sys->s_fpack);
  # endif
  
! # if FS_TYPE == FS_BSD
      /* Where do you get file system/volume name from? */
  # endif
  

--- 103,109 -----
          fil_sys->s_fname, fil_sys->s_fpack);
  # endif
  
! # if (FS_TYPE == FS_BSD) || (FS_TYPE == FS_BSD_NFS)
      /* Where do you get file system/volume name from? */
  # endif
  
***************
*** 106,112
  
      printf ("Logical block size = %d bytes", bsize(fil_sys));
  
! # if FS_TYPE == FS_BSD
      printf (", Fragment size = %d bytes", block_size);
  # endif
  

--- 109,115 -----
  
      printf ("Logical block size = %d bytes", bsize(fil_sys));
  
! # if (FS_TYPE == FS_BSD) || (FS_TYPE == FS_BSD_NFS)
      printf (", Fragment size = %d bytes", block_size);
  # endif
  
***************
*** 113,119
      printf ("\nInterleave = %d sectors; %d sectors/cyl", 
          interleave, cyl_size);
  
! # if FS_TYPE == FS_BSD
  #  ifdef FS_OPTTIME
      printf ("; Allocation Strategy = %s", 
          fil_sys->fs_optim == FS_OPTTIME ? "Time" : "Space");

--- 116,122 -----
      printf ("\nInterleave = %d sectors; %d sectors/cyl", 
          interleave, cyl_size);
  
! # if (FS_TYPE == FS_BSD) || (FS_TYPE == FS_BSD_NFS)
  #  ifdef FS_OPTTIME
      printf ("; Allocation Strategy = %s", 
          fil_sys->fs_optim == FS_OPTTIME ? "Time" : "Space");
***************
*** 126,132
      printf ("\t%lu blocks reserved for data\n", 
          dsize(fil_sys));
  
! # if FS_TYPE == FS_BSD
      printf ("Cylinder groups = %ld; Inodes per cg = %ld; Data Blocks per cg = %ld\n",
              fil_sys->fs_ncg, fil_sys->fs_ipg, fil_sys->fs_fpg);
  # endif

--- 129,135 -----
      printf ("\t%lu blocks reserved for data\n", 
          dsize(fil_sys));
  
! # if (FS_TYPE == FS_BSD) || (FS_TYPE == FS_BSD_NFS)
      printf ("Cylinder groups = %ld; Inodes per cg = %ld; Data Blocks per cg = %ld\n",
              fil_sys->fs_ncg, fil_sys->fs_ipg, fil_sys->fs_fpg);
  # endif

Index: util.c
Prereq: 4.1
*** ../prev/util.c	Tue Jan 10 10:52:17 1989
--- util.c	Tue Jan 10 10:51:22 1989
***************
*** 1,4
! static char sccsid[] = "@(#)$Id: util.c, V4.1 88/11/16 17:31:35 $";
  
  /*
   * util.c - inode utilities

--- 1,4 -----
! static char sccsid[] = "@(#)$Id: util.c, V4.1.1.1 89/01/10 10:49:39 $";
  
  /*
   * util.c - inode utilities
***************
*** 2,8
  
  /*
   * util.c - inode utilities
!  * Version  : 4.1 - 88/11/16 17:31:35
   *
   * Author   : Michael J. Young
   * USmail   : Software Development Technologies, Inc.

--- 2,8 -----
  
  /*
   * util.c - inode utilities
!  * Version  : 4.1.1.1 - 89/01/10 10:49:39
   *
   * Author   : Michael J. Young
   * USmail   : Software Development Technologies, Inc.
***************
*** 33,38
   *
   * Wed Nov 16 11:31:32 EST 1988 - M. Young (mjy at sdti.SDTI.COM),
   *    Placed under SCCS
   */
  
  #include "fsconfig.h"

--- 33,41 -----
   *
   * Wed Nov 16 11:31:32 EST 1988 - M. Young (mjy at sdti.SDTI.COM),
   *    Placed under SCCS
+  *
+  * Thu Jan  5 10:29:19 EST 1989 - Rob McMahon (cudcv at warwick.ac.uk),
+  *    Added conditionals for NFS file systems
   */
  
  #include "fsconfig.h"
***************
*** 54,60
      l3tol (&temp, off, 1);
  #endif
  
! #if FS_TYPE == FS_BSD
      temp = *((daddr_t *)off);
  #endif
  

--- 57,63 -----
      l3tol (&temp, off, 1);
  #endif
  
! #if (FS_TYPE == FS_BSD) || (FS_TYPE == FS_BSD_NFS)
      temp = *((daddr_t *)off);
  #endif
  
-- 
Mike Young
Software Development Technologies, Inc., Sudbury MA       Tel: +1 508 443 5779
Internet: mjy at sdti.sdti.com                 UUCP: {harvard,mit-eddie}!sdti!mjy



More information about the Comp.sources.bugs mailing list