g_nop.h revision 132381
1132720Skan/*-
2132720Skan * Copyright (c) 2004 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3169691Skan * All rights reserved.
4132720Skan *
5132720Skan * Redistribution and use in source and binary forms, with or without
6132720Skan * modification, are permitted provided that the following conditions
7132720Skan * are met:
8132720Skan * 1. Redistributions of source code must retain the above copyright
9132720Skan *    notice, this list of conditions and the following disclaimer.
10132720Skan * 2. Redistributions in binary form must reproduce the above copyright
11132720Skan *    notice, this list of conditions and the following disclaimer in the
12132720Skan *    documentation and/or other materials provided with the distribution.
13132720Skan *
14132720Skan * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
15132720Skan * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16132720Skan * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17132720Skan * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
18132720Skan * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19169691Skan * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20132720Skan * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21132720Skan * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22132720Skan * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23132720Skan * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24132720Skan * SUCH DAMAGE.
25132720Skan *
26132720Skan * $FreeBSD: head/sys/geom/nop/g_nop.h 132381 2004-07-19 07:52:56Z pjd $
27132720Skan */
28132720Skan
29132720Skan#ifndef	_G_NOP_H_
30132720Skan#define	_G_NOP_H_
31169691Skan
32169691Skan#define	G_NOP_CLASS_NAME	"NOP"
33169691Skan#define	G_NOP_VERSION		2
34169691Skan#define	G_NOP_SUFFIX		".nop"
35132720Skan
36132720Skan#ifdef _KERNEL
37132720Skan#define	G_NOP_DEBUG(lvl, ...)	do {					\
38132720Skan	if (g_nop_debug >= (lvl)) {					\
39132720Skan		printf("GEOM_NOP");					\
40132720Skan		if (g_nop_debug > 0)					\
41169691Skan			printf("[%u]", lvl);				\
42132720Skan		printf(": ");						\
43169691Skan		printf(__VA_ARGS__);					\
44169691Skan		printf("\n");						\
45132720Skan	}								\
46132720Skan} while (0)
47132720Skan#define	G_NOP_LOGREQ(bp, ...)	do {					\
48132720Skan	if (g_nop_debug >= 2) {						\
49132720Skan		printf("GEOM_NOP[2]: ");				\
50169691Skan		printf(__VA_ARGS__);					\
51132720Skan		printf(" ");						\
52132720Skan		g_print_bio(bp);					\
53132720Skan		printf("\n");						\
54169691Skan	}								\
55132720Skan} while (0)
56132720Skan
57132720Skanstruct g_nop_softc {
58132720Skan	off_t	sc_offset;
59132720Skan	u_int	sc_failprob;
60132720Skan};
61132720Skan#endif	/* _KERNEL */
62132720Skan
63132720Skan#endif	/* _G_NOP_H_ */
64132720Skan