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 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 #include <sys/systm.h>
  27 #include <sys/types.h>
  28 #include <sys/vnode.h>
  29 #include <sys/errno.h>
  30 #include <sys/sysmacros.h>
  31 #include <sys/debug.h>
  32 #include <sys/kmem.h>
  33 #include <sys/conf.h>
  34 #include <sys/proc.h>
  35 #include <sys/cmn_err.h>
  36 #include <sys/fssnap_if.h>
  37 #include <sys/fs/ufs_inode.h>
  38 #include <sys/fs/ufs_filio.h>
  39 #include <sys/fs/ufs_log.h>
  40 #include <sys/fs/ufs_bio.h>
  41 #include <sys/atomic.h>
  42 
  43 extern int              maxphys;
  44 extern uint_t           bypass_snapshot_throttle_key;
  45 
  46 extern struct kmem_cache        *lufs_sv;
  47 extern struct kmem_cache        *lufs_bp;
  48 
  49 static void
  50 makebusy(ml_unit_t *ul, buf_t *bp)
  51 {
  52         sema_p(&bp->b_sem);
  53         if ((bp->b_flags & B_ERROR) == 0)
  54                 return;
  55         if (bp->b_flags & B_READ)
  56                 ldl_seterror(ul, "Error reading ufs log");
  57         else
  58                 ldl_seterror(ul, "Error writing ufs log");
  59 }
  60 
  61 static int
  62 logdone(buf_t *bp)
  63 {
 
 | 
 
 
   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 2009 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 /*
  26  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  27  */
  28 
  29 #include <sys/systm.h>
  30 #include <sys/types.h>
  31 #include <sys/vnode.h>
  32 #include <sys/errno.h>
  33 #include <sys/sysmacros.h>
  34 #include <sys/debug.h>
  35 #include <sys/kmem.h>
  36 #include <sys/conf.h>
  37 #include <sys/proc.h>
  38 #include <sys/cmn_err.h>
  39 #include <sys/fssnap_if.h>
  40 #include <sys/fs/ufs_inode.h>
  41 #include <sys/fs/ufs_filio.h>
  42 #include <sys/fs/ufs_log.h>
  43 #include <sys/fs/ufs_bio.h>
  44 #include <sys/atomic.h>
  45 #include <sys/sunddi.h>
  46 
  47 extern uint_t           bypass_snapshot_throttle_key;
  48 
  49 extern struct kmem_cache        *lufs_sv;
  50 extern struct kmem_cache        *lufs_bp;
  51 
  52 static void
  53 makebusy(ml_unit_t *ul, buf_t *bp)
  54 {
  55         sema_p(&bp->b_sem);
  56         if ((bp->b_flags & B_ERROR) == 0)
  57                 return;
  58         if (bp->b_flags & B_READ)
  59                 ldl_seterror(ul, "Error reading ufs log");
  60         else
  61                 ldl_seterror(ul, "Error writing ufs log");
  62 }
  63 
  64 static int
  65 logdone(buf_t *bp)
  66 {
 
 |