Deleted Added
full compact
g_gate.h (162149) g_gate.h (204076)
1/*-
1/*-
2 * Copyright (c) 2004-2006 Pawel Jakub Dawidek <pjd@FreeBSD.org>
2 * Copyright (c) 2004-2009 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright

--- 7 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright

--- 7 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/geom/gate/g_gate.h 162149 2006-09-08 10:20:44Z pjd $
26 * $FreeBSD: head/sys/geom/gate/g_gate.h 204076 2010-02-18 23:16:19Z pjd $
27 */
28
29#ifndef _G_GATE_H_
30#define _G_GATE_H_
31
32#include <sys/param.h>
33#include <sys/lock.h>
34#include <sys/mutex.h>
35#include <sys/queue.h>
36
37#include <geom/geom.h>
38
39#define G_GATE_CLASS_NAME "GATE"
40#define G_GATE_PROVIDER_NAME "ggate"
41#define G_GATE_MOD_NAME "ggate"
42#define G_GATE_CTL_NAME "ggctl"
43
27 */
28
29#ifndef _G_GATE_H_
30#define _G_GATE_H_
31
32#include <sys/param.h>
33#include <sys/lock.h>
34#include <sys/mutex.h>
35#include <sys/queue.h>
36
37#include <geom/geom.h>
38
39#define G_GATE_CLASS_NAME "GATE"
40#define G_GATE_PROVIDER_NAME "ggate"
41#define G_GATE_MOD_NAME "ggate"
42#define G_GATE_CTL_NAME "ggctl"
43
44#define G_GATE_VERSION 1
44#define G_GATE_VERSION 2
45
46/*
47 * Maximum number of request that can be stored in
48 * the queue when there are no workers.
49 */
50#define G_GATE_MAX_QUEUE_SIZE 4096
51
52#define G_GATE_FLAG_READONLY 0x0001
53#define G_GATE_FLAG_WRITEONLY 0x0002
54#define G_GATE_FLAG_DESTROY 0x1000
55#define G_GATE_USERFLAGS (G_GATE_FLAG_READONLY | G_GATE_FLAG_WRITEONLY)
56
45
46/*
47 * Maximum number of request that can be stored in
48 * the queue when there are no workers.
49 */
50#define G_GATE_MAX_QUEUE_SIZE 4096
51
52#define G_GATE_FLAG_READONLY 0x0001
53#define G_GATE_FLAG_WRITEONLY 0x0002
54#define G_GATE_FLAG_DESTROY 0x1000
55#define G_GATE_USERFLAGS (G_GATE_FLAG_READONLY | G_GATE_FLAG_WRITEONLY)
56
57/*
58 * Pick unit number automatically in /dev/ggate<unit>.
59 */
60#define G_GATE_UNIT_AUTO (-1)
61/*
62 * Full provider name is given, so don't use ggate<unit>.
63 */
64#define G_GATE_NAME_GIVEN (-2)
65
57#define G_GATE_CMD_CREATE _IOWR('m', 0, struct g_gate_ctl_create)
58#define G_GATE_CMD_DESTROY _IOWR('m', 1, struct g_gate_ctl_destroy)
59#define G_GATE_CMD_CANCEL _IOWR('m', 2, struct g_gate_ctl_cancel)
60#define G_GATE_CMD_START _IOWR('m', 3, struct g_gate_ctl_io)
61#define G_GATE_CMD_DONE _IOWR('m', 4, struct g_gate_ctl_io)
62
63#define G_GATE_INFOSIZE 2048
64

--- 50 unchanged lines hidden (view full) ---

115
116struct g_gate_ctl_create {
117 u_int gctl_version;
118 off_t gctl_mediasize;
119 u_int gctl_sectorsize;
120 u_int gctl_flags;
121 u_int gctl_maxcount;
122 u_int gctl_timeout;
66#define G_GATE_CMD_CREATE _IOWR('m', 0, struct g_gate_ctl_create)
67#define G_GATE_CMD_DESTROY _IOWR('m', 1, struct g_gate_ctl_destroy)
68#define G_GATE_CMD_CANCEL _IOWR('m', 2, struct g_gate_ctl_cancel)
69#define G_GATE_CMD_START _IOWR('m', 3, struct g_gate_ctl_io)
70#define G_GATE_CMD_DONE _IOWR('m', 4, struct g_gate_ctl_io)
71
72#define G_GATE_INFOSIZE 2048
73

--- 50 unchanged lines hidden (view full) ---

124
125struct g_gate_ctl_create {
126 u_int gctl_version;
127 off_t gctl_mediasize;
128 u_int gctl_sectorsize;
129 u_int gctl_flags;
130 u_int gctl_maxcount;
131 u_int gctl_timeout;
132 char gctl_name[NAME_MAX];
123 char gctl_info[G_GATE_INFOSIZE];
133 char gctl_info[G_GATE_INFOSIZE];
124 int gctl_unit; /* out */
134 int gctl_unit; /* in/out */
125};
126
127struct g_gate_ctl_destroy {
128 u_int gctl_version;
129 int gctl_unit;
130 int gctl_force;
135};
136
137struct g_gate_ctl_destroy {
138 u_int gctl_version;
139 int gctl_unit;
140 int gctl_force;
141 char gctl_name[NAME_MAX];
131};
132
133struct g_gate_ctl_cancel {
134 u_int gctl_version;
135 int gctl_unit;
136 uintptr_t gctl_seq;
142};
143
144struct g_gate_ctl_cancel {
145 u_int gctl_version;
146 int gctl_unit;
147 uintptr_t gctl_seq;
148 char gctl_name[NAME_MAX];
137};
138
139struct g_gate_ctl_io {
140 u_int gctl_version;
141 int gctl_unit;
142 uintptr_t gctl_seq;
143 u_int gctl_cmd;
144 off_t gctl_offset;
145 off_t gctl_length;
146 void *gctl_data;
147 int gctl_error;
148};
149#endif /* !_G_GATE_H_ */
149};
150
151struct g_gate_ctl_io {
152 u_int gctl_version;
153 int gctl_unit;
154 uintptr_t gctl_seq;
155 u_int gctl_cmd;
156 off_t gctl_offset;
157 off_t gctl_length;
158 void *gctl_data;
159 int gctl_error;
160};
161#endif /* !_G_GATE_H_ */