Print this page
10133 smatch fixes for usr/src/cmd/fs.d


  20  */
  21 
  22 /*
  23  * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
  24  */
  25 
  26 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  27 /*      All Rights Reserved     */
  28 
  29 /*
  30  * University Copyright- Copyright (c) 1982, 1986, 1988
  31  * The Regents of the University of California
  32  * All Rights Reserved
  33  *
  34  * University Acknowledgment- Portions of this document are derived from
  35  * software developed by the University of California, Berkeley, and its
  36  * contributors.
  37  */
  38 
  39 /*




  40  * The maximum supported file system size (in sectors) is the
  41  * number of frags that can be represented in an int32_t field
  42  * (INT_MAX) times the maximum number of sectors per frag.  Since
  43  * the maximum frag size is MAXBSIZE, the maximum number of sectors
  44  * per frag is MAXBSIZE/DEV_BSIZE.
  45  */
  46 #define FS_MAX  (((diskaddr_t)INT_MAX) * (MAXBSIZE/DEV_BSIZE))
  47 
  48 /*
  49  * make file system for cylinder-group style file systems
  50  *
  51  * usage:
  52  *
  53  *    mkfs [-F FSType] [-V] [-G [-P]] [-M dirname] [-m] [options]
  54  *      [-o specific_options]  special size
  55  *      [nsect ntrack bsize fsize cpg   minfree rps nbpi opt apc rotdelay
  56  *        2     3      4     5     6    7       8   9    10  11  12
  57  *      nrpos maxcontig mtb]
  58  *      13    14        15
  59  *


 218 #include        <malloc.h>
 219 #include        <string.h>
 220 #include        <strings.h>
 221 #include        <ctype.h>
 222 #include        <errno.h>
 223 #include        <sys/param.h>
 224 #include        <time.h>
 225 #include        <sys/types.h>
 226 #include        <sys/sysmacros.h>
 227 #include        <sys/vnode.h>
 228 #include        <sys/fs/ufs_fsdir.h>
 229 #include        <sys/fs/ufs_inode.h>
 230 #include        <sys/fs/ufs_fs.h>
 231 #include        <sys/fs/ufs_log.h>
 232 #include        <sys/mntent.h>
 233 #include        <sys/filio.h>
 234 #include        <limits.h>
 235 #include        <sys/int_const.h>
 236 #include        <signal.h>
 237 #include        <sys/efi_partition.h>

 238 #include        "roll_log.h"
 239 
 240 #define bcopy(f, t, n)    (void) memcpy(t, f, n)
 241 #define bzero(s, n)     (void) memset(s, 0, n)
 242 #define bcmp(s, d, n)   memcmp(s, d, n)
 243 
 244 #define index(s, r)     strchr(s, r)
 245 #define rindex(s, r)    strrchr(s, r)
 246 
 247 #include        <sys/stat.h>
 248 #include        <sys/statvfs.h>
 249 #include        <locale.h>
 250 #include        <fcntl.h>
 251 #include        <sys/isa_defs.h>  /* for ENDIAN defines */
 252 #include        <sys/vtoc.h>
 253 
 254 #include        <sys/dkio.h>
 255 #include        <sys/asynch.h>
 256 
 257 extern offset_t llseek();




  20  */
  21 
  22 /*
  23  * Copyright (c) 1988, 2010, Oracle and/or its affiliates. All rights reserved.
  24  */
  25 
  26 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  27 /*      All Rights Reserved     */
  28 
  29 /*
  30  * University Copyright- Copyright (c) 1982, 1986, 1988
  31  * The Regents of the University of California
  32  * All Rights Reserved
  33  *
  34  * University Acknowledgment- Portions of this document are derived from
  35  * software developed by the University of California, Berkeley, and its
  36  * contributors.
  37  */
  38 
  39 /*
  40  * Copyright (c) 2018, Joyent, Inc.
  41  */
  42 
  43 /*
  44  * The maximum supported file system size (in sectors) is the
  45  * number of frags that can be represented in an int32_t field
  46  * (INT_MAX) times the maximum number of sectors per frag.  Since
  47  * the maximum frag size is MAXBSIZE, the maximum number of sectors
  48  * per frag is MAXBSIZE/DEV_BSIZE.
  49  */
  50 #define FS_MAX  (((diskaddr_t)INT_MAX) * (MAXBSIZE/DEV_BSIZE))
  51 
  52 /*
  53  * make file system for cylinder-group style file systems
  54  *
  55  * usage:
  56  *
  57  *    mkfs [-F FSType] [-V] [-G [-P]] [-M dirname] [-m] [options]
  58  *      [-o specific_options]  special size
  59  *      [nsect ntrack bsize fsize cpg   minfree rps nbpi opt apc rotdelay
  60  *        2     3      4     5     6    7       8   9    10  11  12
  61  *      nrpos maxcontig mtb]
  62  *      13    14        15
  63  *


 222 #include        <malloc.h>
 223 #include        <string.h>
 224 #include        <strings.h>
 225 #include        <ctype.h>
 226 #include        <errno.h>
 227 #include        <sys/param.h>
 228 #include        <time.h>
 229 #include        <sys/types.h>
 230 #include        <sys/sysmacros.h>
 231 #include        <sys/vnode.h>
 232 #include        <sys/fs/ufs_fsdir.h>
 233 #include        <sys/fs/ufs_inode.h>
 234 #include        <sys/fs/ufs_fs.h>
 235 #include        <sys/fs/ufs_log.h>
 236 #include        <sys/mntent.h>
 237 #include        <sys/filio.h>
 238 #include        <limits.h>
 239 #include        <sys/int_const.h>
 240 #include        <signal.h>
 241 #include        <sys/efi_partition.h>
 242 #include        <fslib.h>
 243 #include        "roll_log.h"
 244 
 245 #define bcopy(f, t, n)    (void) memcpy(t, f, n)
 246 #define bzero(s, n)     (void) memset(s, 0, n)
 247 #define bcmp(s, d, n)   memcmp(s, d, n)
 248 
 249 #define index(s, r)     strchr(s, r)
 250 #define rindex(s, r)    strrchr(s, r)
 251 
 252 #include        <sys/stat.h>
 253 #include        <sys/statvfs.h>
 254 #include        <locale.h>
 255 #include        <fcntl.h>
 256 #include        <sys/isa_defs.h>  /* for ENDIAN defines */
 257 #include        <sys/vtoc.h>
 258 
 259 #include        <sys/dkio.h>
 260 #include        <sys/asynch.h>
 261 
 262 extern offset_t llseek();