Date: Tue, 1 Sep 2020 22:13:49 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365225 - in head/sys/cam: . ata ctl mmc nvme scsi Message-ID: <202009012213.081MDnJj062982@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Tue Sep 1 22:13:48 2020 New Revision: 365225 URL: https://svnweb.freebsd.org/changeset/base/365225 Log: cam: clean up empty lines in .c and .h files Modified: head/sys/cam/ata/ata_all.c head/sys/cam/ata/ata_da.c head/sys/cam/ata/ata_pmp.c head/sys/cam/cam.c head/sys/cam/cam.h head/sys/cam/cam_ccb.h head/sys/cam/cam_compat.c head/sys/cam/cam_compat.h head/sys/cam/cam_iosched.c head/sys/cam/cam_periph.c head/sys/cam/cam_queue.c head/sys/cam/cam_queue.h head/sys/cam/cam_sim.h head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt.h head/sys/cam/cam_xpt_internal.h head/sys/cam/cam_xpt_sim.h head/sys/cam/ctl/README.ctl.txt head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_backend.c head/sys/cam/ctl/ctl_backend.h head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_cmd_table.c head/sys/cam/ctl/ctl_frontend_ioctl.c head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/cam/ctl/ctl_ha.c head/sys/cam/ctl/ctl_io.h head/sys/cam/ctl/ctl_scsi_all.c head/sys/cam/ctl/ctl_ser_table.c head/sys/cam/ctl/ctl_tpc.c head/sys/cam/ctl/ctl_tpc_local.c head/sys/cam/ctl/scsi_ctl.c head/sys/cam/mmc/mmc_da.c head/sys/cam/mmc/mmc_xpt.c head/sys/cam/nvme/nvme_all.c head/sys/cam/nvme/nvme_da.c head/sys/cam/nvme/nvme_xpt.c head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_cd.h head/sys/cam/scsi/scsi_ch.c head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_da.h head/sys/cam/scsi/scsi_enc.c head/sys/cam/scsi/scsi_enc_safte.c head/sys/cam/scsi/scsi_enc_ses.c head/sys/cam/scsi/scsi_message.h head/sys/cam/scsi/scsi_pass.c head/sys/cam/scsi/scsi_pt.c head/sys/cam/scsi/scsi_sa.c head/sys/cam/scsi/scsi_sa.h head/sys/cam/scsi/scsi_ses.h head/sys/cam/scsi/scsi_sg.c head/sys/cam/scsi/scsi_targ_bh.c head/sys/cam/scsi/scsi_target.c head/sys/cam/scsi/scsi_xpt.c head/sys/cam/scsi/smp_all.c Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/ata/ata_all.c Tue Sep 1 22:13:48 2020 (r365225) @@ -920,7 +920,6 @@ ata_string2mode(char *str) return (-1); } - u_int ata_mode2speed(int mode) { @@ -995,7 +994,7 @@ ata_identify_match(caddr_t identbuffer, caddr_t table_ { struct scsi_inquiry_pattern *entry; struct ata_params *ident; - + entry = (struct scsi_inquiry_pattern *)table_entry; ident = (struct ata_params *)identbuffer; @@ -1013,7 +1012,7 @@ ata_static_identify_match(caddr_t identbuffer, caddr_t { struct scsi_static_inquiry_pattern *entry; struct ata_params *ident; - + entry = (struct scsi_static_inquiry_pattern *)table_entry; ident = (struct ata_params *)identbuffer; @@ -1107,7 +1106,6 @@ semb_write_buffer(struct ccb_ataio *ataio, ata_28bit_cmd(ataio, ATA_SEP_ATTN, length > 0 ? data_ptr[0] : 0, 0x80, length / 4); } - void ata_zac_mgmt_out(struct ccb_ataio *ataio, uint32_t retries, Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/ata/ata_da.c Tue Sep 1 22:13:48 2020 (r365225) @@ -211,7 +211,6 @@ static struct ada_zone_desc { {ADA_ZONE_FLAG_RWP_SUP, "Reset Write Pointer" }, }; - /* Offsets into our private area for storing information */ #define ccb_state ppriv_field0 #define ccb_bp ppriv_ptr1 @@ -1009,7 +1008,6 @@ adaclose(struct disk *dp) (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) != 0 && (periph->flags & CAM_PERIPH_INVALID) == 0 && cam_periph_hold(periph, PRIBIO) == 0) { - ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); cam_fill_ataio(&ccb->ataio, 1, @@ -1198,7 +1196,6 @@ adainit(void) printf("ada: Failed to attach master async callback " "due to status 0x%x!\n", status); } else if (ada_send_ordered) { - /* Register our event handlers */ if ((EVENTHANDLER_REGISTER(power_suspend, adasuspend, NULL, EVENTHANDLER_PRI_LAST)) == NULL) @@ -1462,7 +1459,6 @@ adazonesupsysctl(SYSCTL_HANDLER_ARGS) return (error); } - static void adasysctlinit(void *context, int pending) { @@ -2573,7 +2569,6 @@ out: break; } - ata_read_log(ataio, /*retries*/1, /*cbfcnp*/adadone, @@ -2838,7 +2833,6 @@ adazonedone(struct cam_periph *periph, union ccb *ccb) free(ccb->ataio.data_ptr, M_ATADA); } - static void adadone(struct cam_periph *periph, union ccb *done_ccb) { @@ -3082,8 +3076,6 @@ adadone(struct cam_periph *periph, union ccb *done_ccb /*getcount_only*/0); } } - - } free(ataio->data_ptr, M_ATADA); Modified: head/sys/cam/ata/ata_pmp.c ============================================================================== --- head/sys/cam/ata/ata_pmp.c Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/ata/ata_pmp.c Tue Sep 1 22:13:48 2020 (r365225) @@ -274,7 +274,7 @@ pmpasync(void *callback_arg, u_int32_t code, { struct ccb_getdev *cgd; cam_status status; - + cgd = (struct ccb_getdev *)arg; if (cgd == NULL) break; Modified: head/sys/cam/cam.c ============================================================================== --- head/sys/cam/cam.c Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/cam.c Tue Sep 1 22:13:48 2020 (r365225) @@ -206,7 +206,6 @@ cam_strvis_sbuf(struct sbuf *sb, const u_int8_t *src, } } - /* * Compare string with pattern, returning 0 on match. * Short pattern matches trailing blanks in name, @@ -330,7 +329,6 @@ camstatusentrycomp(const void *key, const void *member return (status - table_entry->status_code); } - #ifdef _KERNEL char * cam_error_string(union ccb *ccb, char *str, int str_len, @@ -493,7 +491,6 @@ cam_error_string(struct cam_device *device, union ccb if ((proto_flags & CAM_ESF_PRINT_SENSE) && (ccb->csio.scsi_status == SCSI_STATUS_CHECK_COND) && (ccb->ccb_h.status & CAM_AUTOSNS_VALID)) { - #ifdef _KERNEL scsi_sense_sbuf(&ccb->csio, &sb, SSS_FLAG_NONE); Modified: head/sys/cam/cam.h ============================================================================== --- head/sys/cam/cam.h Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/cam.h Tue Sep 1 22:13:48 2020 (r365225) @@ -278,7 +278,6 @@ typedef enum { /* SCSI Bus Busy */ CAM_SCSI_BUSY = 0x3f, - /* * Flags */ @@ -304,7 +303,7 @@ typedef enum { /* * Target Specific Adjunct Status */ - + /* sent sense with status */ CAM_SENT_SENSE = 0x40000000 } cam_status; Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/cam_ccb.h Tue Sep 1 22:13:48 2020 (r365225) @@ -1111,7 +1111,6 @@ struct ccb_trans_settings { } xport_specific; }; - /* * Calculate the geometry parameters for a device * give the block size and volume size in blocks. @@ -1131,7 +1130,6 @@ struct ccb_calc_geometry { #define KNOB_VALID_ADDRESS 0x1 #define KNOB_VALID_ROLE 0x2 - #define KNOB_ROLE_NONE 0x0 #define KNOB_ROLE_INITIATOR 0x1 Modified: head/sys/cam/cam_compat.c ============================================================================== --- head/sys/cam/cam_compat.c Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/cam_compat.c Tue Sep 1 22:13:48 2020 (r365225) @@ -373,7 +373,7 @@ cam_compat_translate_dev_match_0x18(union ccb *ccb) dm = ccb->cdm.matches; /* Translate in-place: old fields are smaller */ dm18 = (struct dev_match_result_0x18 *)(dm); - + for (i = 0; i < ccb->cdm.num_matches; i++) { dm18[i].type = dm[i].type; switch (dm[i].type) { @@ -420,4 +420,3 @@ cam_compat_translate_dev_match_0x18(union ccb *ccb) return (0); } - Modified: head/sys/cam/cam_compat.h ============================================================================== --- head/sys/cam/cam_compat.h Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/cam_compat.h Tue Sep 1 22:13:48 2020 (r365225) @@ -40,7 +40,6 @@ int cam_compat_ioctl(struct cdev *dev, u_long cmd, cad struct thread *td, int(*cbfnp)(struct cdev *, u_long, caddr_t, int, struct thread *)); - /* Version 0x16 compatibility */ #define CAM_VERSION_0x16 0x16 Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/cam_iosched.c Tue Sep 1 22:13:48 2020 (r365225) @@ -241,7 +241,6 @@ struct iop_stats { struct cam_iosched_softc *softc; }; - typedef enum { set_max = 0, /* current = max */ read_latency, /* Steer read latency by throttling writes */ @@ -456,7 +455,6 @@ cam_iosched_iops_tick(struct iop_stats *ios) ios->l_value1 += new_ios; } - return 0; } @@ -542,7 +540,6 @@ cam_iosched_bw_caniop(struct iop_stats *ios, struct bi if (ios->current > 0 && ios->l_value1 <= 0) return EAGAIN; - return 0; } @@ -615,7 +612,6 @@ cam_iosched_ticker(void *arg) isc->total_ticks++; } - static void cam_iosched_cl_init(struct control_loop *clp, struct cam_iosched_softc *isc) { @@ -790,7 +786,6 @@ cam_iosched_has_more_trim(struct cam_iosched_softc *is #define cam_iosched_sort_queue(isc) ((isc)->sort_io_queue >= 0 ? \ (isc)->sort_io_queue : cam_sort_io_queues) - static inline bool cam_iosched_has_work(struct cam_iosched_softc *isc) Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/cam_periph.c Tue Sep 1 22:13:48 2020 (r365225) @@ -217,7 +217,6 @@ cam_periph_alloc(periph_ctor_t *periph_ctor, * handler. If it looks like a mistaken re-allocation, complain. */ if ((periph = cam_periph_find(path, name)) != NULL) { - if ((periph->flags & CAM_PERIPH_INVALID) != 0 && (periph->flags & CAM_PERIPH_NEW_DEV_FOUND) == 0) { periph->flags |= CAM_PERIPH_NEW_DEV_FOUND; @@ -233,16 +232,15 @@ cam_periph_alloc(periph_ctor_t *periph_ctor, } return (CAM_REQ_INVALID); } - + periph = (struct cam_periph *)malloc(sizeof(*periph), M_CAMPERIPH, M_NOWAIT|M_ZERO); if (periph == NULL) return (CAM_RESRC_UNAVAIL); - + init_level++; - sim = xpt_path_sim(path); path_id = xpt_path_path_id(path); target_id = xpt_path_target_id(path); @@ -342,7 +340,6 @@ cam_periph_find(struct cam_path *path, char *name) xpt_lock_buses(); for (p_drv = periph_drivers; *p_drv != NULL; p_drv++) { - if (name != NULL && (strcmp((*p_drv)->driver_name, name) != 0)) continue; @@ -380,7 +377,6 @@ retry: count = 0; xpt_lock_buses(); for (p_drv = periph_drivers; *p_drv != NULL; p_drv++) { - TAILQ_FOREACH(periph, &(*p_drv)->units, unit_links) { if (xpt_path_comp(periph->path, path) != 0) continue; @@ -468,7 +464,7 @@ cam_periph_release(struct cam_periph *periph) if (periph == NULL) return; - + cam_periph_assert(periph, MA_NOTOWNED); mtx = cam_periph_mtx(periph); mtx_lock(mtx); @@ -549,7 +545,6 @@ camperiphnextunit(struct periph_driver *p_drv, u_int n periph_name = p_drv->driver_name; for (;;newunit++) { - for (periph = TAILQ_FIRST(&p_drv->units); periph != NULL && periph->unit_number != newunit; periph = TAILQ_NEXT(periph, unit_links)) @@ -930,7 +925,6 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_ma PHOLD(curproc); for (i = 0; i < numbufs; i++) { - /* Save the user's data address. */ mapinfo->orig[i] = *data_ptrs[i]; @@ -1146,7 +1140,6 @@ cam_periph_ioctl(struct cam_periph *periph, u_long cmd ccb->cgdl.index = 0; ccb->cgdl.status = CAM_GDEVLIST_MORE_DEVS; while (ccb->cgdl.status == CAM_GDEVLIST_MORE_DEVS) { - /* we want the next device in the list */ xpt_action(ccb); if (strncmp(ccb->cgdl.periph_name, @@ -2032,7 +2025,6 @@ cam_periph_error(union ccb *ccb, cam_flags camflags, xpt_path_path_id(ccb->ccb_h.path), xpt_path_target_id(ccb->ccb_h.path), lun_id) == CAM_REQ_CMP) { - /* * Let peripheral drivers know that this * device has gone away. @@ -2052,7 +2044,6 @@ cam_periph_error(union ccb *ccb, cam_flags camflags, xpt_path_path_id(ccb->ccb_h.path), xpt_path_target_id(ccb->ccb_h.path), CAM_LUN_WILDCARD) == CAM_REQ_CMP) { - scan_ccb = xpt_alloc_ccb_nowait(); if (scan_ccb != NULL) { scan_ccb->ccb_h.path = newpath; Modified: head/sys/cam/cam_queue.c ============================================================================== --- head/sys/cam/cam_queue.c Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/cam_queue.c Tue Sep 1 22:13:48 2020 (r365225) @@ -251,7 +251,7 @@ cam_ccbq_alloc(int openings) free(ccbq, M_CAMCCBQ); return (NULL); } - + return (ccbq); } @@ -348,7 +348,6 @@ heap_up(cam_pinfo **queue_array, int new_index) child = new_index; while (child != 1) { - parent = child >> 1; if (queue_cmp(queue_array, parent, child) <= 0) break; @@ -367,11 +366,10 @@ heap_down(cam_pinfo **queue_array, int index, int num_ { int child; int parent; - + parent = index; child = parent << 1; for (; child <= num_entries; child = parent << 1) { - if (child < num_entries) { /* child+1 is the right child of parent */ if (queue_cmp(queue_array, child + 1, child) < 0) Modified: head/sys/cam/cam_queue.h ============================================================================== --- head/sys/cam/cam_queue.h Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/cam_queue.h Tue Sep 1 22:13:48 2020 (r365225) @@ -78,7 +78,6 @@ struct cam_devq { int send_active; }; - struct cam_devq *cam_devq_alloc(int devices, int openings); int cam_devq_init(struct cam_devq *devq, int devices, @@ -87,7 +86,7 @@ int cam_devq_init(struct cam_devq *devq, int devices void cam_devq_free(struct cam_devq *devq); u_int32_t cam_devq_resize(struct cam_devq *camq, int openings); - + /* * Allocate a cam_ccb_queue structure and initialize it. */ @@ -166,7 +165,6 @@ cam_ccbq_ccb_done(struct cam_ccbq *ccbq, union ccb *do static __inline void cam_ccbq_release_opening(struct cam_ccbq *ccbq); - static __inline int cam_ccbq_pending_ccb_count(struct cam_ccbq *ccbq) Modified: head/sys/cam/cam_sim.h ============================================================================== --- head/sys/cam/cam_sim.h Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/cam_sim.h Tue Sep 1 22:13:48 2020 (r365225) @@ -78,7 +78,6 @@ void cam_sim_release(struct cam_sim *sim); /* Optional sim attributes may be set with these. */ void cam_sim_set_path(struct cam_sim *sim, u_int32_t path_id); - /* Generically useful offsets into the sim private area */ #define spriv_ptr0 sim_priv.entries[0].ptr #define spriv_ptr1 sim_priv.entries[1].ptr Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/cam_xpt.c Tue Sep 1 22:13:48 2020 (r365225) @@ -234,7 +234,6 @@ static int xpt_init(void *); DECLARE_MODULE(cam, cam_moduledata, SI_SUB_CONFIGURE, SI_ORDER_SECOND); MODULE_VERSION(cam, 1); - static void xpt_async_bcast(struct async_list *async_head, u_int32_t async_code, struct cam_path *path, @@ -519,7 +518,6 @@ xptdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, bcopy(&ccb, inccb, sizeof(union ccb)); xpt_free_path(ccb.ccb_h.path); break; - } case XPT_DEV_MATCH: { struct cam_periph_map_info mapinfo; @@ -651,7 +649,6 @@ xptdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, */ for (periph = TAILQ_FIRST(&(*p_drv)->units); periph != NULL; periph = TAILQ_NEXT(periph, unit_links)) { - if (periph->unit_number == unit) break; } @@ -1036,7 +1033,6 @@ xpt_remove_periph(struct cam_periph *periph) } } - void xpt_announce_periph(struct cam_periph *periph, char *announce_string) { @@ -2675,7 +2671,6 @@ xpt_action_default(union ccb *start_ccb) if (device->protocol_version <= SCSI_REV_2 && start_ccb->ccb_h.target_lun < 8 && (start_ccb->ccb_h.flags & CAM_CDB_POINTER) == 0) { - start_ccb->csio.cdb_io.cdb_bytes[1] |= start_ccb->ccb_h.target_lun << 5; } @@ -2863,7 +2858,6 @@ call_sim: struct cam_ed *device; int found; - found = 0; /* @@ -3041,13 +3035,11 @@ call_sim: crs = &start_ccb->crs; dev = path->device; if (dev == NULL) { - crs->ccb_h.status = CAM_DEV_NOT_THERE; break; } if ((crs->release_flags & RELSIM_ADJUST_OPENINGS) != 0) { - /* Don't ever go below one opening */ if (crs->openings > 0) { xpt_dev_ccbq_resize(path, crs->openings); @@ -3061,9 +3053,7 @@ call_sim: mtx_lock(&dev->sim->devq->send_mtx); if ((crs->release_flags & RELSIM_RELEASE_AFTER_TIMEOUT) != 0) { - if ((dev->flags & CAM_DEV_REL_TIMEOUT_PENDING) != 0) { - /* * Just extend the old timeout and decrement * the freeze count so that a single timeout @@ -3072,7 +3062,6 @@ call_sim: start_ccb->ccb_h.flags &= ~CAM_DEV_QFREEZE; callout_stop(&dev->callout); } else { - start_ccb->ccb_h.flags |= CAM_DEV_QFREEZE; } @@ -3081,11 +3070,9 @@ call_sim: xpt_release_devq_timeout, dev, 0); dev->flags |= CAM_DEV_REL_TIMEOUT_PENDING; - } if ((crs->release_flags & RELSIM_RELEASE_AFTER_CMDCMPLT) != 0) { - if ((dev->flags & CAM_DEV_REL_ON_COMPLETE) != 0) { /* * Decrement the freeze count so that a single @@ -3094,20 +3081,16 @@ call_sim: */ start_ccb->ccb_h.flags &= ~CAM_DEV_QFREEZE; } else { - dev->flags |= CAM_DEV_REL_ON_COMPLETE; start_ccb->ccb_h.flags |= CAM_DEV_QFREEZE; } } if ((crs->release_flags & RELSIM_RELEASE_AFTER_QEMPTY) != 0) { - if ((dev->flags & CAM_DEV_REL_ON_QUEUE_EMPTY) != 0 || (dev->ccbq.dev_active == 0)) { - start_ccb->ccb_h.flags &= ~CAM_DEV_QFREEZE; } else { - dev->flags |= CAM_DEV_REL_ON_QUEUE_EMPTY; start_ccb->ccb_h.flags |= CAM_DEV_QFREEZE; } @@ -3300,7 +3283,6 @@ xpt_schedule(struct cam_periph *periph, u_int32_t new_ } } - /* * Schedule a device to run on a given queue. * If the device was inserted as a new entry on the queue, @@ -3318,7 +3300,6 @@ xpt_schedule_dev(struct camq *queue, cam_pinfo *pinfo, CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_schedule_dev\n")); - old_priority = pinfo->priority; /* @@ -3381,7 +3362,6 @@ restart: periph->immediate_priority)) != CAM_PRIORITY_NONE && (periph->periph_allocated - (ccb != NULL ? 1 : 0) < device->ccbq.total_openings || prio <= CAM_PRIORITY_OOB)) { - if (ccb == NULL && (ccb = xpt_get_ccb_nowait(periph)) == NULL) { if (sleep) { @@ -3446,7 +3426,6 @@ xpt_run_devq(struct cam_devq *devq) } if ((work_ccb->ccb_h.flags & CAM_HIGH_POWER) != 0) { - mtx_lock(&xsoftc.xpt_highpower_lock); if (xsoftc.num_highpower <= 0) { /* @@ -4090,7 +4069,6 @@ xpt_bus_register(struct cam_sim *sim, device_t parent, /* Notify interested parties */ if (sim->path_id != CAM_XPT_PATH_ID) { - xpt_async(AC_PATH_REGISTERED, path, &cpi); if ((cpi.hba_misc & PIM_NOSCAN) == 0) { union ccb *scan_ccb; @@ -4692,8 +4670,6 @@ xpt_free_ccb(union ccb *free_ccb) free(free_ccb, M_CAMCCB); } - - /* Private XPT functions */ /* @@ -5399,7 +5375,6 @@ xpt_done_process(struct ccb_hdr *ccb_h) * Any high powered commands queued up? */ if (device != NULL) { - STAILQ_REMOVE_HEAD(hphead, highpowerq_entry); mtx_unlock(&xsoftc.xpt_highpower_lock); Modified: head/sys/cam/cam_xpt.h ============================================================================== --- head/sys/cam/cam_xpt.h Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/cam_xpt.h Tue Sep 1 22:13:48 2020 (r365225) @@ -39,7 +39,6 @@ #include <cam/cam_ccb.h> #endif - /* Forward Declarations */ union ccb; struct cam_periph; Modified: head/sys/cam/cam_xpt_internal.h ============================================================================== --- head/sys/cam/cam_xpt_internal.h Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/cam_xpt_internal.h Tue Sep 1 22:13:48 2020 (r365225) @@ -92,7 +92,6 @@ SET_DECLARE(cam_xpt_proto_set, struct xpt_proto); #define CAM_XPT_PROTO(data) \ DATA_SET(cam_xpt_proto_set, data) - /* * The CAM EDT (Existing Device Table) contains the device information for * all devices for all buses in the system. The table contains a Modified: head/sys/cam/cam_xpt_sim.h ============================================================================== --- head/sys/cam/cam_xpt_sim.h Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/cam_xpt_sim.h Tue Sep 1 22:13:48 2020 (r365225) @@ -52,4 +52,3 @@ void xpt_done_direct(union ccb *done_ccb); #endif #endif /* _CAM_CAM_XPT_SIM_H */ - Modified: head/sys/cam/ctl/README.ctl.txt ============================================================================== --- head/sys/cam/ctl/README.ctl.txt Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/ctl/README.ctl.txt Tue Sep 1 22:13:48 2020 (r365225) @@ -162,7 +162,6 @@ LUN Backend Size (Blocks) BS Serial Number 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.) Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/ctl/ctl.c Tue Sep 1 22:13:48 2020 (r365225) @@ -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 si 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_h } - 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 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 ct } } - 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 */ 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 co 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, Modified: head/sys/cam/ctl/ctl_backend.c ============================================================================== --- head/sys/cam/ctl/ctl_backend.c Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/ctl/ctl_backend.c Tue Sep 1 22:13:48 2020 (r365225) @@ -139,4 +139,3 @@ ctl_backend_find(char *backend_name) return (NULL); } - Modified: head/sys/cam/ctl/ctl_backend.h ============================================================================== --- head/sys/cam/ctl/ctl_backend.h Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/ctl/ctl_backend.h Tue Sep 1 22:13:48 2020 (r365225) @@ -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); Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/ctl/ctl_backend_block.c Tue Sep 1 22:13:48 2020 (r365225) @@ -1317,7 +1317,6 @@ ctl_be_block_cw_dispatch_ws(struct ctl_be_block_lun *b 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. */ @@ -2782,7 +2781,6 @@ ctl_be_block_init(void) SLIST_INIT(&softc->lun_list); return (0); } - static int ctl_be_block_shutdown(void) Modified: head/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- head/sys/cam/ctl/ctl_cmd_table.c Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/ctl/ctl_cmd_table.c Tue Sep 1 22:13:48 2020 (r365225) @@ -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] = { Modified: head/sys/cam/ctl/ctl_frontend_ioctl.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_ioctl.c Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/ctl/ctl_frontend_ioctl.c Tue Sep 1 22:13:48 2020 (r365225) @@ -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); Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Tue Sep 1 22:13:48 2020 (r365225) @@ -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 @@ -2136,7 +2135,6 @@ cfiscsi_ioctl_port_create(struct ctl_req *req) alias = dnvlist_get_string(req->args_nvl, "cfiscsi_target_alias", NULL); val = dnvlist_get_string(req->args_nvl, "cfiscsi_portal_group_tag", NULL); - if (target == NULL || val == NULL) { req->status = CTL_LUN_ERROR; Modified: head/sys/cam/ctl/ctl_ha.c ============================================================================== --- head/sys/cam/ctl/ctl_ha.c Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/ctl/ctl_ha.c Tue Sep 1 22:13:48 2020 (r365225) @@ -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; @@ -874,7 +873,6 @@ ctl_dt_event_handler(ctl_ha_channel channel, ctl_ha_ev printf("%s: Unknown event %d\n", __func__, event); } } - ctl_ha_status ctl_ha_msg_init(struct ctl_softc *ctl_softc) Modified: head/sys/cam/ctl/ctl_io.h ============================================================================== --- head/sys/cam/ctl/ctl_io.h Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/ctl/ctl_io.h Tue Sep 1 22:13:48 2020 (r365225) @@ -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; @@ -374,7 +373,6 @@ struct ctl_taskio { uint8_t task_status; /* Complete, Succeeded, etc. */ uint8_t task_resp[3];/* Response information */ }; - /* * HA link messages. Modified: head/sys/cam/ctl/ctl_scsi_all.c ============================================================================== --- head/sys/cam/ctl/ctl_scsi_all.c Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/ctl/ctl_scsi_all.c Tue Sep 1 22:13:48 2020 (r365225) @@ -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 */ - Modified: head/sys/cam/ctl/ctl_ser_table.c ============================================================================== --- head/sys/cam/ctl/ctl_ser_table.c Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/ctl/ctl_ser_table.c Tue Sep 1 22:13:48 2020 (r365225) @@ -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}, }; - Modified: head/sys/cam/ctl/ctl_tpc.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc.c Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/ctl/ctl_tpc.c Tue Sep 1 22:13:48 2020 (r365225) @@ -2472,4 +2472,3 @@ ctl_report_all_rod_tokens(struct ctl_scsiio *ctsio) ctl_datamove((union ctl_io *)ctsio); return (retval); } - Modified: head/sys/cam/ctl/ctl_tpc_local.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc_local.c Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/ctl/ctl_tpc_local.c Tue Sep 1 22:13:48 2020 (r365225) @@ -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", Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/ctl/scsi_ctl.c Tue Sep 1 22:13:48 2020 (r365225) @@ -383,7 +383,6 @@ ctlfeasync(void *callback_arg, uint32_t code, struct c 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_c 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; Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Tue Sep 1 22:13:28 2020 (r365224) +++ head/sys/cam/mmc/mmc_da.c Tue Sep 1 22:13:48 2020 (r365225) @@ -75,7 +75,6 @@ __FBSDID("$FreeBSD$"); #include <cam/cam_xpt_internal.h> #include <cam/cam_debug.h> - #include <cam/mmc/mmc_all.h> #ifdef _KERNEL @@ -268,7 +267,6 @@ mmc_handle_reply(union ccb *ccb) return (0); /* Normal return */ } - static uint32_t mmc_get_bits(uint32_t *bits, int bit_len, int start, int size) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009012213.081MDnJj062982>