Deleted Added
full compact
iscsi.c (265501) iscsi.c (265505)
1/*-
2 * Copyright (c) 2012 The FreeBSD Foundation
3 * All rights reserved.
4 *
5 * This software was developed by Edward Tomasz Napierala under sponsorship
6 * from the FreeBSD Foundation.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
1/*-
2 * Copyright (c) 2012 The FreeBSD Foundation
3 * All rights reserved.
4 *
5 * This software was developed by Edward Tomasz Napierala under sponsorship
6 * from the FreeBSD Foundation.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $FreeBSD: stable/10/sys/dev/iscsi/iscsi.c 265501 2014-05-07 06:46:59Z trasz $
29 * $FreeBSD: stable/10/sys/dev/iscsi/iscsi.c 265505 2014-05-07 07:25:47Z trasz $
30 */
31
32#include <sys/param.h>
33#include <sys/condvar.h>
34#include <sys/conf.h>
35#include <sys/eventhandler.h>
36#include <sys/file.h>
37#include <sys/kernel.h>

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

94 255, "Max number of IO requests queued");
95
96static MALLOC_DEFINE(M_ISCSI, "iSCSI", "iSCSI initiator");
97static uma_zone_t iscsi_outstanding_zone;
98
99#define CONN_SESSION(X) ((struct iscsi_session *)X->ic_prv0)
100#define PDU_SESSION(X) (CONN_SESSION(X->ip_conn))
101
30 */
31
32#include <sys/param.h>
33#include <sys/condvar.h>
34#include <sys/conf.h>
35#include <sys/eventhandler.h>
36#include <sys/file.h>
37#include <sys/kernel.h>

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

94 255, "Max number of IO requests queued");
95
96static MALLOC_DEFINE(M_ISCSI, "iSCSI", "iSCSI initiator");
97static uma_zone_t iscsi_outstanding_zone;
98
99#define CONN_SESSION(X) ((struct iscsi_session *)X->ic_prv0)
100#define PDU_SESSION(X) (CONN_SESSION(X->ip_conn))
101
102#define ISCSI_DEBUG(X, ...) \
103 if (debug > 1) { \
104 printf("%s: " X "\n", __func__, ## __VA_ARGS__);\
102#define ISCSI_DEBUG(X, ...) \
103 do { \
104 if (debug > 1) \
105 printf("%s: " X "\n", __func__, ## __VA_ARGS__);\
105 } while (0)
106
106 } while (0)
107
107#define ISCSI_WARN(X, ...) \
108 if (debug > 0) { \
109 printf("WARNING: %s: " X "\n", \
110 __func__, ## __VA_ARGS__); \
108#define ISCSI_WARN(X, ...) \
109 do { \
110 if (debug > 0) { \
111 printf("WARNING: %s: " X "\n", \
112 __func__, ## __VA_ARGS__); \
113 } \
111 } while (0)
112
114 } while (0)
115
113#define ISCSI_SESSION_DEBUG(S, X, ...) \
114 if (debug > 1) { \
115 printf("%s: %s (%s): " X "\n", \
116 __func__, S->is_conf.isc_target_addr, \
117 S->is_conf.isc_target, ## __VA_ARGS__); \
116#define ISCSI_SESSION_DEBUG(S, X, ...) \
117 do { \
118 if (debug > 1) { \
119 printf("%s: %s (%s): " X "\n", \
120 __func__, S->is_conf.isc_target_addr, \
121 S->is_conf.isc_target, ## __VA_ARGS__); \
122 } \
118 } while (0)
119
123 } while (0)
124
120#define ISCSI_SESSION_WARN(S, X, ...) \
121 if (debug > 0) { \
122 printf("WARNING: %s (%s): " X "\n", \
123 S->is_conf.isc_target_addr, \
124 S->is_conf.isc_target, ## __VA_ARGS__); \
125#define ISCSI_SESSION_WARN(S, X, ...) \
126 do { \
127 if (debug > 0) { \
128 printf("WARNING: %s (%s): " X "\n", \
129 S->is_conf.isc_target_addr, \
130 S->is_conf.isc_target, ## __VA_ARGS__); \
131 } \
125 } while (0)
126
127#define ISCSI_SESSION_LOCK(X) mtx_lock(&X->is_lock)
128#define ISCSI_SESSION_UNLOCK(X) mtx_unlock(&X->is_lock)
129#define ISCSI_SESSION_LOCK_ASSERT(X) mtx_assert(&X->is_lock, MA_OWNED)
130
131static int iscsi_ioctl(struct cdev *dev, u_long cmd, caddr_t arg,
132 int mode, struct thread *td);

--- 2076 unchanged lines hidden ---
132 } while (0)
133
134#define ISCSI_SESSION_LOCK(X) mtx_lock(&X->is_lock)
135#define ISCSI_SESSION_UNLOCK(X) mtx_unlock(&X->is_lock)
136#define ISCSI_SESSION_LOCK_ASSERT(X) mtx_assert(&X->is_lock, MA_OWNED)
137
138static int iscsi_ioctl(struct cdev *dev, u_long cmd, caddr_t arg,
139 int mode, struct thread *td);

--- 2076 unchanged lines hidden ---