aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/ctl
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2020-09-01 22:13:48 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2020-09-01 22:13:48 +0000
commit27dcd3d90b41d3c89eac3c2b50b9a6f515e5c89d (patch)
tree4a7e8650e9713823d6fca69814a67a415da1f6d3 /sys/cam/ctl
parent985b8ee8d299302b1e711d25db0c65ba0a0f1b47 (diff)
downloadsrc-27dcd3d90b41d3c89eac3c2b50b9a6f515e5c89d.tar.gz
src-27dcd3d90b41d3c89eac3c2b50b9a6f515e5c89d.zip
cam: clean up empty lines in .c and .h files
Notes
Notes: svn path=/head/; revision=365225
Diffstat (limited to 'sys/cam/ctl')
-rw-r--r--sys/cam/ctl/README.ctl.txt3
-rw-r--r--sys/cam/ctl/ctl.c22
-rw-r--r--sys/cam/ctl/ctl_backend.c1
-rw-r--r--sys/cam/ctl/ctl_backend.h1
-rw-r--r--sys/cam/ctl/ctl_backend_block.c2
-rw-r--r--sys/cam/ctl/ctl_cmd_table.c1
-rw-r--r--sys/cam/ctl/ctl_frontend_ioctl.c4
-rw-r--r--sys/cam/ctl/ctl_frontend_iscsi.c2
-rw-r--r--sys/cam/ctl/ctl_ha.c2
-rw-r--r--sys/cam/ctl/ctl_io.h2
-rw-r--r--sys/cam/ctl/ctl_scsi_all.c2
-rw-r--r--sys/cam/ctl/ctl_ser_table.c1
-rw-r--r--sys/cam/ctl/ctl_tpc.c1
-rw-r--r--sys/cam/ctl/ctl_tpc_local.c1
-rw-r--r--sys/cam/ctl/scsi_ctl.c4
15 files changed, 3 insertions, 46 deletions
diff --git a/sys/cam/ctl/README.ctl.txt b/sys/cam/ctl/README.ctl.txt
index 89030e20298a..27ebe49aec56 100644
--- a/sys/cam/ctl/README.ctl.txt
+++ b/sys/cam/ctl/README.ctl.txt
@@ -162,7 +162,6 @@ LUN Backend Size (Blocks) BS Serial Number Device ID
11 ramdisk 204800000000000 512 MYSERIAL 1 MYDEVID 1
lun_type=0
-
Revision 1.4 Changes
====================
- Added in the second HA mode (where CTL does the data transfers instead
@@ -172,7 +171,7 @@ Revision 1.4 Changes
- Fixed the phantom device problem in the CTL CAM SIM and improved the
CAM SIM to automatically trigger a rescan when the port is enabled and
disabled.
-
+
- Made the number of threads in the block backend configurable via sysctl,
loader tunable and the ctladm command line. (You can now specify
-o num_threads=4 when creating a LUN with ctladm create.)
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c
index 0a09cc0b2c80..7887009d351c 100644
--- a/sys/cam/ctl/ctl.c
+++ b/sys/cam/ctl/ctl.c
@@ -584,7 +584,6 @@ static struct cdevsw ctl_cdevsw = {
.d_name = "ctl",
};
-
MALLOC_DEFINE(M_CTL, "ctlmem", "Memory used for CTL");
static int ctl_module_event_handler(module_t, int /*modeventtype_t*/, void *);
@@ -1916,7 +1915,6 @@ ctl_init(void)
softc->ctl_ports = malloc(sizeof(struct ctl_port *) * ctl_max_ports,
M_DEVBUF, M_WAITOK | M_ZERO);
-
/*
* In Copan's HA scheme, the "master" and "slave" roles are
* figured out through the slot the controller is in. Although it
@@ -2472,7 +2470,6 @@ ctl_sbuf_printf_esc(struct sbuf *sb, char *str, int size)
if (retval != 0)
break;
-
}
return (retval);
@@ -3985,7 +3982,6 @@ ctl_expand_number(const char *buf, uint64_t *num)
return (0);
}
-
/*
* This routine could be used in the future to load default and/or saved
* mode page parameters for a particuar lun.
@@ -4002,7 +3998,6 @@ ctl_init_page_index(struct ctl_lun *lun)
sizeof(page_index_template));
for (i = 0; i < CTL_NUM_MODE_PAGES; i++) {
-
page_index = &lun->mode_pages.index[i];
if (lun->be_lun->lun_type == T_DIRECT &&
(page_index->page_flags & CTL_PAGE_FLAG_DIRECT) == 0)
@@ -4415,7 +4410,6 @@ ctl_init_log_page_index(struct ctl_lun *lun)
prev = -1;
for (i = 0, j = 0, k = 0; i < CTL_NUM_LOG_PAGES; i++) {
-
page_index = &lun->log_pages.index[i];
if (lun->be_lun->lun_type == T_DIRECT &&
(page_index->page_flags & CTL_PAGE_FLAG_DIRECT) == 0)
@@ -5279,7 +5273,6 @@ ctl_start_stop(struct ctl_scsiio *ctsio)
residx = ctl_get_initindex(&ctsio->io_hdr.nexus);
if (ctl_get_prkey(lun, residx) == 0 ||
(lun->pr_res_idx != residx && lun->pr_res_type < 4)) {
-
ctl_set_reservation_conflict(ctsio);
ctl_done((union ctl_io *)ctsio);
return (CTL_RETVAL_COMPLETE);
@@ -5996,7 +5989,6 @@ do_next_page:
ctl_done((union ctl_io *)ctsio);
return (CTL_RETVAL_COMPLETE);
} else if (*len_left < sizeof(struct scsi_mode_page_header)) {
-
free(ctsio->kern_data_ptr, M_CTL);
ctl_set_param_len_error(ctsio);
ctl_done((union ctl_io *)ctsio);
@@ -6004,14 +5996,12 @@ do_next_page:
} else if ((page_header->page_code & SMPH_SPF)
&& (*len_left < sizeof(struct scsi_mode_page_header_sp))) {
-
free(ctsio->kern_data_ptr, M_CTL);
ctl_set_param_len_error(ctsio);
ctl_done((union ctl_io *)ctsio);
return (CTL_RETVAL_COMPLETE);
}
-
/*
* XXX KDM should we do something with the block descriptor?
*/
@@ -8191,7 +8181,6 @@ ctl_pro_preempt_other(struct ctl_lun *lun, union ctl_ha_msg *msg)
}
-
int
ctl_persistent_reserve_out(struct ctl_scsiio *ctsio)
{
@@ -8310,7 +8299,6 @@ ctl_persistent_reserve_out(struct ctl_scsiio *ctsio)
switch (cdb->action & SPRO_ACTION_MASK) {
case SPRO_REGISTER:
case SPRO_REG_IGNO: {
-
/*
* We don't support any of these options, as we report in
* the read capabilities request (see
@@ -8397,7 +8385,6 @@ ctl_persistent_reserve_out(struct ctl_scsiio *ctsio)
ctl_ha_msg_send(CTL_HA_CHAN_CTL, &persis_io,
sizeof(persis_io.pr), M_WAITOK);
} else /* sa_res_key != 0 */ {
-
/*
* If we aren't registered currently then increment
* the key count and set the registered flag.
@@ -9497,7 +9484,6 @@ ctl_inquiry_evpd_serial(struct ctl_scsiio *ctsio, int alloc_len)
return (CTL_RETVAL_COMPLETE);
}
-
/*
* SCSI VPD page 0x86, the Extended INQUIRY Data page.
*/
@@ -11586,7 +11572,6 @@ ctl_scsiio_precheck(struct ctl_softc *softc, struct ctl_scsiio *ctsio)
}
}
-
if (ctl_scsiio_lun_check(lun, entry, ctsio) != 0) {
mtx_unlock(&lun->lun_lock);
ctl_done((union ctl_io *)ctsio);
@@ -11925,7 +11910,6 @@ ctl_abort_tasks_lun(struct ctl_lun *lun, uint32_t targ_port, uint32_t init_id,
*/
for (xio = (union ctl_io *)TAILQ_FIRST(&lun->ooa_queue); xio != NULL;
xio = (union ctl_io *)TAILQ_NEXT(&xio->io_hdr, ooa_links)) {
-
if ((targ_port == UINT32_MAX ||
targ_port == xio->io_hdr.nexus.targ_port) &&
(init_id == UINT32_MAX ||
@@ -12077,7 +12061,6 @@ ctl_abort_task(union ctl_io *io)
*/
for (xio = (union ctl_io *)TAILQ_FIRST(&lun->ooa_queue); xio != NULL;
xio = (union ctl_io *)TAILQ_NEXT(&xio->io_hdr, ooa_links)) {
-
if ((xio->io_hdr.nexus.targ_port != io->io_hdr.nexus.targ_port)
|| (xio->io_hdr.nexus.initid != io->io_hdr.nexus.initid)
|| (xio->io_hdr.flags & CTL_FLAG_ABORT))
@@ -12149,7 +12132,6 @@ ctl_query_task(union ctl_io *io, int task_set)
mtx_unlock(&softc->ctl_lock);
for (xio = (union ctl_io *)TAILQ_FIRST(&lun->ooa_queue); xio != NULL;
xio = (union ctl_io *)TAILQ_NEXT(&xio->io_hdr, ooa_links)) {
-
if ((xio->io_hdr.nexus.targ_port != io->io_hdr.nexus.targ_port)
|| (xio->io_hdr.nexus.initid != io->io_hdr.nexus.initid)
|| (xio->io_hdr.flags & CTL_FLAG_ABORT))
@@ -12327,7 +12309,6 @@ ctl_handle_isc(union ctl_io *io)
}
-
/*
* Returns the match type in the case of a match, or CTL_LUN_PAT_NONE if
* there is no match.
@@ -12528,7 +12509,6 @@ ctl_datamove(union ctl_io *io)
lun = CTL_LUN(io);
if ((lun != NULL)
&& (lun->delay_info.datamove_delay > 0)) {
-
callout_init(&io->io_hdr.delay_callout, /*mpsafe*/ 1);
io->io_hdr.flags |= CTL_FLAG_DELAY_DONE;
callout_reset(&io->io_hdr.delay_callout,
@@ -12798,7 +12778,6 @@ ctl_datamove_remote_xfer(union ctl_io *io, unsigned command,
if ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE &&
(io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS) {
-
if (rq != NULL)
ctl_dt_req_free(rq);
@@ -13339,7 +13318,6 @@ ctl_done(union ctl_io *io)
if ((lun != NULL)
&& (lun->delay_info.done_delay > 0)) {
-
callout_init(&io->io_hdr.delay_callout, /*mpsafe*/ 1);
io->io_hdr.flags |= CTL_FLAG_DELAY_DONE;
callout_reset(&io->io_hdr.delay_callout,
diff --git a/sys/cam/ctl/ctl_backend.c b/sys/cam/ctl/ctl_backend.c
index 71d4b001e6e6..b7f154f6bfad 100644
--- a/sys/cam/ctl/ctl_backend.c
+++ b/sys/cam/ctl/ctl_backend.c
@@ -139,4 +139,3 @@ ctl_backend_find(char *backend_name)
return (NULL);
}
-
diff --git a/sys/cam/ctl/ctl_backend.h b/sys/cam/ctl/ctl_backend.h
index 4d75a20f3559..be8ab4d1706b 100644
--- a/sys/cam/ctl/ctl_backend.h
+++ b/sys/cam/ctl/ctl_backend.h
@@ -79,7 +79,6 @@ typedef enum {
MODULE_DEPEND(name, ctl, 1, 1, 1); \
MODULE_DEPEND(name, cam, 1, 1, 1)
-
struct ctl_be_lun;
typedef void (*be_callback_t)(struct ctl_be_lun *be_lun);
diff --git a/sys/cam/ctl/ctl_backend_block.c b/sys/cam/ctl/ctl_backend_block.c
index 643be93d8318..75161bf6ca0c 100644
--- a/sys/cam/ctl/ctl_backend_block.c
+++ b/sys/cam/ctl/ctl_backend_block.c
@@ -1317,7 +1317,6 @@ ctl_be_block_cw_dispatch_ws(struct ctl_be_block_lun *be_lun,
pbo = 0;
len_left = (uint64_t)lbalen->len * cbe_lun->blocksize;
for (i = 0, lba = 0; i < CTLBLK_MAX_SEGS && len_left > 0; i++) {
-
/*
* Setup the S/G entry for this chunk.
*/
@@ -2783,7 +2782,6 @@ ctl_be_block_init(void)
return (0);
}
-
static int
ctl_be_block_shutdown(void)
{
diff --git a/sys/cam/ctl/ctl_cmd_table.c b/sys/cam/ctl/ctl_cmd_table.c
index b3780dcf8c67..0e7268389c3b 100644
--- a/sys/cam/ctl/ctl_cmd_table.c
+++ b/sys/cam/ctl/ctl_cmd_table.c
@@ -738,7 +738,6 @@ const struct ctl_cmd_entry ctl_cmd_table_9b[32] =
/* 1d-1f */
};
-
/* 9E SERVICE ACTION IN(16) */
const struct ctl_cmd_entry ctl_cmd_table_9e[32] =
{
diff --git a/sys/cam/ctl/ctl_frontend_ioctl.c b/sys/cam/ctl/ctl_frontend_ioctl.c
index 0280391242d2..370e553042c5 100644
--- a/sys/cam/ctl/ctl_frontend_ioctl.c
+++ b/sys/cam/ctl/ctl_frontend_ioctl.c
@@ -84,10 +84,8 @@ struct cfi_softc {
TAILQ_HEAD(, cfi_port) ports;
};
-
static struct cfi_softc cfi_softc;
-
static int cfi_init(void);
static int cfi_shutdown(void);
static void cfi_datamove(union ctl_io *io);
@@ -183,7 +181,7 @@ cfi_ioctl_port_create(struct ctl_req *req)
val = dnvlist_get_string(req->args_nvl, "pp", NULL);
if (val != NULL)
pp = strtol(val, NULL, 10);
-
+
val = dnvlist_get_string(req->args_nvl, "vp", NULL);
if (val != NULL)
vp = strtol(val, NULL, 10);
diff --git a/sys/cam/ctl/ctl_frontend_iscsi.c b/sys/cam/ctl/ctl_frontend_iscsi.c
index 82bb4e162a94..0b91d4fd39c1 100644
--- a/sys/cam/ctl/ctl_frontend_iscsi.c
+++ b/sys/cam/ctl/ctl_frontend_iscsi.c
@@ -1183,7 +1183,6 @@ cfiscsi_maintenance_thread(void *arg)
CFISCSI_SESSION_UNLOCK(cs);
if (cs->cs_terminating && cs->cs_handoff_in_progress == false) {
-
/*
* We used to wait up to 30 seconds to deliver queued
* PDUs to the initiator. We also tried hard to deliver
@@ -2137,7 +2136,6 @@ cfiscsi_ioctl_port_create(struct ctl_req *req)
val = dnvlist_get_string(req->args_nvl, "cfiscsi_portal_group_tag",
NULL);
-
if (target == NULL || val == NULL) {
req->status = CTL_LUN_ERROR;
snprintf(req->error_str, sizeof(req->error_str),
diff --git a/sys/cam/ctl/ctl_ha.c b/sys/cam/ctl/ctl_ha.c
index 572bdc40badc..80dfc543303d 100644
--- a/sys/cam/ctl/ctl_ha.c
+++ b/sys/cam/ctl/ctl_ha.c
@@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$");
#include <cam/ctl/ctl_debug.h>
#include <cam/ctl/ctl_error.h>
-
struct ha_msg_wire {
uint32_t channel;
uint32_t length;
@@ -875,7 +874,6 @@ ctl_dt_event_handler(ctl_ha_channel channel, ctl_ha_event event, int param)
}
}
-
ctl_ha_status
ctl_ha_msg_init(struct ctl_softc *ctl_softc)
{
diff --git a/sys/cam/ctl/ctl_io.h b/sys/cam/ctl/ctl_io.h
index 4925c25109bf..6427685f99a8 100644
--- a/sys/cam/ctl/ctl_io.h
+++ b/sys/cam/ctl/ctl_io.h
@@ -112,7 +112,6 @@ typedef enum {
CTL_FLAG_SERSEQ_DONE = 0x20000000 /* All storage I/O started */
} ctl_io_flags;
-
struct ctl_lba_len {
uint64_t lba;
uint32_t len;
@@ -375,7 +374,6 @@ struct ctl_taskio {
uint8_t task_resp[3];/* Response information */
};
-
/*
* HA link messages.
*/
diff --git a/sys/cam/ctl/ctl_scsi_all.c b/sys/cam/ctl/ctl_scsi_all.c
index 8dc59e0a5262..98dba8cf2d83 100644
--- a/sys/cam/ctl/ctl_scsi_all.c
+++ b/sys/cam/ctl/ctl_scsi_all.c
@@ -136,7 +136,6 @@ ctl_scsi_sense_sbuf(struct ctl_scsiio *ctsio,
ctl_scsi_path_string((union ctl_io *)ctsio, path_str, sizeof(path_str));
if (flags & SSS_FLAG_PRINT_COMMAND) {
-
sbuf_cat(sb, path_str);
ctl_scsi_command_string(ctsio, inq_data, sb);
@@ -204,4 +203,3 @@ ctl_scsi_sense_print(struct ctl_scsiio *ctsio,
}
#endif /* _KERNEL */
-
diff --git a/sys/cam/ctl/ctl_ser_table.c b/sys/cam/ctl/ctl_ser_table.c
index 2793bfa1e281..5499e63534fa 100644
--- a/sys/cam/ctl/ctl_ser_table.c
+++ b/sys/cam/ctl/ctl_ser_table.c
@@ -81,4 +81,3 @@ ctl_serialize_table[CTL_SERIDX_COUNT][CTL_SERIDX_COUNT] = {
/*FORMAT */{ pS, bK, bK, bK, bK, bK, bK, pS, pS, bK, bK, bK, bK, bK},
/*START */{ bK, bK, bK, bK, bK, bK, bK, bK, pS, bK, bK, bK, bK, bK},
};
-
diff --git a/sys/cam/ctl/ctl_tpc.c b/sys/cam/ctl/ctl_tpc.c
index 00fb3a52b3d4..456157749c89 100644
--- a/sys/cam/ctl/ctl_tpc.c
+++ b/sys/cam/ctl/ctl_tpc.c
@@ -2472,4 +2472,3 @@ ctl_report_all_rod_tokens(struct ctl_scsiio *ctsio)
ctl_datamove((union ctl_io *)ctsio);
return (retval);
}
-
diff --git a/sys/cam/ctl/ctl_tpc_local.c b/sys/cam/ctl/ctl_tpc_local.c
index f88565db8355..714240fe8228 100644
--- a/sys/cam/ctl/ctl_tpc_local.c
+++ b/sys/cam/ctl/ctl_tpc_local.c
@@ -71,7 +71,6 @@ static int tpcl_shutdown(void);
static void tpcl_datamove(union ctl_io *io);
static void tpcl_done(union ctl_io *io);
-
static struct ctl_frontend tpcl_frontend =
{
.name = "tpc",
diff --git a/sys/cam/ctl/scsi_ctl.c b/sys/cam/ctl/scsi_ctl.c
index 912c4c49245d..569923f9be70 100644
--- a/sys/cam/ctl/scsi_ctl.c
+++ b/sys/cam/ctl/scsi_ctl.c
@@ -383,7 +383,6 @@ ctlfeasync(void *callback_arg, uint32_t code, struct cam_path *path, void *arg)
break;
}
case AC_PATH_DEREGISTERED: {
-
if (softc != NULL) {
/*
* XXX KDM are we certain at this point that there
@@ -463,7 +462,7 @@ ctlferegister(struct cam_periph *periph, void *arg)
softc = (struct ctlfe_lun_softc *)arg;
bus_softc = softc->parent_softc;
-
+
STAILQ_INIT(&softc->work_queue);
LIST_INIT(&softc->atio_list);
LIST_INIT(&softc->inot_list);
@@ -1116,7 +1115,6 @@ ctlfedone(struct cam_periph *periph, union ccb *done_ccb)
switch (done_ccb->ccb_h.func_code) {
case XPT_ACCEPT_TARGET_IO: {
-
LIST_REMOVE(&done_ccb->ccb_h, periph_links.le);
atio = &done_ccb->atio;
status = atio->ccb_h.status & CAM_STATUS_MASK;