Print this page
8115 parallel zfs mount


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


  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 #ifndef _SYS_BUF_H
  40 #define _SYS_BUF_H
  41 
  42 #include <sys/types32.h>
  43 #include <sys/t_lock.h>


 275 };
 276 
 277 
 278 /*
 279  * Unlink a buffer from the available (free or delayed write) list and mark
 280  * it busy (internal interface).
 281  */
 282 #define notavail(bp) \
 283 {\
 284         ASSERT(SEMA_HELD(&bp->b_sem)); \
 285         ASSERT((bp)->av_forw != NULL); \
 286         ASSERT((bp)->av_back != NULL); \
 287         ASSERT((bp)->av_forw != (bp)); \
 288         ASSERT((bp)->av_back != (bp)); \
 289         (bp)->av_back->av_forw = (bp)->av_forw; \
 290         (bp)->av_forw->av_back = (bp)->av_back; \
 291         (bp)->b_flags |= B_BUSY; \
 292         (bp)->av_forw = (bp)->av_back = NULL; \
 293 }
 294 
 295 #if defined(_KERNEL)
 296 /*
 297  * Macros to avoid the extra function call needed for binary compat.
 298  *
 299  * B_RETRYWRI is not included in clear_flags for BWRITE(), BWRITE2(),
 300  * or brwrite() so that the retry operation is persistent until the
 301  * write either succeeds or the buffer is bfinval()'d.
 302  *
 303  */
 304 #define BREAD(dev, blkno, bsize) \
 305         bread_common(/* ufsvfsp */ NULL, dev, blkno, bsize)
 306 
 307 #define BWRITE(bp) \
 308         bwrite_common(/* ufsvfsp */ NULL, bp, /* force_wait */ 0, \
 309                 /* do_relse */ 1, \
 310                 /* clear_flags */ (B_READ | B_DONE | B_ERROR | B_DELWRI))
 311 
 312 #define BWRITE2(bp) \
 313         bwrite_common(/* ufsvfsp */ NULL, bp, /* force_wait */ 1, \
 314                 /* do_relse */ 0, \
 315                 /* clear_flags */ (B_READ | B_DONE | B_ERROR | B_DELWRI))


 380 void    *bp_mapin_common(struct buf *, int);
 381 void    bp_mapout(struct buf *);
 382 int     bp_copyin(struct buf *, void *, offset_t, size_t);
 383 int     bp_copyout(void *, struct buf *, offset_t, size_t);
 384 void    bp_init(size_t, uint_t);
 385 int     bp_color(struct buf *);
 386 void    pageio_done(struct buf *);
 387 struct buf *bread(dev_t, daddr_t, long);
 388 struct buf *bread_common(void *, dev_t, daddr_t, long);
 389 struct buf *breada(dev_t, daddr_t, daddr_t, long);
 390 struct buf *getblk(dev_t, daddr_t, long);
 391 struct buf *getblk_common(void *, dev_t, daddr_t, long, int);
 392 struct buf *ngeteblk(long);
 393 struct buf *geteblk(void);
 394 struct buf *pageio_setup(struct page *, size_t, struct vnode *, int);
 395 void bioerror(struct buf *bp, int error);
 396 void bioreset(struct buf *bp);
 397 struct buf *bioclone(struct buf *, off_t, size_t, dev_t, daddr_t,
 398         int (*)(struct buf *), struct buf *, int);
 399 size_t  biosize(void);
 400 #endif  /* defined(_KERNEL) */
 401 
 402 #ifdef  __cplusplus
 403 }
 404 #endif
 405 
 406 #endif  /* _SYS_BUF_H */


   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  *
  25  * Copyright 2017 RackTop Systems.
  26  */
  27 
  28 /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T     */
  29 /*        All Rights Reserved   */
  30 
  31 /*
  32  * University Copyright- Copyright (c) 1982, 1986, 1988
  33  * The Regents of the University of California
  34  * All Rights Reserved
  35  *
  36  * University Acknowledgment- Portions of this document are derived from
  37  * software developed by the University of California, Berkeley, and its
  38  * contributors.
  39  */
  40 
  41 #ifndef _SYS_BUF_H
  42 #define _SYS_BUF_H
  43 
  44 #include <sys/types32.h>
  45 #include <sys/t_lock.h>


 277 };
 278 
 279 
 280 /*
 281  * Unlink a buffer from the available (free or delayed write) list and mark
 282  * it busy (internal interface).
 283  */
 284 #define notavail(bp) \
 285 {\
 286         ASSERT(SEMA_HELD(&bp->b_sem)); \
 287         ASSERT((bp)->av_forw != NULL); \
 288         ASSERT((bp)->av_back != NULL); \
 289         ASSERT((bp)->av_forw != (bp)); \
 290         ASSERT((bp)->av_back != (bp)); \
 291         (bp)->av_back->av_forw = (bp)->av_forw; \
 292         (bp)->av_forw->av_back = (bp)->av_back; \
 293         (bp)->b_flags |= B_BUSY; \
 294         (bp)->av_forw = (bp)->av_back = NULL; \
 295 }
 296 
 297 #if defined(_KERNEL) || defined(_FAKE_KERNEL)
 298 /*
 299  * Macros to avoid the extra function call needed for binary compat.
 300  *
 301  * B_RETRYWRI is not included in clear_flags for BWRITE(), BWRITE2(),
 302  * or brwrite() so that the retry operation is persistent until the
 303  * write either succeeds or the buffer is bfinval()'d.
 304  *
 305  */
 306 #define BREAD(dev, blkno, bsize) \
 307         bread_common(/* ufsvfsp */ NULL, dev, blkno, bsize)
 308 
 309 #define BWRITE(bp) \
 310         bwrite_common(/* ufsvfsp */ NULL, bp, /* force_wait */ 0, \
 311                 /* do_relse */ 1, \
 312                 /* clear_flags */ (B_READ | B_DONE | B_ERROR | B_DELWRI))
 313 
 314 #define BWRITE2(bp) \
 315         bwrite_common(/* ufsvfsp */ NULL, bp, /* force_wait */ 1, \
 316                 /* do_relse */ 0, \
 317                 /* clear_flags */ (B_READ | B_DONE | B_ERROR | B_DELWRI))


 382 void    *bp_mapin_common(struct buf *, int);
 383 void    bp_mapout(struct buf *);
 384 int     bp_copyin(struct buf *, void *, offset_t, size_t);
 385 int     bp_copyout(void *, struct buf *, offset_t, size_t);
 386 void    bp_init(size_t, uint_t);
 387 int     bp_color(struct buf *);
 388 void    pageio_done(struct buf *);
 389 struct buf *bread(dev_t, daddr_t, long);
 390 struct buf *bread_common(void *, dev_t, daddr_t, long);
 391 struct buf *breada(dev_t, daddr_t, daddr_t, long);
 392 struct buf *getblk(dev_t, daddr_t, long);
 393 struct buf *getblk_common(void *, dev_t, daddr_t, long, int);
 394 struct buf *ngeteblk(long);
 395 struct buf *geteblk(void);
 396 struct buf *pageio_setup(struct page *, size_t, struct vnode *, int);
 397 void bioerror(struct buf *bp, int error);
 398 void bioreset(struct buf *bp);
 399 struct buf *bioclone(struct buf *, off_t, size_t, dev_t, daddr_t,
 400         int (*)(struct buf *), struct buf *, int);
 401 size_t  biosize(void);
 402 #endif  /* defined(_KERNEL) || defined(_FAKE_KERNEL) */
 403 
 404 #ifdef  __cplusplus
 405 }
 406 #endif
 407 
 408 #endif  /* _SYS_BUF_H */