Print this page
remove support for non-ANSI compilation


   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License, Version 1.0 only
   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*


  23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 
  27 #ifndef _SYS_FS_UFS_TRANS_H
  28 #define _SYS_FS_UFS_TRANS_H
  29 
  30 #pragma ident   "%Z%%M% %I%     %E% SMI"
  31 
  32 #ifdef  __cplusplus
  33 extern "C" {
  34 #endif
  35 
  36 #include        <sys/types.h>
  37 #include        <sys/cred.h>
  38 #include        <sys/fs/ufs_fs.h>
  39 
  40 /*
  41  * Types of deltas
  42  */
  43 typedef enum delta_type {
  44         DT_NONE,        /*  0 no assigned type */
  45         DT_SB,          /*  1 superblock */
  46         DT_CG,          /*  2 cylinder group */
  47         DT_SI,          /*  3 summary info */
  48         DT_AB,          /*  4 allocation block */
  49         DT_ABZERO,      /*  5 a zero'ed allocation block */
  50         DT_DIR,         /*  6 directory */
  51         DT_INODE,       /*  7 inode */


 464 #define TOP_IUPDAT_SIZE(IP)     INODESIZE + SIZECG(IP)
 465 #define TOP_SBUPDATE_SIZE       (SIZESB)
 466 #define TOP_SBWRITE_SIZE        (SIZESB)
 467 #define TOP_PUTPAGE_SIZE(IP)    (INODESIZE + SIZECG(IP))
 468 #define TOP_SETATTR_SIZE(IP)    (SIZECG(IP) + INODESIZE + QUOTASIZE + \
 469                 ACLSIZE(IP))
 470 #define TOP_IFREE_SIZE(IP)      (SIZECG(IP) + INODESIZE + QUOTASIZE)
 471 #define TOP_MOUNT_SIZE          (SIZESB)
 472 #define TOP_COMMIT_SIZE         (0)
 473 
 474 /*
 475  * The minimum log size is 1M.  So we will allow 1 fs operation to
 476  * reserve at most 512K of log space.
 477  */
 478 #define TOP_MAX_RESV    (512 * 1024)
 479 
 480 
 481 /*
 482  * ufs trans function prototypes
 483  */
 484 #if defined(_KERNEL) && defined(__STDC__)
 485 
 486 extern int              ufs_trans_hlock();
 487 extern void             ufs_trans_onerror();
 488 extern int              ufs_trans_push_inode(struct ufsvfs *, delta_t, ino_t);
 489 extern int              ufs_trans_push_buf(struct ufsvfs *, delta_t, daddr_t);
 490 extern int              ufs_trans_push_si(struct ufsvfs *, delta_t, int);
 491 extern void             ufs_trans_sbupdate(struct ufsvfs *, struct vfs *,
 492                                 top_t);
 493 extern void             ufs_trans_sbwrite(struct ufsvfs *, top_t);
 494 extern void             ufs_trans_iupdat(struct inode *, int);
 495 extern void             ufs_trans_mata_mount(struct ufsvfs *);
 496 extern void             ufs_trans_mata_umount(struct ufsvfs *);
 497 extern void             ufs_trans_mata_si(struct ufsvfs *, struct fs *);
 498 extern void             ufs_trans_mata_iget(struct inode *);
 499 extern void             ufs_trans_mata_free(struct ufsvfs *, offset_t, off_t);
 500 extern void             ufs_trans_mata_alloc(struct ufsvfs *, struct inode *,
 501                                 daddr_t, ulong_t, int);
 502 extern int              ufs_trans_dir(struct inode *, off_t);
 503 extern void             ufs_trans_quota(struct dquot *);
 504 extern void             ufs_trans_dqrele(struct dquot *);


 521 void    top_delta(struct ufsvfs *ufsvfsp, offset_t mof, off_t nb, delta_t dtyp,
 522             int (*func)(), ulong_t arg);
 523 void    top_cancel(struct ufsvfs *ufsvfsp, offset_t mof, off_t nb, int flags);
 524 int     top_iscancel(struct ufsvfs *ufsvfsp, offset_t mof, off_t nb);
 525 void    top_seterror(struct ufsvfs *ufsvfsp);
 526 int     top_iserror(struct ufsvfs *ufsvfsp);
 527 void    top_begin_sync(struct ufsvfs *ufsvfsp, top_t topid, ulong_t size,
 528             int *error);
 529 int     top_begin_async(struct ufsvfs *ufsvfsp, top_t topid, ulong_t size,
 530             int tryasync);
 531 void    top_end_sync(struct ufsvfs *ufsvfsp, int *ep, top_t topid,
 532             ulong_t size);
 533 void    top_end_async(struct ufsvfs *ufsvfsp, top_t topid, ulong_t size);
 534 void    top_log(struct ufsvfs *ufsvfsp, char *va, offset_t vamof, off_t nb,
 535             caddr_t buf, uint32_t bufsz);
 536 void    top_mataadd(struct ufsvfs *ufsvfsp, offset_t mof, off_t nb);
 537 void    top_matadel(struct ufsvfs *ufsvfsp, offset_t mof, off_t nb);
 538 void    top_mataclr(struct ufsvfs *ufsvfsp);
 539 
 540 
 541 #endif  /* defined(_KERNEL) && defined(__STDC__) */
 542 
 543 #ifdef  __cplusplus
 544 }
 545 #endif
 546 
 547 #endif  /* _SYS_FS_UFS_TRANS_H */


   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License, Version 1.0 only
   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*
  23  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  24  *
  25  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  26  * Use is subject to license terms.
  27  */
  28 
  29 #ifndef _SYS_FS_UFS_TRANS_H
  30 #define _SYS_FS_UFS_TRANS_H
  31 


  32 #ifdef  __cplusplus
  33 extern "C" {
  34 #endif
  35 
  36 #include        <sys/types.h>
  37 #include        <sys/cred.h>
  38 #include        <sys/fs/ufs_fs.h>
  39 
  40 /*
  41  * Types of deltas
  42  */
  43 typedef enum delta_type {
  44         DT_NONE,        /*  0 no assigned type */
  45         DT_SB,          /*  1 superblock */
  46         DT_CG,          /*  2 cylinder group */
  47         DT_SI,          /*  3 summary info */
  48         DT_AB,          /*  4 allocation block */
  49         DT_ABZERO,      /*  5 a zero'ed allocation block */
  50         DT_DIR,         /*  6 directory */
  51         DT_INODE,       /*  7 inode */


 464 #define TOP_IUPDAT_SIZE(IP)     INODESIZE + SIZECG(IP)
 465 #define TOP_SBUPDATE_SIZE       (SIZESB)
 466 #define TOP_SBWRITE_SIZE        (SIZESB)
 467 #define TOP_PUTPAGE_SIZE(IP)    (INODESIZE + SIZECG(IP))
 468 #define TOP_SETATTR_SIZE(IP)    (SIZECG(IP) + INODESIZE + QUOTASIZE + \
 469                 ACLSIZE(IP))
 470 #define TOP_IFREE_SIZE(IP)      (SIZECG(IP) + INODESIZE + QUOTASIZE)
 471 #define TOP_MOUNT_SIZE          (SIZESB)
 472 #define TOP_COMMIT_SIZE         (0)
 473 
 474 /*
 475  * The minimum log size is 1M.  So we will allow 1 fs operation to
 476  * reserve at most 512K of log space.
 477  */
 478 #define TOP_MAX_RESV    (512 * 1024)
 479 
 480 
 481 /*
 482  * ufs trans function prototypes
 483  */
 484 #if defined(_KERNEL)
 485 
 486 extern int              ufs_trans_hlock();
 487 extern void             ufs_trans_onerror();
 488 extern int              ufs_trans_push_inode(struct ufsvfs *, delta_t, ino_t);
 489 extern int              ufs_trans_push_buf(struct ufsvfs *, delta_t, daddr_t);
 490 extern int              ufs_trans_push_si(struct ufsvfs *, delta_t, int);
 491 extern void             ufs_trans_sbupdate(struct ufsvfs *, struct vfs *,
 492                                 top_t);
 493 extern void             ufs_trans_sbwrite(struct ufsvfs *, top_t);
 494 extern void             ufs_trans_iupdat(struct inode *, int);
 495 extern void             ufs_trans_mata_mount(struct ufsvfs *);
 496 extern void             ufs_trans_mata_umount(struct ufsvfs *);
 497 extern void             ufs_trans_mata_si(struct ufsvfs *, struct fs *);
 498 extern void             ufs_trans_mata_iget(struct inode *);
 499 extern void             ufs_trans_mata_free(struct ufsvfs *, offset_t, off_t);
 500 extern void             ufs_trans_mata_alloc(struct ufsvfs *, struct inode *,
 501                                 daddr_t, ulong_t, int);
 502 extern int              ufs_trans_dir(struct inode *, off_t);
 503 extern void             ufs_trans_quota(struct dquot *);
 504 extern void             ufs_trans_dqrele(struct dquot *);


 521 void    top_delta(struct ufsvfs *ufsvfsp, offset_t mof, off_t nb, delta_t dtyp,
 522             int (*func)(), ulong_t arg);
 523 void    top_cancel(struct ufsvfs *ufsvfsp, offset_t mof, off_t nb, int flags);
 524 int     top_iscancel(struct ufsvfs *ufsvfsp, offset_t mof, off_t nb);
 525 void    top_seterror(struct ufsvfs *ufsvfsp);
 526 int     top_iserror(struct ufsvfs *ufsvfsp);
 527 void    top_begin_sync(struct ufsvfs *ufsvfsp, top_t topid, ulong_t size,
 528             int *error);
 529 int     top_begin_async(struct ufsvfs *ufsvfsp, top_t topid, ulong_t size,
 530             int tryasync);
 531 void    top_end_sync(struct ufsvfs *ufsvfsp, int *ep, top_t topid,
 532             ulong_t size);
 533 void    top_end_async(struct ufsvfs *ufsvfsp, top_t topid, ulong_t size);
 534 void    top_log(struct ufsvfs *ufsvfsp, char *va, offset_t vamof, off_t nb,
 535             caddr_t buf, uint32_t bufsz);
 536 void    top_mataadd(struct ufsvfs *ufsvfsp, offset_t mof, off_t nb);
 537 void    top_matadel(struct ufsvfs *ufsvfsp, offset_t mof, off_t nb);
 538 void    top_mataclr(struct ufsvfs *ufsvfsp);
 539 
 540 
 541 #endif  /* defined(_KERNEL) */
 542 
 543 #ifdef  __cplusplus
 544 }
 545 #endif
 546 
 547 #endif  /* _SYS_FS_UFS_TRANS_H */