diff --git a/iscsi-scst/kernel/iscsi.c b/iscsi-scst/kernel/iscsi.c index e4dc6671f..1aa65f15e 100644 --- a/iscsi-scst/kernel/iscsi.c +++ b/iscsi-scst/kernel/iscsi.c @@ -125,7 +125,7 @@ static inline int cmnd_read_size(struct iscsi_cmnd *cmnd) ahdr = (struct iscsi_ahs_hdr *)cmnd->pdu.ahs; if (ahdr) { - uint8_t *p = (uint8_t *)ahdr; + u8 *p = (u8 *)ahdr; unsigned int size = 0; do { @@ -1993,7 +1993,7 @@ static int scsi_cmnd_start(struct iscsi_cmnd *req) EXTRACHECKS_BUG_ON(!session->scst_sess); - scst_cmd = scst_rx_cmd(session->scst_sess, (uint8_t *)&req_hdr->lun, sizeof(req_hdr->lun), + scst_cmd = scst_rx_cmd(session->scst_sess, (u8 *)&req_hdr->lun, sizeof(req_hdr->lun), req_hdr->scb, sizeof(req_hdr->scb), SCST_NON_ATOMIC); if (!scst_cmd) { res = create_preliminary_no_scst_rsp(req, SAM_STAT_BUSY, NULL, 0); @@ -2060,7 +2060,7 @@ static int scsi_cmnd_start(struct iscsi_cmnd *req) ahdr = (struct iscsi_ahs_hdr *)req->pdu.ahs; if (ahdr) { - uint8_t *p = (uint8_t *)ahdr; + u8 *p = (u8 *)ahdr; unsigned int size = 0; do { @@ -2600,7 +2600,7 @@ static void execute_task_management(struct iscsi_cmnd *req) params.fn = SCST_ABORT_TASK; params.tag = (__force u32)req_hdr->rtt; params.tag_set = 1; - params.lun = (uint8_t *)&req_hdr->lun; + params.lun = (u8 *)&req_hdr->lun; params.lun_len = sizeof(req_hdr->lun); params.lun_set = 1; params.cmd_sn = req_hdr->cmd_sn; @@ -2611,7 +2611,7 @@ static void execute_task_management(struct iscsi_cmnd *req) break; case ISCSI_FUNCTION_ABORT_TASK_SET: params.fn = SCST_ABORT_TASK_SET; - params.lun = (uint8_t *)&req_hdr->lun; + params.lun = (u8 *)&req_hdr->lun; params.lun_len = sizeof(req_hdr->lun); params.lun_set = 1; params.cmd_sn = req_hdr->cmd_sn; @@ -2621,7 +2621,7 @@ static void execute_task_management(struct iscsi_cmnd *req) break; case ISCSI_FUNCTION_CLEAR_TASK_SET: params.fn = SCST_CLEAR_TASK_SET; - params.lun = (uint8_t *)&req_hdr->lun; + params.lun = (u8 *)&req_hdr->lun; params.lun_len = sizeof(req_hdr->lun); params.lun_set = 1; params.cmd_sn = req_hdr->cmd_sn; @@ -2631,7 +2631,7 @@ static void execute_task_management(struct iscsi_cmnd *req) break; case ISCSI_FUNCTION_CLEAR_ACA: params.fn = SCST_CLEAR_ACA; - params.lun = (uint8_t *)&req_hdr->lun; + params.lun = (u8 *)&req_hdr->lun; params.lun_len = sizeof(req_hdr->lun); params.lun_set = 1; params.cmd_sn = req_hdr->cmd_sn; @@ -2649,7 +2649,7 @@ static void execute_task_management(struct iscsi_cmnd *req) break; case ISCSI_FUNCTION_LOGICAL_UNIT_RESET: params.fn = SCST_LUN_RESET; - params.lun = (uint8_t *)&req_hdr->lun; + params.lun = (u8 *)&req_hdr->lun; params.lun_len = sizeof(req_hdr->lun); params.lun_set = 1; params.cmd_sn = req_hdr->cmd_sn; @@ -3671,7 +3671,7 @@ static int iscsi_scsi_aen(struct scst_aen *aen) { int res = SCST_AEN_RES_SUCCESS; __be64 lun = scst_aen_get_lun(aen); - const uint8_t *sense = scst_aen_get_sense(aen); + const u8 *sense = scst_aen_get_sense(aen); int sense_len = scst_aen_get_sense_len(aen); struct iscsi_session *sess = scst_sess_get_tgt_priv(scst_aen_get_sess(aen)); struct iscsi_conn *conn; @@ -3797,13 +3797,13 @@ static int iscsi_report_aen(struct scst_aen *aen) static int iscsi_get_initiator_port_transport_id(struct scst_tgt *tgt, struct scst_session *scst_sess, - uint8_t **transport_id) + u8 **transport_id) { struct iscsi_session *sess; int res = 0; union iscsi_sid sid; int tr_id_size; - uint8_t *tr_id; + u8 *tr_id; TRACE_ENTRY(); @@ -3933,7 +3933,7 @@ static struct scst_trace_log iscsi_local_trace_tbl[] = { #define ISCSI_TRACE_TBL_HELP ", d_write, conn, conn_dbg, iov, pdu, net_page" #endif -static uint16_t iscsi_get_scsi_transport_version(struct scst_tgt *scst_tgt) +static u16 iscsi_get_scsi_transport_version(struct scst_tgt *scst_tgt) { return 0x0960; /* iSCSI */ } diff --git a/iscsi-scst/kernel/iscsi.h b/iscsi-scst/kernel/iscsi.h index ecdeb691d..028ff2eb1 100644 --- a/iscsi-scst/kernel/iscsi.h +++ b/iscsi-scst/kernel/iscsi.h @@ -294,7 +294,7 @@ struct iscsi_conn { struct iovec *read_iov; #endif struct task_struct *rx_task; - uint32_t rpadding; + u32 rpadding; struct iscsi_target *target; @@ -577,7 +577,7 @@ extern const struct attribute *iscsi_tgt_attrs[]; int iscsi_enable_target(struct scst_tgt *scst_tgt, bool enable); bool iscsi_is_target_enabled(struct scst_tgt *scst_tgt); -ssize_t iscsi_sysfs_send_event(uint32_t tid, enum iscsi_kern_event_code code, const char *param1, +ssize_t iscsi_sysfs_send_event(u32 tid, enum iscsi_kern_event_code code, const char *param1, const char *param2, void **data); struct iscsi_target *target_lookup_by_id(u32 id); int __add_target(struct iscsi_kern_target_info *info); diff --git a/iscsi-scst/kernel/nthread.c b/iscsi-scst/kernel/nthread.c index 418696875..4d17ad0ff 100644 --- a/iscsi-scst/kernel/nthread.c +++ b/iscsi-scst/kernel/nthread.c @@ -230,8 +230,8 @@ static void close_conn(struct iscsi_conn *conn) typeof(jiffies) start_waiting = jiffies; typeof(jiffies) shut_start_waiting = start_waiting; bool pending_reported = 0, wait_expired = 0, shut_expired = 0; - uint32_t tid, cid; - uint64_t sid; + u32 tid, cid; + u64 sid; int rc; int lun = 0; @@ -1390,10 +1390,10 @@ static int tx_padding(struct iscsi_cmnd *cmnd, int state) int res, rest = cmnd->conn->write_size; struct msghdr msg = {.msg_flags = MSG_NOSIGNAL | MSG_DONTWAIT}; struct kvec iov; - static const uint32_t padding; + static const u32 padding; BUG_ON(rest < 1); - BUG_ON(rest >= sizeof(uint32_t)); + BUG_ON(rest >= sizeof(u32)); iscsi_extracheck_is_wr_thread(cmnd->conn); TRACE_DBG("Sending %d padding bytes (cmd %p)", rest, cmnd); diff --git a/iscsi-scst/kernel/param.c b/iscsi-scst/kernel/param.c index b8504b260..00c1f5d93 100644 --- a/iscsi-scst/kernel/param.c +++ b/iscsi-scst/kernel/param.c @@ -113,7 +113,7 @@ static void log_params(struct iscsi_sess_params *params) /* target_mutex supposed to be locked */ static void sess_params_check(struct iscsi_kern_params_info *info) { - int32_t *iparams = info->session_params; + s32 *iparams = info->session_params; const int max_len = ISCSI_CONN_IOV_MAX * PAGE_SIZE; /* @@ -148,7 +148,7 @@ static void sess_params_check(struct iscsi_kern_params_info *info) /* target_mutex supposed to be locked */ static void sess_params_set(struct iscsi_sess_params *params, struct iscsi_kern_params_info *info) { - int32_t *iparams = info->session_params; + s32 *iparams = info->session_params; SET_PARAM(params, info, iparams, initial_r2t); SET_PARAM(params, info, iparams, immediate_data); @@ -178,7 +178,7 @@ static void sess_params_set(struct iscsi_sess_params *params, struct iscsi_kern_ static void sess_params_get(struct iscsi_sess_params *params, struct iscsi_kern_params_info *info) { - int32_t *iparams = info->session_params; + s32 *iparams = info->session_params; GET_PARAM(params, iparams, initial_r2t); GET_PARAM(params, iparams, immediate_data); @@ -209,7 +209,7 @@ static void sess_params_get(struct iscsi_sess_params *params, struct iscsi_kern_ /* target_mutex supposed to be locked */ static void tgt_params_check(struct iscsi_session *session, struct iscsi_kern_params_info *info) { - int32_t *iparams = info->target_params; + s32 *iparams = info->target_params; unsigned int rsp_timeout, nop_in_timeout; /* @@ -243,7 +243,7 @@ static int iscsi_tgt_params_set(struct iscsi_session *session, struct iscsi_kern int set) { struct iscsi_tgt_params *params = &session->tgt_params; - int32_t *iparams = info->target_params; + s32 *iparams = info->target_params; lockdep_assert_held(&session->target->target_mutex); diff --git a/iscsi-scst/kernel/target.c b/iscsi-scst/kernel/target.c index 1a7a027be..d0a0e0e92 100644 --- a/iscsi-scst/kernel/target.c +++ b/iscsi-scst/kernel/target.c @@ -419,7 +419,7 @@ const struct attribute *iscsi_tgt_attrs[] = { NULL, }; -ssize_t iscsi_sysfs_send_event(uint32_t tid, enum iscsi_kern_event_code code, const char *param1, +ssize_t iscsi_sysfs_send_event(u32 tid, enum iscsi_kern_event_code code, const char *param1, const char *param2, void **data) { int res; @@ -470,7 +470,7 @@ int iscsi_enable_target(struct scst_tgt *scst_tgt, bool enable) struct iscsi_target *tgt = (struct iscsi_target *)scst_tgt_get_tgt_priv(scst_tgt); int res; - uint32_t type; + u32 type; TRACE_ENTRY(); diff --git a/qla2x00t-32gbit/qla2x00-target/qla_tgt.c b/qla2x00t-32gbit/qla2x00-target/qla_tgt.c index d4aabe440..cae875897 100644 --- a/qla2x00t-32gbit/qla2x00-target/qla_tgt.c +++ b/qla2x00t-32gbit/qla2x00-target/qla_tgt.c @@ -54,7 +54,7 @@ size_t qlt_add_vtarget(u64 port_name, u64 node_name, u64 parent_host) scsi_qla_host_t *vha = NULL, *npiv_vha; struct qla_tgt *tgt; struct fc_vport_identifiers vid; - uint8_t parent_wwn[WWN_SIZE]; + u8 parent_wwn[WWN_SIZE]; memset(&vid, 0, sizeof(vid)); diff --git a/qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c b/qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c index effa70c71..252ec8d82 100644 --- a/qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c +++ b/qla2x00t-32gbit/qla2x00-target/scst_qla2xxx.c @@ -89,17 +89,17 @@ static void sqa_task_mgmt_fn_done(struct scst_mgmt_cmd *scst_mcmd); static void sqa_on_abort_cmd(struct scst_cmd *scst_cmd); static int sqa_get_initiator_port_transport_id(struct scst_tgt *tgt, struct scst_session *scst_sess, - uint8_t **transport_id); + u8 **transport_id); static void sqa_on_hw_pending_cmd_timeout(struct scst_cmd *scst_cmd); -static uint16_t sqa_get_scsi_transport_version(struct scst_tgt *scst_tgt); -static uint16_t sqa_get_phys_transport_version(struct scst_tgt *scst_tgt); +static u16 sqa_get_scsi_transport_version(struct scst_tgt *scst_tgt); +static u16 sqa_get_phys_transport_version(struct scst_tgt *scst_tgt); static int sqa_enable_tgt(struct scst_tgt *scst_tgt, bool enable); static bool sqa_is_tgt_enabled(struct scst_tgt *scst_tgt); static ssize_t sqa_add_vtarget(const char *target_name, char *params); static ssize_t sqa_del_vtarget(const char *target_name); /* Definitions for helper functions. */ -static int sqa_get_target_name(uint8_t *wwn, char **ppwwn_name); +static int sqa_get_target_name(u8 *wwn, char **ppwwn_name); static int sqa_parse_wwn(const char *ns, u64 *nm); /* Variables and function definitions for sysfs control plane. */ @@ -185,7 +185,7 @@ static enum scst_exec_context scst_work_context = SCST_CONTEXT_TASKLET; static struct cmd_state_name { - uint8_t state; + u8 state; char *str; } cmd_str[] = { {0xff, "unknown"}, @@ -196,7 +196,7 @@ static struct cmd_state_name { {QLA_TGT_STATE_DONE, "Done"}, }; -static char *cmdstate_to_str(uint8_t state) +static char *cmdstate_to_str(u8 state) { int i; @@ -341,7 +341,7 @@ static const int qla_tgt_supported_dif_block_size[] = { }; static inline void qla_tgt_set_cmd_prot_op(struct qla_tgt_cmd *cmd, - uint8_t xmit_rsp) + u8 xmit_rsp) { struct scst_cmd *scst_cmd = cmd->scst_cmd; int dir = scst_cmd_get_data_direction(scst_cmd); @@ -537,7 +537,7 @@ static inline int scst_cmd_get_ppl_offset(struct scst_cmd *scst_cmd) static int sqa_qla2xxx_handle_cmd(scsi_qla_host_t *vha, struct qla_tgt_cmd *cmd, unsigned char *cdb, - uint32_t data_length, int task_codes, + u32 data_length, int task_codes, int data_dir, int bidi) { int res = 0; @@ -556,7 +556,7 @@ static int sqa_qla2xxx_handle_cmd(scsi_qla_host_t *vha, cmd->scst_cmd = scst_rx_cmd(scst_sess, - (uint8_t *)&atio->u.isp24.fcp_cmnd.lun, + (u8 *)&atio->u.isp24.fcp_cmnd.lun, sizeof(atio->u.isp24.fcp_cmnd.lun), cdb, cmd->cdb_len, @@ -678,7 +678,7 @@ static void sqa_qla2xxx_handle_data(struct qla_tgt_cmd *cmd) } static int sqa_qla2xxx_handle_tmr(struct qla_tgt_mgmt_cmd *mcmd, u64 lun, - uint16_t tmr_func, uint32_t tag) + u16 tmr_func, u32 tag) { int res = 0, rc = -1, lun_size = sizeof(lun); struct fc_port *sess = mcmd->sess; @@ -793,7 +793,7 @@ done: } static struct qla_tgt_cmd * -sqa_qla2xxx_find_cmd_by_tag(struct fc_port *fcport, uint64_t tag) +sqa_qla2xxx_find_cmd_by_tag(struct fc_port *fcport, u64 tag) { struct scst_session *sess = fcport->se_sess->fabric_sess_ptr; struct qla_tgt_cmd *qla_cmd = NULL; @@ -884,7 +884,7 @@ static void sqa_qla2xxx_free_session(struct fc_port *fcport) } static void sqa_qla2xxx_update_sess(struct fc_port *sess, port_id_t s_id, - uint16_t loop_id, bool conf_compl_supported) + u16 loop_id, bool conf_compl_supported) { TRACE_ENTRY(); TRACE_EXIT(); @@ -967,7 +967,7 @@ static struct fc_port *sqa_qla2xxx_find_sess_by_s_id(scsi_qla_host_t *vha, } static struct fc_port *sqa_qla2xxx_find_sess_by_loop_id(scsi_qla_host_t *vha, - const uint16_t loop_id) + const u16 loop_id) { struct fc_port *sess; @@ -1089,7 +1089,7 @@ static ssize_t sqa_node_name_show(struct kobject *kobj, struct qla_hw_data *ha; ssize_t res = -ENOMEM; char *wwn; - uint8_t *node_name; + u8 *node_name; scst_tgt = container_of(kobj, struct scst_tgt, tgt_kobj); sqa_tgt = scst_tgt_get_tgt_priv(scst_tgt); @@ -1326,7 +1326,7 @@ static ssize_t sqa_abort_isp_store(struct kobject *kobj, #endif } -static int sqa_get_target_name(uint8_t *wwn, char **ppwwn_name) +static int sqa_get_target_name(u8 *wwn, char **ppwwn_name) { *ppwwn_name = kasprintf(GFP_KERNEL, "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x", @@ -1840,9 +1840,9 @@ static void sqa_on_free_cmd(struct scst_cmd *scst_cmd) TRACE_EXIT(); } -static uint32_t sqa_convert_to_fc_tm_status(int scst_mstatus) +static u32 sqa_convert_to_fc_tm_status(int scst_mstatus) { - uint32_t res; + u32 res; switch (scst_mstatus) { case SCST_MGMT_STATUS_SUCCESS: @@ -1900,12 +1900,12 @@ out: static int sqa_get_initiator_port_transport_id(struct scst_tgt *tgt, struct scst_session *scst_sess, - uint8_t **transport_id) + u8 **transport_id) { struct fc_port *sess; int res = 0; int tr_id_size; - uint8_t *tr_id; + u8 *tr_id; TRACE_ENTRY(); @@ -1947,28 +1947,28 @@ out: return res; } -static uint16_t sqa_get_scsi_transport_version(struct scst_tgt *scst_tgt) +static u16 sqa_get_scsi_transport_version(struct scst_tgt *scst_tgt) { /* FCP-2 */ return 0x0900; } -static uint16_t sqa_get_phys_transport_version(struct scst_tgt *scst_tgt) +static u16 sqa_get_phys_transport_version(struct scst_tgt *scst_tgt) { /* FC-FS */ return 0x0DA0; } -static int sqa_qla2xxx_chk_dif_tags(uint32_t tag) +static int sqa_qla2xxx_chk_dif_tags(u32 tag) { return tag & SCST_DIF_CHECK_REF_TAG; } static int sqa_qla2xxx_dif_tags(struct qla_tgt_cmd *cmd, - uint16_t *pfw_prot_opts) + u16 *pfw_prot_opts) { struct scst_cmd *scst_cmd = cmd->scst_cmd; - uint32_t t32 = 0; + u32 t32 = 0; t32 = scst_get_dif_checks(scst_cmd->cmd_dif_actions); if (!(t32 & SCST_DIF_CHECK_GUARD_TAG)) @@ -1998,7 +1998,7 @@ static void sqa_on_hw_pending_cmd_timeout(struct scst_cmd *scst_cmd) TRACE_MGMT_DBG( "sqatgt(%ld/%d): tag %lld: HW pending for too long (state %s) %s; %s", vha->host_no, vha->vp_idx, scst_cmd_get_tag(scst_cmd), - cmdstate_to_str((uint8_t)cmd->state), + cmdstate_to_str((u8)cmd->state), cmd->cmd_sent_to_fw ? "sent to fw" : "not sent to fw", cmd->aborted ? "aborted" : "not aborted"); @@ -2009,7 +2009,7 @@ static void sqa_on_hw_pending_cmd_timeout(struct scst_cmd *scst_cmd) PRINT_ERROR( "sqatgt(%ld/%d): tag %lld: A command in state (%s) should not be HW pending. %s", vha->host_no, vha->vp_idx, scst_cmd_get_tag(scst_cmd), - cmdstate_to_str((uint8_t)cmd->state), + cmdstate_to_str((u8)cmd->state), cmd->aborted ? "aborted" : "not aborted"); goto out_unlock; diff --git a/scst/include/backport.h b/scst/include/backport.h index 991be62c4..c47a5ed36 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -2034,12 +2034,12 @@ iov_iter_kvec_backport(struct iov_iter *i, unsigned int direction, (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8 || \ RHEL_MAJOR -0 == 8 && RHEL_MINOR -0 < 4) /* Only use get_unaligned_be24() if reading p - 1 is allowed. */ -static inline uint32_t get_unaligned_be24(const uint8_t *const p) +static inline u32 get_unaligned_be24(const u8 *const p) { return get_unaligned_be32(p - 1) & 0xffffffU; } -static inline void put_unaligned_be24(const uint32_t v, uint8_t *const p) +static inline void put_unaligned_be24(const u32 v, u8 *const p) { p[0] = v >> 16; p[1] = v >> 8; @@ -2069,13 +2069,13 @@ static inline struct ib_pd *ib_alloc_pd_backport(struct ib_device *device) * See also commit 54cf31d07aa8 ("scsi: core: Drop message byte helper"; * v5.14-rc1). */ -static inline uint8_t msg_byte(uint32_t result) +static inline u8 msg_byte(u32 result) { return (result >> 8) & 0xff; } #endif #ifndef host_byte -static inline uint8_t host_byte(uint32_t result) +static inline u8 host_byte(u32 result) { return (result >> 16) & 0xff; } @@ -2085,7 +2085,7 @@ static inline uint8_t host_byte(uint32_t result) * See also commit 54c29086195f ("scsi: core: Drop the now obsolete driver_byte * definitions"; v5.14-rc1). */ -static inline uint8_t driver_byte(uint32_t result) +static inline u8 driver_byte(u32 result) { return (result >> 24) & 0xff; } diff --git a/scst/include/scst.h b/scst/include/scst.h index e3b78cb9f..e4f4f18e0 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -679,7 +679,7 @@ struct scst_opcode_descriptor; * SCST uses 64-bit numbers to represent LUN's internally. The value * NO_SUCH_LUN is guaranteed to be different of every valid LUN. */ -#define NO_SUCH_LUN ((uint64_t)-1) +#define NO_SUCH_LUN ((u64)-1) /* * SCST target template: defines target driver's parameters and callback @@ -1038,7 +1038,7 @@ struct scst_tgt_template { * SHOULD HAVE, because it's required for Persistent Reservations. */ int (*get_initiator_port_transport_id)(struct scst_tgt *tgt, struct scst_session *sess, - uint8_t **transport_id); + u8 **transport_id); /* * This function allows to enable or disable particular target. @@ -1117,7 +1117,7 @@ struct scst_tgt_template { * * OPTIONAL */ - uint16_t (*get_phys_transport_version)(struct scst_tgt *tgt); + u16 (*get_phys_transport_version)(struct scst_tgt *tgt); /* * Should return SCSI transport version. Used in the corresponding @@ -1125,7 +1125,7 @@ struct scst_tgt_template { * * OPTIONAL */ - uint16_t (*get_scsi_transport_version)(struct scst_tgt *tgt); + u16 (*get_scsi_transport_version)(struct scst_tgt *tgt); /* * Name of the template. Must be unique to identify @@ -1735,7 +1735,7 @@ struct scst_tgt { /* User comment to it to let easier distinguish targets */ char *tgt_comment; - uint16_t rel_tgt_id; + u16 rel_tgt_id; /* How many DIF failures detected on this target on the corresponding stage */ atomic_t tgt_dif_app_failed_tgt, tgt_dif_ref_failed_tgt, tgt_dif_guard_failed_tgt; @@ -1766,17 +1766,17 @@ struct scst_tgt { * Size: 96 bytes. */ struct scst_lat_stat_entry { - uint32_t count; - uint32_t padding; - uint64_t min; - uint64_t max; - uint64_t sum; - uint64_t sumsq; + u32 count; + u32 padding; + u64 min; + u64 max; + u64 sum; + u64 sumsq; #ifdef SCST_MEASURE_CLOCK_CYCLES - uint64_t minc; - uint64_t maxc; - uint64_t sumc; - uint64_t sumsqc; + u64 minc; + u64 maxc; + u64 sumc; + u64 sumsqc; #endif }; @@ -1796,9 +1796,9 @@ struct scst_lat_stats { }; struct scst_io_stat_entry { - uint64_t cmd_count; - uint64_t io_byte_count; - uint64_t unaligned_cmd_count; + u64 cmd_count; + u64 io_byte_count; + u64 unaligned_cmd_count; }; /* @@ -1864,7 +1864,7 @@ struct scst_session { int black_hole_type; /* Initiator port transport id */ - uint8_t *transport_id; + u8 *transport_id; /* List entry for the sessions list inside ACG */ struct list_head acg_sess_list_entry; @@ -2075,7 +2075,7 @@ struct scst_cmd { ktime_t last_state_update; #ifdef SCST_MEASURE_CLOCK_CYCLES /* Time of the last state update in 100 clock cycles.*/ - uint64_t last_state_update_tsc; + u64 last_state_update_tsc; #endif /************************************************************* @@ -2281,12 +2281,12 @@ struct scst_cmd { struct scst_order_data *cur_order_data; /* to save extra dereferences */ - uint64_t lun; /* LUN for this cmd */ + u64 lun; /* LUN for this cmd */ unsigned long start_time; ktime_t init_wait_time; - uint64_t init_wait_tsc; + u64 init_wait_tsc; /* List entry for tgt_dev's deferred (SN, ACA, etc.) lists */ struct list_head deferred_cmd_list_entry; @@ -2301,18 +2301,18 @@ struct scst_cmd { * Used to found the cmd by scst_find_cmd_by_tag(). Set by the * target driver on the cmd's initialization time */ - uint64_t tag; + u64 tag; /* Cmd's serial number, used to execute cmd's in order of arrival */ unsigned int sn; - uint32_t tgt_sn; /* SN set by target driver (for TM purposes) */ + u32 tgt_sn; /* SN set by target driver (for TM purposes) */ - uint16_t tg_id; /* Only used during TYPE_DISK INQUIRY EVPD=0x83 */ + u16 tg_id; /* Only used during TYPE_DISK INQUIRY EVPD=0x83 */ - uint8_t *cdb; /* Pointer on CDB. Points on cdb_buf for small CDBs. */ + u8 *cdb; /* Pointer on CDB. Points on cdb_buf for small CDBs. */ unsigned short cdb_len; - uint8_t cdb_buf[SCST_MAX_CDB_SIZE]; + u8 cdb_buf[SCST_MAX_CDB_SIZE]; /* List entry for dev's dev_exec_cmd_list */ struct list_head dev_exec_cmd_list_entry; @@ -2323,13 +2323,13 @@ struct scst_cmd { */ struct scst_cmd **scsi_atomic_blocked_cmds; - uint8_t lba_off; /* LBA offset in cdb */ - uint8_t lba_len; /* LBA length in cdb */ - uint8_t len_off; /* length offset in cdb */ - uint8_t len_len; /* length of length in cdb */ + u8 lba_off; /* LBA offset in cdb */ + u8 lba_len; /* LBA length in cdb */ + u8 len_off; /* length offset in cdb */ + u8 len_len; /* length of length in cdb */ /* If not zero, logarithm base 2 of the maximum data buffer length. */ - uint8_t log2_max_buf_len; - uint32_t op_flags; /* various flags of this opcode */ + u8 log2_max_buf_len; + u32 op_flags; /* various flags of this opcode */ const char *op_name; /* op code SCSI full name */ enum scst_cmd_queue_type queue_type; @@ -2348,14 +2348,14 @@ struct scst_cmd { int expected_transfer_len_full; /* both data and DIF tags, if any */ int expected_out_transfer_len; /* for bidi writes */ - int64_t lba; /* LBA of this cmd */ + s64 lba; /* LBA of this cmd */ /* * Cmd data length. Could be different from bufflen for commands like * VERIFY, which transfer different amount of data (if any), than * processed. */ - int64_t data_len; + s64 data_len; /* Completion routine */ void (*scst_cmd_done)(struct scst_cmd *cmd, int next_state, @@ -2432,18 +2432,18 @@ struct scst_cmd { * The status fields in case of errors must be set using * scst_set_cmd_error_status()! */ - uint8_t status; /* status byte from target device */ - uint8_t msg_status; /* return status from host adapter itself */ - uint8_t host_status; /* set by low-level driver to indicate status */ - uint8_t driver_status; /* set by mid-level */ + u8 status; /* status byte from target device */ + u8 msg_status; /* return status from host adapter itself */ + u8 host_status; /* set by low-level driver to indicate status */ + u8 driver_status; /* set by mid-level */ /* DIF actions on this cmd */ enum scst_dif_actions cmd_dif_actions; #ifdef CONFIG_SCST_DIF_INJECT_CORRUPTED_TAGS - uint32_t cmd_corrupt_dif_tag; + u32 cmd_corrupt_dif_tag; #endif - uint8_t *sense; /* pointer to sense buffer */ + u8 *sense; /* pointer to sense buffer */ unsigned short sense_valid_len; /* length of valid sense data */ unsigned short sense_buflen; /* length of the sense buffer, if any */ @@ -2522,10 +2522,10 @@ struct scst_cmd { */ struct scst_rx_mgmt_params { int fn; - uint64_t tag; - const uint8_t *lun; + u64 tag; + const u8 *lun; int lun_len; - uint32_t cmd_sn; + u32 cmd_sn; int atomic; void *tgt_priv; unsigned char tag_set; @@ -2588,11 +2588,11 @@ struct scst_mgmt_cmd { /* Number of completed commands, protected by scst_mcmd_lock */ int completed_cmd_count; - uint64_t lun; /* LUN for this mgmt cmd */ + u64 lun; /* LUN for this mgmt cmd */ /* or (and for iSCSI) */ - uint64_t tag; /* for ABORT TASK, tag of the cmd to abort */ + u64 tag; /* for ABORT TASK, tag of the cmd to abort */ - uint32_t cmd_sn; /* affected command's highest SN */ + u32 cmd_sn; /* affected command's highest SN */ /* corresponding cmd (to be aborted, found by tag) */ struct scst_cmd *cmd_to_abort; @@ -2614,8 +2614,8 @@ struct scst_mgmt_cmd { * Persistent reservations registrant */ struct scst_dev_registrant { - uint8_t *transport_id; - uint16_t rel_tgt_id; + u8 *transport_id; + u16 rel_tgt_id; __be64 key; /* tgt_dev (I_T nexus) for this registrant, if any */ @@ -2632,7 +2632,7 @@ struct scst_dev_registrant { int dlm_idx; struct scst_lksb lksb; char lvb[PR_DLM_LVB_LEN]; - uint32_t registered_by_nodeid; + u32 registered_by_nodeid; /* List of UNIT ATTENTIONs to be sent by this node to this registrant on a remote node */ struct list_head pending_rem_ua_list; @@ -2651,7 +2651,7 @@ struct scst_dev_registrant { * It will be incremented by the sender of each UA, and cleared by the recipiant node when * it reads all the UNIT ATTENTIONs directed to it. */ - uint16_t next_rem_ua_idx; + u16 next_rem_ua_idx; }; /** @@ -2704,7 +2704,7 @@ struct scst_cl_ops { * Extended, e.g. via sysfs, blockers */ typedef void (*ext_blocker_done_fn_t) (struct scst_device *dev, - uint8_t *data, int len); + u8 *data, int len); struct scst_ext_blocker { struct list_head ext_blockers_list_entry; @@ -2712,7 +2712,7 @@ struct scst_ext_blocker { ext_blocker_done_fn_t ext_blocker_done_fn; int ext_blocker_data_len; - uint8_t ext_blocker_data[]; + u8 ext_blocker_data[]; }; /* @@ -2974,10 +2974,10 @@ struct scst_device { unsigned int cluster_mode:1; /* Persistent reservation type */ - uint8_t pr_type; + u8 pr_type; /* Persistent reservation scope */ - uint8_t pr_scope; + u8 pr_scope; /* Data structures for managing PR data via the DLM */ struct scst_pr_dlm_data *pr_dlm; @@ -2986,7 +2986,7 @@ struct scst_device { struct mutex dev_pr_mutex; /* Persistent reservation generation value */ - uint32_t pr_generation; + u32 pr_generation; /* Reference to registrant - persistent reservation holder */ struct scst_dev_registrant *pr_holder; @@ -3030,7 +3030,7 @@ struct scst_device { struct work_struct ext_blockers_work; /* MAXIMUM WRITE SAME LENGTH in bytes */ - uint64_t max_write_same_len; + u64 max_write_same_len; /* A list entry used during TM */ struct list_head tm_dev_list_entry; @@ -3088,7 +3088,7 @@ struct scst_tgt_dev { struct scst_tgt_template *tgtt; /* to avoid use-after-free issues */ struct scst_device *dev; /* to save extra dereferences */ - uint64_t lun; /* to save extra dereferences */ + u64 lun; /* to save extra dereferences */ /* * Extra flags in GFP mask for data buffers allocations of this @@ -3206,7 +3206,7 @@ struct scst_tgt_dev { * subsequent REQUEST SENSE. Both protected by tgt_dev_lock. */ unsigned short tgt_dev_valid_sense_len; - uint8_t tgt_dev_sense[SCST_SENSE_BUFFERSIZE]; + u8 tgt_dev_sense[SCST_SENSE_BUFFERSIZE]; /* * LUN thread index assigned by scst_add_threads(). Exported via @@ -3230,7 +3230,7 @@ struct scst_tgt_dev { struct scst_acg_dev { struct scst_device *dev; /* corresponding device */ - uint64_t lun; /* device's LUN in this acg */ + u64 lun; /* device's LUN in this acg */ /* If set, the corresponding LU is read only */ unsigned int acg_dev_rd_only:1; @@ -3370,8 +3370,8 @@ struct scst_dev_group { struct kobject kobj; struct kobject *dev_kobj; struct kobject *tg_kobj; - uint8_t *stpg_transport_id; - uint16_t stpg_rel_tgt_id; + u8 *stpg_transport_id; + u16 stpg_rel_tgt_id; }; /** @@ -3399,7 +3399,7 @@ struct scst_dg_dev { struct scst_target_group { struct scst_dev_group *dg; char *name; - uint16_t group_id; + u16 group_id; enum scst_tg_state state; bool preferred; struct list_head entry; @@ -3421,7 +3421,7 @@ struct scst_tg_tgt { struct kobject kobj; struct scst_tgt *tgt; char *name; - uint16_t rel_tgt_id; + u16 rel_tgt_id; }; /* @@ -3437,7 +3437,7 @@ struct scst_tgt_dev_UA { /* Unit Attention valid sense len */ unsigned short UA_valid_sense_len; /* Unit Attention sense buf */ - uint8_t UA_sense_buffer[SCST_SENSE_BUFFERSIZE]; + u8 UA_sense_buffer[SCST_SENSE_BUFFERSIZE]; }; /* Used to deliver AENs */ @@ -3451,7 +3451,7 @@ struct scst_aen { /* SCSI AEN data */ struct { int aen_sense_len; - uint8_t aen_sense[SCST_STANDARD_SENSE_LEN]; + u8 aen_sense[SCST_STANDARD_SENSE_LEN]; }; }; @@ -3462,15 +3462,15 @@ struct scst_aen { #define SCST_OD_DEFAULT_CONTROL_BYTE 4 /* NACA */ struct scst_opcode_descriptor { - uint16_t od_serv_action; - uint8_t od_opcode; - uint8_t od_serv_action_valid:1; - uint8_t od_support:3; /* SUPPORT bits */ - uint16_t od_cdb_size; - uint8_t od_comm_specific_timeout; - uint32_t od_nominal_timeout; - uint32_t od_recommended_timeout; - uint8_t od_cdb_usage_bits[]; + u16 od_serv_action; + u8 od_opcode; + u8 od_serv_action_valid:1; + u8 od_support:3; /* SUPPORT bits */ + u16 od_cdb_size; + u8 od_comm_specific_timeout; + u32 od_nominal_timeout; + u32 od_recommended_timeout; + u8 od_cdb_usage_bits[]; } __packed; extern const struct scst_opcode_descriptor scst_op_descr_log_select; @@ -3580,10 +3580,10 @@ void scst_unregister_virtual_dev_driver(struct scst_dev_type *dev_type); bool scst_initiator_has_luns(struct scst_tgt *tgt, const char *initiator_name); -struct scst_cmd *scst_rx_cmd(struct scst_session *sess, const uint8_t *lun, int lun_len, - const uint8_t *cdb, unsigned int cdb_len, bool atomic); -int scst_rx_cmd_prealloced(struct scst_cmd *cmd, struct scst_session *sess, const uint8_t *lun, - int lun_len, const uint8_t *cdb, unsigned int cdb_len, bool atomic); +struct scst_cmd *scst_rx_cmd(struct scst_session *sess, const u8 *lun, int lun_len, + const u8 *cdb, unsigned int cdb_len, bool atomic); +int scst_rx_cmd_prealloced(struct scst_cmd *cmd, struct scst_session *sess, const u8 *lun, + int lun_len, const u8 *cdb, unsigned int cdb_len, bool atomic); void scst_cmd_init_done(struct scst_cmd *cmd, enum scst_exec_context pref_context); /* @@ -3619,7 +3619,7 @@ static inline void scst_rx_mgmt_params_init(struct scst_rx_mgmt_params *params) * * Obsolete in favor of scst_rx_mgmt_fn() */ -static inline int scst_rx_mgmt_fn_tag(struct scst_session *sess, int fn, uint64_t tag, int atomic, +static inline int scst_rx_mgmt_fn_tag(struct scst_session *sess, int fn, u64 tag, int atomic, void *tgt_priv) { struct scst_rx_mgmt_params params; @@ -3667,7 +3667,7 @@ int scst_get_cdb_info(struct scst_cmd *cmd); int scst_set_cmd_error_status(struct scst_cmd *cmd, int status); int scst_set_cmd_error(struct scst_cmd *cmd, int key, int asc, int ascq); int scst_set_cmd_error_and_inf(struct scst_cmd *cmd, int key, int asc, int ascq, - uint64_t information); + u64 information); void scst_set_busy(struct scst_cmd *cmd); void scst_check_convert_sense(struct scst_cmd *cmd); @@ -3676,7 +3676,7 @@ void scst_set_initial_UA(struct scst_session *sess, int key, int asc, int ascq); void scst_capacity_data_changed(struct scst_device *dev); -struct scst_cmd *scst_find_cmd_by_tag(struct scst_session *sess, uint64_t tag); +struct scst_cmd *scst_find_cmd_by_tag(struct scst_session *sess, u64 tag); struct scst_cmd *scst_find_cmd(struct scst_session *sess, void *data, int (*cmp_fn)(struct scst_cmd *cmd, void *data)); @@ -3828,11 +3828,11 @@ static inline void scst_sess_set_tgt_priv(struct scst_session *sess, void *val) sess->sess_tgt_priv = val; } -uint16_t scst_lookup_tg_id(struct scst_device *dev, struct scst_tgt *tgt); +u16 scst_lookup_tg_id(struct scst_device *dev, struct scst_tgt *tgt); enum scst_tg_state scst_get_alua_state(struct scst_device *dev, struct scst_tgt *tgt); bool scst_alua_configured(struct scst_device *dev); -int scst_tg_get_group_info(void **buf, uint32_t *length, - struct scst_device *dev, uint8_t data_format); +int scst_tg_get_group_info(void **buf, u32 *length, + struct scst_device *dev, u8 data_format); int scst_tg_set_group_info(struct scst_cmd *cmd); const char *scst_alua_state_name(enum scst_tg_state s); void scst_stpg_del_unblock_next(struct scst_cmd *cmd); @@ -3852,7 +3852,7 @@ static inline __be32 scst_dev_get_dif_static_app_ref_tag(const struct scst_devic static inline __be64 scst_dev_get_dif_static_app_tag_combined(struct scst_device *dev) { - uint64_t a = (((uint64_t)be32_to_cpu(dev->dev_dif_static_app_ref_tag)) << 16) | + u64 a = (((u64)be32_to_cpu(dev->dev_dif_static_app_ref_tag)) << 16) | be16_to_cpu(dev->dev_dif_static_app_tag); return cpu_to_be64(a); } @@ -4019,7 +4019,7 @@ static inline enum scst_exec_context scst_estimate_context_atomic(void) } /* Returns cmd's CDB */ -static inline const uint8_t *scst_cmd_get_cdb(const struct scst_cmd *cmd) +static inline const u8 *scst_cmd_get_cdb(const struct scst_cmd *cmd) { return cmd->cdb; } @@ -4031,7 +4031,7 @@ static inline unsigned int scst_cmd_get_cdb_len(const struct scst_cmd *cmd) } void scst_cmd_set_ext_cdb(struct scst_cmd *cmd, - uint8_t *ext_cdb, unsigned int ext_cdb_len, gfp_t gfp_mask); + u8 *ext_cdb, unsigned int ext_cdb_len, gfp_t gfp_mask); /* Returns cmd's session */ static inline struct scst_session *scst_cmd_get_session(const struct scst_cmd *cmd) @@ -4102,7 +4102,7 @@ static inline int scst_cmd_get_dif_sg_cnt(const struct scst_cmd *cmd) } /* Returns cmd's LBA */ -static inline int64_t scst_cmd_get_lba(const struct scst_cmd *cmd) +static inline s64 scst_cmd_get_lba(const struct scst_cmd *cmd) { return cmd->lba; } @@ -4123,7 +4123,7 @@ static inline int scst_cmd_get_bufflen(const struct scst_cmd *cmd) * Returns cmd's data_len. See the corresponding field's description in * struct scst_cmd above. */ -static inline int64_t scst_cmd_get_data_len(const struct scst_cmd *cmd) +static inline s64 scst_cmd_get_data_len(const struct scst_cmd *cmd) { return cmd->data_len; } @@ -4303,31 +4303,31 @@ static inline bool scst_get_resid(struct scst_cmd *cmd, int *resid, int *bidi_ou } /* Returns cmd's status byte from host device */ -static inline uint8_t scst_cmd_get_status(const struct scst_cmd *cmd) +static inline u8 scst_cmd_get_status(const struct scst_cmd *cmd) { return cmd->status; } /* Returns cmd's status from host adapter itself */ -static inline uint8_t scst_cmd_get_msg_status(const struct scst_cmd *cmd) +static inline u8 scst_cmd_get_msg_status(const struct scst_cmd *cmd) { return cmd->msg_status; } /* Returns cmd's status set by low-level driver to indicate its status */ -static inline uint8_t scst_cmd_get_host_status(const struct scst_cmd *cmd) +static inline u8 scst_cmd_get_host_status(const struct scst_cmd *cmd) { return cmd->host_status; } /* Returns cmd's status set by SCSI mid-level */ -static inline uint8_t scst_cmd_get_driver_status(const struct scst_cmd *cmd) +static inline u8 scst_cmd_get_driver_status(const struct scst_cmd *cmd) { return cmd->driver_status; } /* Returns pointer to cmd's sense buffer */ -static inline uint8_t *scst_cmd_get_sense_buffer(const struct scst_cmd *cmd) +static inline u8 *scst_cmd_get_sense_buffer(const struct scst_cmd *cmd) { return cmd->sense; } @@ -4355,12 +4355,12 @@ static inline void scst_cmd_set_queue_type(struct scst_cmd *cmd, /* * Get/Set functions for cmd's target SN */ -static inline uint64_t scst_cmd_get_tag(const struct scst_cmd *cmd) +static inline u64 scst_cmd_get_tag(const struct scst_cmd *cmd) { return cmd->tag; } -static inline void scst_cmd_set_tag(struct scst_cmd *cmd, uint64_t tag) +static inline void scst_cmd_set_tag(struct scst_cmd *cmd, u64 tag) { cmd->tag = tag; } @@ -4443,7 +4443,7 @@ static inline int scst_cmd_get_tgt_sn(const struct scst_cmd *cmd) return cmd->tgt_sn; } -static inline void scst_cmd_set_tgt_sn(struct scst_cmd *cmd, uint32_t tgt_sn) +static inline void scst_cmd_set_tgt_sn(struct scst_cmd *cmd, u32 tgt_sn) { cmd->tgt_sn_set = 1; cmd->tgt_sn = tgt_sn; @@ -4636,7 +4636,7 @@ static inline int scst_cmd_get_dif_prot_type(struct scst_cmd *cmd) * support Application Tag mode page. ToDo, not implemented yet. */ static inline __be16 scst_cmd_get_dif_app_tag(struct scst_cmd *cmd, - uint64_t lba_start/*, uint64_t *out_lba_end*/) + u64 lba_start/*, uint64_t *out_lba_end*/) { #ifdef CONFIG_SCST_EXTRACHECKS WARN_ON(!(scst_get_dif_checks(cmd->cmd_dif_actions) & SCST_DIF_CHECK_APP_TAG)); @@ -4648,7 +4648,7 @@ static inline __be16 scst_cmd_get_dif_app_tag(struct scst_cmd *cmd, * Returns T10-PI type 2 expected initial reference tag as LBA, i.e. converted * into CPU endianness. Valid only with protection type 2. */ -static inline uint32_t scst_cmd_get_dif_exp_ref_tag(struct scst_cmd *cmd) +static inline u32 scst_cmd_get_dif_exp_ref_tag(struct scst_cmd *cmd) { #ifdef CONFIG_SCST_EXTRACHECKS BUG_ON(cmd->dev->dev_dif_type != 2); @@ -4664,7 +4664,7 @@ static inline uint32_t scst_cmd_get_dif_exp_ref_tag(struct scst_cmd *cmd) * Returns T10-PI type 2 expected logical block application tag converted * into CPU endianness. Valid only with protection type 2. */ -static inline uint16_t scst_cmd_get_dif_exp_app_tag(struct scst_cmd *cmd) +static inline u16 scst_cmd_get_dif_exp_app_tag(struct scst_cmd *cmd) { #ifdef CONFIG_SCST_EXTRACHECKS BUG_ON(cmd->dev->dev_dif_type != 2); @@ -4681,7 +4681,7 @@ static inline uint16_t scst_cmd_get_dif_exp_app_tag(struct scst_cmd *cmd) * Returns T10-PI type 2 logical block application tag mask converted * into CPU endianness. Valid only with protection type 2. */ -static inline uint16_t scst_cmd_get_dif_app_tag_mask(struct scst_cmd *cmd) +static inline u16 scst_cmd_get_dif_app_tag_mask(struct scst_cmd *cmd) { #ifdef CONFIG_SCST_EXTRACHECKS BUG_ON(cmd->dev->dev_dif_type != 2); @@ -4739,7 +4739,7 @@ static inline unsigned int scst_get_active_cmd_count(struct scst_cmd *cmd) return (unsigned int)-1; } -int scst_set_cdb_lba(struct scst_cmd *cmd, int64_t lba); +int scst_set_cdb_lba(struct scst_cmd *cmd, s64 lba); int scst_set_cdb_transf_len(struct scst_cmd *cmd, int len); /* @@ -4812,7 +4812,7 @@ static inline __be64 scst_aen_get_lun(const struct scst_aen *aen) } /* Returns SCSI AEN's sense */ -static inline const uint8_t *scst_aen_get_sense(const struct scst_aen *aen) +static inline const u8 *scst_aen_get_sense(const struct scst_aen *aen) { return aen->aen_sense; } @@ -4905,7 +4905,7 @@ void scst_copy_sg(struct scst_cmd *cmd, enum scst_sg_copy_dir copy_dir); * * The "put" function unmaps the buffer. */ -static inline int __scst_get_buf(struct scst_cmd *cmd, int sg_cnt, uint8_t **buf) +static inline int __scst_get_buf(struct scst_cmd *cmd, int sg_cnt, u8 **buf) { int res = 0; struct scatterlist *sg = cmd->get_sg_buf_cur_sg_entry; @@ -4925,7 +4925,7 @@ out: return res; } -static inline int scst_get_buf_first(struct scst_cmd *cmd, uint8_t **buf) +static inline int scst_get_buf_first(struct scst_cmd *cmd, u8 **buf) { if (unlikely(!cmd->sg)) { *buf = NULL; @@ -4937,7 +4937,7 @@ static inline int scst_get_buf_first(struct scst_cmd *cmd, uint8_t **buf) return __scst_get_buf(cmd, cmd->sg_cnt, buf); } -static inline int scst_get_buf_next(struct scst_cmd *cmd, uint8_t **buf) +static inline int scst_get_buf_next(struct scst_cmd *cmd, u8 **buf) { return __scst_get_buf(cmd, cmd->sg_cnt, buf); } @@ -4961,10 +4961,10 @@ static inline void scst_put_buf(struct scst_cmd *cmd, void *buf) * !!! NOTE: this function does not check DIF SG cnt, hence must be used !!! * !!! only inside code bound to the corresponding data SG cnt! !!! */ -static inline uint8_t *scst_get_dif_buf(struct scst_cmd *cmd, struct scatterlist **psg, +static inline u8 *scst_get_dif_buf(struct scst_cmd *cmd, struct scatterlist **psg, int *length) { - uint8_t *buf; + u8 *buf; struct scatterlist *sg; if (!*psg) @@ -4986,7 +4986,7 @@ static inline void scst_put_dif_buf(struct scst_cmd *cmd, void *buf) /* Nothing to do */ } -static inline int scst_get_out_buf_first(struct scst_cmd *cmd, uint8_t **buf) +static inline int scst_get_out_buf_first(struct scst_cmd *cmd, u8 **buf) { if (unlikely(!cmd->out_sg)) { *buf = NULL; @@ -4998,7 +4998,7 @@ static inline int scst_get_out_buf_first(struct scst_cmd *cmd, uint8_t **buf) return __scst_get_buf(cmd, cmd->out_sg_cnt, buf); } -static inline int scst_get_out_buf_next(struct scst_cmd *cmd, uint8_t **buf) +static inline int scst_get_out_buf_next(struct scst_cmd *cmd, u8 **buf) { return __scst_get_buf(cmd, cmd->out_sg_cnt, buf); } @@ -5008,7 +5008,7 @@ static inline void scst_put_out_buf(struct scst_cmd *cmd, void *buf) /* Nothing to do */ } -static inline int scst_get_sg_buf_first(struct scst_cmd *cmd, uint8_t **buf, +static inline int scst_get_sg_buf_first(struct scst_cmd *cmd, u8 **buf, struct scatterlist *sg, int sg_cnt) { if (unlikely(!sg)) { @@ -5021,7 +5021,7 @@ static inline int scst_get_sg_buf_first(struct scst_cmd *cmd, uint8_t **buf, return __scst_get_buf(cmd, sg_cnt, buf); } -static inline int scst_get_sg_buf_next(struct scst_cmd *cmd, uint8_t **buf, +static inline int scst_get_sg_buf_next(struct scst_cmd *cmd, u8 **buf, struct scatterlist *sg, int sg_cnt) { return __scst_get_buf(cmd, sg_cnt, buf); @@ -5137,9 +5137,9 @@ static inline int scst_get_out_buf_count(struct scst_cmd *cmd) return (cmd->out_sg_cnt == 0) ? 1 : cmd->out_sg_cnt; } -int scst_get_buf_full(struct scst_cmd *cmd, uint8_t **buf, bool always_copy); -int scst_get_buf_full_sense(struct scst_cmd *cmd, uint8_t **buf); -void scst_put_buf_full(struct scst_cmd *cmd, uint8_t *buf); +int scst_get_buf_full(struct scst_cmd *cmd, u8 **buf, bool always_copy); +int scst_get_buf_full_sense(struct scst_cmd *cmd, u8 **buf); +void scst_put_buf_full(struct scst_cmd *cmd, u8 *buf); static inline gfp_t scst_cmd_get_gfp_mask(const struct scst_cmd *cmd) { @@ -5274,17 +5274,17 @@ static inline const char *scst_get_tgt_name(const struct scst_tgt *tgt) } int scst_alloc_sense(struct scst_cmd *cmd, int atomic); -int scst_alloc_set_sense(struct scst_cmd *cmd, int atomic, const uint8_t *sense, unsigned int len); +int scst_alloc_set_sense(struct scst_cmd *cmd, int atomic, const u8 *sense, unsigned int len); -int scst_set_sense(uint8_t *buffer, int len, bool d_sense, int key, int asc, int ascq); +int scst_set_sense(u8 *buffer, int len, bool d_sense, int key, int asc, int ascq); #define SCST_INVAL_FIELD_BIT_OFFS_VALID 0x8000 int scst_set_invalid_field_in_cdb(struct scst_cmd *cmd, int field_offs, int bit_offs); int scst_set_invalid_field_in_parm_list(struct scst_cmd *cmd, int field_offs, int bit_offs); -bool scst_is_ua_sense(const uint8_t *sense, int len); +bool scst_is_ua_sense(const u8 *sense, int len); -bool scst_analyze_sense(const uint8_t *sense, int len, unsigned int valid_mask, int key, int asc, +bool scst_analyze_sense(const u8 *sense, int len, unsigned int valid_mask, int key, int asc, int ascq); unsigned long scst_random(void); @@ -5311,12 +5311,12 @@ int scst_block_generic_dev_done(struct scst_cmd *cmd, int scst_tape_generic_dev_done(struct scst_cmd *cmd, void (*set_block_size)(struct scst_cmd *cmd, int block_size)); -int scst_obtain_device_parameters(struct scst_device *dev, const uint8_t *mode_select_cdb); +int scst_obtain_device_parameters(struct scst_device *dev, const u8 *mode_select_cdb); void scst_reassign_retained_sess_states(struct scst_session *new_sess, struct scst_session *old_sess); -int scst_get_max_lun_commands(struct scst_session *sess, uint64_t lun); +int scst_get_max_lun_commands(struct scst_session *sess, u64 lun); void scst_dev_inquiry_data_changed(struct scst_device *dev); @@ -5485,7 +5485,7 @@ static inline const char *scst_get_opcode_name(struct scst_cmd *cmd) */ struct scst_sysfs_user_info { /* Unique cookie to identify request */ - uint32_t info_cookie; + u32 info_cookie; /* Entry in the global list */ struct list_head info_list_entry; @@ -5506,7 +5506,7 @@ struct scst_sysfs_user_info { int scst_sysfs_user_add_info(struct scst_sysfs_user_info **out_info); void scst_sysfs_user_del_info(struct scst_sysfs_user_info *info); -struct scst_sysfs_user_info *scst_sysfs_user_get_info(uint32_t cookie); +struct scst_sysfs_user_info *scst_sysfs_user_get_info(u32 cookie); int scst_wait_info_completion(struct scst_sysfs_user_info *info, unsigned long timeout); unsigned int scst_get_setup_id(void); @@ -5614,8 +5614,8 @@ int scst_open_bdev_by_path(const char *path, blk_mode_t mode, void *holder, void scst_release_bdev(struct scst_bdev_descriptor *bdev_desc); struct scst_data_descriptor { - uint64_t sdd_lba; - uint64_t sdd_blocks; + u64 sdd_lba; + u64 sdd_blocks; }; loff_t scst_file_size(const char *path, umode_t *mode); @@ -5684,16 +5684,16 @@ __scst_scsi_execute_cmd(struct scsi_device *sdev, const unsigned char *cmd, __scst_scsi_execute_cmd(sdev, cmd, data_direction, buffer, bufflen, sense, \ sizeof(sense), timeout, retries, opf) -__be64 scst_pack_lun(const uint64_t lun, enum scst_lun_addr_method addr_method); -uint64_t scst_unpack_lun(const uint8_t *lun, int len); +__be64 scst_pack_lun(const u64 lun, enum scst_lun_addr_method addr_method); +u64 scst_unpack_lun(const u8 *lun, int len); -int scst_save_global_mode_pages(const struct scst_device *dev, uint8_t *buf, int size); +int scst_save_global_mode_pages(const struct scst_device *dev, u8 *buf, int size); int scst_restore_global_mode_pages(struct scst_device *dev, char *params, char **last_param); int scst_read_file_transactional(const char *name, const char *name1, const char *signature, - int signature_len, uint8_t *buf, int size); + int signature_len, u8 *buf, int size); int scst_write_file_transactional(const char *name, const char *name1, const char *signature, - int signature_len, const uint8_t *buf, int size); + int signature_len, const u8 *buf, int size); int scst_remove_file(const char *name); @@ -5710,8 +5710,8 @@ void scst_alua_unlock(void); void lockdep_assert_alua_lock_held(void); struct scst_ext_copy_data_descr { - uint64_t src_lba; - uint64_t dst_lba; + u64 src_lba; + u64 dst_lba; int data_len; /* in bytes */ }; diff --git a/scst/src/dev_handlers/scst_cdrom.c b/scst/src/dev_handlers/scst_cdrom.c index d1ab71ec0..f09ee3480 100644 --- a/scst/src/dev_handlers/scst_cdrom.c +++ b/scst/src/dev_handlers/scst_cdrom.c @@ -59,9 +59,9 @@ static struct scst_dev_type cdrom_devtype = { static int cdrom_attach(struct scst_device *dev) { int res, rc; - uint8_t cmd[10]; + u8 cmd[10]; const int buffer_size = 512; - uint8_t *buffer = NULL; + u8 *buffer = NULL; int retries; unsigned char sense_buffer[SCSI_SENSE_BUFFERSIZE]; @@ -112,7 +112,7 @@ static int cdrom_attach(struct scst_device *dev) } if (rc == 0) { - uint32_t sector_size = get_unaligned_be32(&buffer[4]); + u32 sector_size = get_unaligned_be32(&buffer[4]); if (sector_size == 0) dev->block_shift = CDROM_DEF_BLOCK_SHIFT; diff --git a/scst/src/dev_handlers/scst_disk.c b/scst/src/dev_handlers/scst_disk.c index de06a45da..f96c9ffb0 100644 --- a/scst/src/dev_handlers/scst_disk.c +++ b/scst/src/dev_handlers/scst_disk.c @@ -55,9 +55,9 @@ struct disk_dh_priv { static int disk_attach(struct scst_device *dev) { int res, rc; - uint8_t cmd[10]; + u8 cmd[10]; const int buffer_size = 512; - uint8_t *buffer = NULL; + u8 *buffer = NULL; int retries; unsigned char sense_buffer[SCSI_SENSE_BUFFERSIZE]; @@ -105,7 +105,7 @@ static int disk_attach(struct scst_device *dev) } } if (rc == 0) { - uint32_t sector_size = get_unaligned_be32(&buffer[4]); + u32 sector_size = get_unaligned_be32(&buffer[4]); if (sector_size == 0) dev->block_shift = DISK_DEF_BLOCK_SHIFT; @@ -158,7 +158,7 @@ static int disk_attach(struct scst_device *dev) } } if (rc == 0) { - int32_t serial_length = get_unaligned_be16(&buffer[2]); + s32 serial_length = get_unaligned_be16(&buffer[2]); /* * Store serial in a disk_dh_priv struct on dh_priv. @@ -417,7 +417,7 @@ struct disk_work { struct completion disk_work_cmpl; int result; unsigned int left; - int64_t save_lba; + s64 save_lba; int save_len; struct scatterlist *save_sg; int save_sg_cnt; diff --git a/scst/src/dev_handlers/scst_modisk.c b/scst/src/dev_handlers/scst_modisk.c index 8d36e3f40..91ccee374 100644 --- a/scst/src/dev_handlers/scst_modisk.c +++ b/scst/src/dev_handlers/scst_modisk.c @@ -121,9 +121,9 @@ module_exit(exit_scst_modisk_driver); static int modisk_attach(struct scst_device *dev) { int res, rc; - uint8_t cmd[10]; + u8 cmd[10]; const int buffer_size = 512; - uint8_t *buffer = NULL; + u8 *buffer = NULL; int retries; unsigned char sense_buffer[SCSI_SENSE_BUFFERSIZE]; @@ -189,7 +189,7 @@ static int modisk_attach(struct scst_device *dev) } if (rc == 0) { - uint32_t sector_size = get_unaligned_be32(&buffer[4]); + u32 sector_size = get_unaligned_be32(&buffer[4]); if (sector_size == 0) dev->block_shift = MODISK_DEF_BLOCK_SHIFT; diff --git a/scst/src/dev_handlers/scst_tape.c b/scst/src/dev_handlers/scst_tape.c index 928ab8765..f554f7d7e 100644 --- a/scst/src/dev_handlers/scst_tape.c +++ b/scst/src/dev_handlers/scst_tape.c @@ -129,7 +129,7 @@ static int tape_attach(struct scst_device *dev) int retries; struct scsi_mode_data data; const int buffer_size = 512; - uint8_t *buffer = NULL; + u8 *buffer = NULL; TRACE_ENTRY(); diff --git a/scst/src/dev_handlers/scst_user_main.c b/scst/src/dev_handlers/scst_user_main.c index 613b31703..7315c6a7a 100644 --- a/scst/src/dev_handlers/scst_user_main.c +++ b/scst/src/dev_handlers/scst_user_main.c @@ -1384,7 +1384,7 @@ static int dev_user_process_reply_ext_copy_remap(struct scst_user_cmd *ucmd, int res = 0, rc, count = 0, i, len; struct scst_user_ext_copy_reply_remap *rreply = &reply->remap_reply; struct scst_cmd *cmd = ucmd->cmd; - uint8_t *buf; + u8 *buf; struct scst_user_ext_copy_data_descr *uleft; struct scst_ext_copy_data_descr *left = NULL; @@ -1525,7 +1525,7 @@ static int dev_user_process_ws_reply(struct scst_user_cmd *ucmd, { int res = 0, rc, count, i; struct scst_cmd *cmd = ucmd->cmd; - uint8_t *buf; + u8 *buf; struct scst_user_data_descriptor *uwhere; struct scst_data_descriptor *where; @@ -2274,7 +2274,7 @@ static int dev_user_reply_get_multi(struct file *file, int res = 0, rc; struct scst_user_dev *dev = file->private_data; struct scst_user_reply_cmd __user *replies; - int16_t i, replies_cnt, replies_done = 0, cmds_cnt = 0; + s16 i, replies_cnt, replies_done = 0, cmds_cnt = 0; TRACE_ENTRY(); @@ -3029,7 +3029,7 @@ static int dev_user_attach_tgt(struct scst_tgt_dev *tgt_dev) ucmd->user_cmd.cmd_h = ucmd->h; ucmd->user_cmd.subcode = SCST_USER_ATTACH_SESS; ucmd->user_cmd.sess.sess_h = (unsigned long)tgt_dev; - ucmd->user_cmd.sess.lun = (uint64_t)tgt_dev->lun; + ucmd->user_cmd.sess.lun = (u64)tgt_dev->lun; ucmd->user_cmd.sess.threads_num = tgt_dev->tgtt->threads_num; ucmd->user_cmd.sess.rd_only = tgt_dev->tgt_dev_rd_only; if (tgtt->get_phys_transport_version) @@ -3485,7 +3485,7 @@ static int dev_user_prealloc_buffer(struct file *file, void __user *arg) struct scst_user_dev *dev; union scst_user_prealloc_buffer pre; aligned_u64 pbuf; - uint32_t bufflen; + u32 bufflen; struct scst_user_cmd *ucmd; int pages, sg_cnt; struct sgv_pool *pool; diff --git a/scst/src/dev_handlers/scst_user_priv.h b/scst/src/dev_handlers/scst_user_priv.h index de994745d..da2492600 100644 --- a/scst/src/dev_handlers/scst_user_priv.h +++ b/scst/src/dev_handlers/scst_user_priv.h @@ -38,11 +38,11 @@ struct scst_user_dev { struct sgv_pool *pool; struct sgv_pool *pool_clust; - uint8_t parse_type; - uint8_t on_free_cmd_type; - uint8_t memory_reuse_type; - uint8_t partial_transfers_type; - uint32_t partial_len; + u8 parse_type; + u8 on_free_cmd_type; + u8 memory_reuse_type; + u8 partial_transfers_type; + u32 partial_len; struct scst_dev_type devtype; diff --git a/scst/src/dev_handlers/scst_vdisk_main.c b/scst/src/dev_handlers/scst_vdisk_main.c index 387537715..3ecbb3046 100644 --- a/scst/src/dev_handlers/scst_vdisk_main.c +++ b/scst/src/dev_handlers/scst_vdisk_main.c @@ -612,7 +612,7 @@ static struct scst_vdisk_dev *vdev_find(const char *name) #define VDEV_MODE_PAGES_BUF_SIZE (64 * 1024) #define VDEV_MODE_PAGES_DIR (SCST_VAR_DIR "/vdev_mode_pages") -static int __vdev_save_mode_pages(const struct scst_vdisk_dev *virt_dev, uint8_t *buf, int size) +static int __vdev_save_mode_pages(const struct scst_vdisk_dev *virt_dev, u8 *buf, int size) { int res = 0; @@ -638,7 +638,7 @@ out_overflow: static int vdev_save_mode_pages(const struct scst_vdisk_dev *virt_dev) { int res, rc, offs; - uint8_t *buf; + u8 *buf; int size; char *name, *name1; @@ -794,7 +794,7 @@ static int vdev_load_mode_pages(struct scst_vdisk_dev *virt_dev) { int res; struct scst_device *dev = virt_dev->dev; - uint8_t *buf; + u8 *buf; int size; char *name, *name1, *params; @@ -1528,10 +1528,10 @@ SCST_KUNIT_VISIBLE enum compl_status_e vdisk_synchronize_cache(struct vdisk_cmd_params *p) { struct scst_cmd *cmd = p->cmd; - const uint8_t *cdb = cmd->cdb; + const u8 *cdb = cmd->cdb; struct scst_device *dev = cmd->dev; const loff_t loff = p->loff; - int64_t data_len = scst_cmd_get_data_len(cmd); + s64 data_len = scst_cmd_get_data_len(cmd); int immed = cdb[1] & 0x2; enum compl_status_e res; @@ -1590,7 +1590,7 @@ static enum compl_status_e vdisk_exec_send_diagnostic(struct vdisk_cmd_params *p return CMD_SUCCEEDED; } -static int vdisk_format_dif(struct scst_cmd *cmd, uint64_t start_lba, uint64_t blocks) +static int vdisk_format_dif(struct scst_cmd *cmd, u64 start_lba, u64 blocks) { int res = 0; struct scst_device *dev = cmd->dev; @@ -1602,8 +1602,8 @@ static int vdisk_format_dif(struct scst_cmd *cmd, uint64_t start_lba, uint64_t b struct kvec *kvec; int max_kvec_segs, kvec_segs, i; struct page *kvec_page, *data_page; - uint8_t *data_buf; - int64_t left, done; + u8 *data_buf; + s64 left, done; TRACE_ENTRY(); @@ -1728,7 +1728,7 @@ static int vdisk_unmap_file_range(struct scst_cmd *cmd, struct scst_vdisk_dev *v } static int vdisk_unmap_range(struct scst_cmd *cmd, struct scst_vdisk_dev *virt_dev, - uint64_t start_lba, uint64_t blocks) + u64 start_lba, u64 blocks) { int res, err; @@ -1792,7 +1792,7 @@ static enum compl_status_e vdisk_exec_format_unit(struct vdisk_cmd_params *p) struct scst_cmd *cmd = p->cmd; struct scst_device *dev = cmd->dev; struct scst_vdisk_dev *virt_dev = dev->dh_priv; - uint8_t *buf; + u8 *buf; int prot_type = dev->dev_dif_type, pinfo; bool immed = false; @@ -2456,9 +2456,9 @@ static int vcdrom_get_supported_opcodes(struct scst_cmd *cmd, SCST_KUNIT_VISIBLE bool vdisk_parse_offset(struct vdisk_cmd_params *p, struct scst_cmd *cmd) { - uint64_t lba_start; - int64_t data_len; - uint8_t *cdb = cmd->cdb; + u64 lba_start; + s64 data_len; + u8 *cdb = cmd->cdb; int opcode = cdb[0]; loff_t loff; struct scst_device *dev = cmd->dev; @@ -2635,7 +2635,7 @@ static enum scst_exec_res vdev_do_job(struct scst_cmd *cmd, const vdisk_op_fn *ops) { enum scst_exec_res res; - uint8_t *cdb = cmd->cdb; + u8 *cdb = cmd->cdb; int opcode = cdb[0]; struct vdisk_cmd_params *p = cmd->dh_priv; struct scst_vdisk_dev *virt_dev; @@ -2850,11 +2850,11 @@ static enum compl_status_e vdev_verify(struct scst_cmd *cmd, loff_t loff) { loff_t err; ssize_t length, len_mem = 0; - uint8_t *address_sav, *address = NULL; + u8 *address_sav, *address = NULL; int compare; struct scst_vdisk_dev *virt_dev = cmd->dev->dh_priv; - uint8_t *mem_verify = NULL; - int64_t data_len = scst_cmd_get_data_len(cmd); + u8 *mem_verify = NULL; + s64 data_len = scst_cmd_get_data_len(cmd); TRACE_ENTRY(); @@ -3383,13 +3383,13 @@ out_done: goto out; } -static uint64_t vdisk_gen_dev_id_num(const char *virt_dev_name) +static u64 vdisk_gen_dev_id_num(const char *virt_dev_name) { - uint32_t dev_id_num; + u32 dev_id_num; dev_id_num = crc32c(0, virt_dev_name, strlen(virt_dev_name) + 1); - return ((uint64_t)scst_get_setup_id() << 32) | dev_id_num; + return ((u64)scst_get_setup_id() << 32) | dev_id_num; } static void vdisk_exec_write_same_unmap(struct vdisk_cmd_params *p) @@ -3407,7 +3407,7 @@ static void vdisk_exec_write_same_unmap(struct vdisk_cmd_params *p) goto out; } - if (unlikely((uint64_t)cmd->data_len > cmd->dev->max_write_same_len)) { + if (unlikely((u64)cmd->data_len > cmd->dev->max_write_same_len)) { PRINT_WARNING("Invalid WRITE SAME data len %lld (max allowed %lld)", (long long)cmd->data_len, (long long)cmd->dev->max_write_same_len); scst_set_invalid_field_in_cdb(cmd, cmd->len_off, 0); @@ -3427,7 +3427,7 @@ out: * trailing bytes with @fill_byte. */ static void scst_copy_and_fill_b(char *dst, const char *src, int len, - uint8_t fill_byte) + u8 fill_byte) { int cpy_len = min_t(int, strlen(src), len); @@ -3448,7 +3448,7 @@ static enum compl_status_e vdisk_exec_write_same(struct vdisk_cmd_params *p) { struct scst_cmd *cmd = p->cmd; enum compl_status_e res = CMD_SUCCEEDED; - uint8_t ctrl_offs = (cmd->cdb_len < 32) ? 1 : 10; + u8 ctrl_offs = (cmd->cdb_len < 32) ? 1 : 10; TRACE_ENTRY(); @@ -3483,7 +3483,7 @@ static enum compl_status_e vdisk_exec_unmap(struct vdisk_cmd_params *p) struct scst_vdisk_dev *virt_dev = cmd->dev->dh_priv; struct scst_data_descriptor *pd = cmd->cmd_data_descriptors; int i, cnt = cmd->cmd_data_descriptors_cnt; - uint32_t blocks_to_unmap; + u32 blocks_to_unmap; TRACE_ENTRY(); @@ -3535,7 +3535,7 @@ out: } /* Supported VPD Pages VPD page (00h). */ -static int vdisk_sup_vpd(uint8_t *buf, struct scst_cmd *cmd, +static int vdisk_sup_vpd(u8 *buf, struct scst_cmd *cmd, struct scst_vdisk_dev *virt_dev) { char *page_list = &buf[4], *p = page_list; @@ -3556,10 +3556,10 @@ static int vdisk_sup_vpd(uint8_t *buf, struct scst_cmd *cmd, } /* Unit Serial Number VPD page (80h) */ -static int vdisk_usn_vpd(uint8_t *buf, struct scst_cmd *cmd, +static int vdisk_usn_vpd(u8 *buf, struct scst_cmd *cmd, struct scst_vdisk_dev *virt_dev) { - uint16_t usn_len; + u16 usn_len; BUILD_BUG_ON(sizeof(virt_dev->usn) > INQ_BUF_SZ - 4); @@ -3577,11 +3577,11 @@ static int vdisk_usn_vpd(uint8_t *buf, struct scst_cmd *cmd, } /* Device Identification VPD page (83h) */ -static int vdisk_dev_id_vpd(uint8_t *buf, struct scst_cmd *cmd, +static int vdisk_dev_id_vpd(u8 *buf, struct scst_cmd *cmd, struct scst_vdisk_dev *virt_dev) { int i, eui64_len = 0, naa_len = 0, resp_len, num = 4; - uint16_t tg_id; + u16 tg_id; u8 *eui64_id = NULL, *naa_id = NULL; buf[1] = 0x83; @@ -3695,7 +3695,7 @@ static int vdisk_dev_id_vpd(uint8_t *buf, struct scst_cmd *cmd, } /* Extended INQUIRY Data (86h) */ -static int vdisk_ext_inq(uint8_t *buf, struct scst_cmd *cmd, +static int vdisk_ext_inq(u8 *buf, struct scst_cmd *cmd, struct scst_vdisk_dev *virt_dev) { struct scst_device *dev = cmd->dev; @@ -3730,7 +3730,7 @@ static int vdisk_ext_inq(uint8_t *buf, struct scst_cmd *cmd, } /* Block Limits VPD page (B0h) */ -static int vdisk_block_limits(uint8_t *buf, struct scst_cmd *cmd, +static int vdisk_block_limits(u8 *buf, struct scst_cmd *cmd, struct scst_vdisk_dev *virt_dev) { struct scst_device *dev = cmd->dev; @@ -3775,7 +3775,7 @@ static int vdisk_block_limits(uint8_t *buf, struct scst_cmd *cmd, } /* Block Device Characteristics VPD Page (B1h) */ -static int vdisk_bdev_char(uint8_t *buf, struct scst_cmd *cmd, +static int vdisk_bdev_char(u8 *buf, struct scst_cmd *cmd, struct scst_vdisk_dev *virt_dev) { buf[1] = 0xB1; @@ -3790,7 +3790,7 @@ static int vdisk_bdev_char(uint8_t *buf, struct scst_cmd *cmd, } /* Logical Block Provisioning a.k.a. Thin Provisioning VPD page (B2h) */ -static int vdisk_tp_vpd(uint8_t *buf, struct scst_cmd *cmd, +static int vdisk_tp_vpd(u8 *buf, struct scst_cmd *cmd, struct scst_vdisk_dev *virt_dev) { buf[1] = 0xB2; @@ -3803,7 +3803,7 @@ static int vdisk_tp_vpd(uint8_t *buf, struct scst_cmd *cmd, } /* Standard INQUIRY response */ -static int vdisk_inq(uint8_t *buf, struct scst_cmd *cmd, +static int vdisk_inq(u8 *buf, struct scst_cmd *cmd, struct scst_vdisk_dev *virt_dev) { struct scst_device *dev = cmd->dev; @@ -3863,7 +3863,7 @@ static int vdisk_inq(uint8_t *buf, struct scst_cmd *cmd, /* Physical transport */ if (cmd->tgtt->get_phys_transport_version) { - uint16_t v = cmd->tgtt->get_phys_transport_version(cmd->tgt); + u16 v = cmd->tgtt->get_phys_transport_version(cmd->tgt); if (v != 0) { put_unaligned_be16(v, &buf[58 + num]); @@ -3906,9 +3906,9 @@ static int vdisk_inq(uint8_t *buf, struct scst_cmd *cmd, static enum compl_status_e vdisk_exec_inquiry(struct vdisk_cmd_params *p) { struct scst_cmd *cmd = p->cmd; - int32_t length, resp_len; - uint8_t *address; - uint8_t *buf; + s32 length, resp_len; + u8 *address; + u8 *buf; struct scst_device *dev = cmd->dev; struct scst_vdisk_dev *virt_dev = dev->dh_priv; enum scst_tg_state alua_state; @@ -4015,9 +4015,9 @@ enum compl_status_e vdisk_exec_request_sense(struct vdisk_cmd_params *p) struct scst_vdisk_dev *virt_dev = dev->dh_priv; u64 done, total; bool format_active; - int32_t length, sl; - uint8_t *address; - uint8_t b[SCST_STANDARD_SENSE_LEN]; + s32 length, sl; + u8 *address; + u8 b[SCST_STANDARD_SENSE_LEN]; TRACE_ENTRY(); @@ -4099,8 +4099,8 @@ static int vdisk_rigid_geo_pg(unsigned char *p, int pcontrol, struct scst_vdisk_ unsigned char geo_m_pg[] = {0x04, 0x16, 0, 0, 0, DEF_HEADS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x3a, 0x98/* 15K RPM */, 0, 0}; - int32_t ncyl, n, rem; - uint64_t dividend; + s32 ncyl, n, rem; + u64 dividend; memcpy(p, geo_m_pg, sizeof(geo_m_pg)); /* @@ -4253,12 +4253,12 @@ static int vdisk_iec_m_pg(unsigned char *p, int pcontrol, struct scst_vdisk_dev static enum compl_status_e vdisk_exec_mode_sense(struct vdisk_cmd_params *p) { struct scst_cmd *cmd = p->cmd; - int32_t length; - uint8_t *address; - uint8_t *buf; + s32 length; + u8 *address; + u8 *buf; struct scst_vdisk_dev *virt_dev; - uint32_t blocksize; - uint64_t nblocks; + u32 blocksize; + u64 nblocks; unsigned char dbd, type; int pcontrol, pcode, subpcode; unsigned char dev_spec; @@ -4636,8 +4636,8 @@ out: static enum compl_status_e vdisk_exec_mode_select(struct vdisk_cmd_params *p) { struct scst_cmd *cmd = p->cmd; - int32_t length; - uint8_t *address; + s32 length; + u8 *address; struct scst_vdisk_dev *virt_dev; int mselect_6, offset, bdl, type; @@ -4740,12 +4740,12 @@ static enum compl_status_e vdisk_exec_log(struct vdisk_cmd_params *p) static enum compl_status_e vdisk_exec_read_capacity(struct vdisk_cmd_params *p) { struct scst_cmd *cmd = p->cmd; - int32_t length; - uint8_t *address; + s32 length; + u8 *address; struct scst_vdisk_dev *virt_dev; - uint32_t blocksize; - uint64_t nblocks; - uint8_t buffer[8]; + u32 blocksize; + u64 nblocks; + u8 buffer[8]; TRACE_ENTRY(); @@ -4754,7 +4754,7 @@ static enum compl_status_e vdisk_exec_read_capacity(struct vdisk_cmd_params *p) nblocks = virt_dev->nblocks; if ((cmd->cdb[8] & 1) == 0) { - uint32_t lba = get_unaligned_be32(&cmd->cdb[2]); + u32 lba = get_unaligned_be32(&cmd->cdb[2]); if (lba != 0) { TRACE_DBG("PMI zero and LBA not zero (cmd %p)", cmd); @@ -4801,12 +4801,12 @@ out: static enum compl_status_e vdisk_exec_read_capacity16(struct vdisk_cmd_params *p) { struct scst_cmd *cmd = p->cmd; - int32_t length; - uint8_t *address; + s32 length; + u8 *address; struct scst_vdisk_dev *virt_dev; - uint32_t blocksize; - uint64_t nblocks; - uint8_t buffer[32]; + u32 blocksize; + u64 nblocks; + u8 buffer[32]; TRACE_ENTRY(); @@ -4815,7 +4815,7 @@ static enum compl_status_e vdisk_exec_read_capacity16(struct vdisk_cmd_params *p nblocks = virt_dev->nblocks - 1; if ((cmd->cdb[14] & 1) == 0) { - uint32_t lba = get_unaligned_be32(&cmd->cdb[2]); + u32 lba = get_unaligned_be32(&cmd->cdb[2]); if (lba != 0) { TRACE_DBG("PMI zero and LBA not zero (cmd %p)", cmd); @@ -4850,7 +4850,7 @@ static enum compl_status_e vdisk_exec_read_capacity16(struct vdisk_cmd_params *p if (virt_dev->lb_per_pb_exp) { struct request_queue *q = virt_dev->bdev_desc.bdev ? bdev_get_queue(virt_dev->bdev_desc.bdev) : NULL; - uint32_t physical_blocksize = q ? queue_physical_block_size(q) : 4096; + u32 physical_blocksize = q ? queue_physical_block_size(q) : 4096; buffer[13] = max(ilog2(physical_blocksize) - ilog2(blocksize), 0); } @@ -4916,11 +4916,11 @@ vdisk_exec_maintenance_out(struct vdisk_cmd_params *p) static enum compl_status_e vdisk_exec_read_toc(struct vdisk_cmd_params *p) { struct scst_cmd *cmd = p->cmd; - int32_t length, off = 0; - uint8_t *address; + s32 length, off = 0; + u8 *address; struct scst_vdisk_dev *virt_dev; - uint32_t nblocks; - uint8_t buffer[4 + 8 + 8] = { 0x00, 0x0a, 0x01, 0x01, 0x00, 0x14, + u32 nblocks; + u8 buffer[4 + 8 + 8] = { 0x00, 0x0a, 0x01, 0x01, 0x00, 0x14, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 }; TRACE_ENTRY(); @@ -4951,7 +4951,7 @@ static enum compl_status_e vdisk_exec_read_toc(struct vdisk_cmd_params *p) virt_dev = cmd->dev->dh_priv; /* ToDo when you have > 8TB ROM device. */ - nblocks = (uint32_t)virt_dev->nblocks; + nblocks = (u32)virt_dev->nblocks; /* Header */ memset(buffer, 0, sizeof(buffer)); @@ -5072,7 +5072,7 @@ static int vdev_read_dif_tags(struct vdisk_cmd_params *p) loff_t loff; loff_t err = 0; ssize_t length, full_len; - uint8_t *address; + u8 *address; struct scst_vdisk_dev *virt_dev = cmd->dev->dh_priv; struct file *fd = virt_dev->dif_fd; struct kvec *kvec; @@ -5184,7 +5184,7 @@ static int vdev_write_dif_tags(struct vdisk_cmd_params *p) loff_t loff; loff_t err = 0; ssize_t length, full_len; - uint8_t *address; + u8 *address; struct scst_vdisk_dev *virt_dev = cmd->dev->dh_priv; struct file *fd = virt_dev->dif_fd; struct kvec *kvec, *ekvec; @@ -5368,7 +5368,7 @@ enum compl_status_e fileio_exec_write(struct vdisk_cmd_params *p) loff_t loff = p->loff; loff_t err = 0; ssize_t length, full_len; - uint8_t *address; + u8 *address; struct scst_vdisk_dev *virt_dev = cmd->dev->dh_priv; struct file *fd = virt_dev->fd; struct kvec *kvec, *ekvec; @@ -5997,7 +5997,7 @@ enum compl_status_e fileio_exec_read(struct vdisk_cmd_params *p) loff_t loff = p->loff; loff_t err = 0; ssize_t length, full_len; - uint8_t *address; + u8 *address; struct scst_device *dev = cmd->dev; struct scst_vdisk_dev *virt_dev = dev->dh_priv; struct file *fd = virt_dev->fd; @@ -6542,7 +6542,7 @@ static int vdev_create_node(struct scst_dev_type *devt, const char *name, int no { int res; struct scst_vdisk_dev *virt_dev, *vv; - uint64_t dev_id_num; + u64 dev_id_num; lockdep_assert_held(&scst_vdisk_mutex); @@ -8863,11 +8863,11 @@ static ssize_t vdev_sysfs_eui64_id_store(struct kobject *kobj, dev = container_of(kobj, struct scst_device, dev_kobj); virt_dev = dev->dh_priv; - while (count > 0 && isspace((uint8_t)buf[0])) { + while (count > 0 && isspace((u8)buf[0])) { buf++; count--; } - while (count > 0 && isspace((uint8_t)buf[count - 1])) + while (count > 0 && isspace((u8)buf[count - 1])) count--; if (count >= 2 && buf[0] == '0' && buf[1] == 'x') { buf += 2; @@ -8938,11 +8938,11 @@ static ssize_t vdev_sysfs_naa_id_store(struct kobject *kobj, dev = container_of(kobj, struct scst_device, dev_kobj); virt_dev = dev->dh_priv; - while (c > 0 && isspace((uint8_t)buf[0])) { + while (c > 0 && isspace((u8)buf[0])) { buf++; c--; } - while (c > 0 && isspace((uint8_t)buf[c - 1])) + while (c > 0 && isspace((u8)buf[c - 1])) c--; if (c >= 2 && buf[0] == '0' && buf[1] == 'x') { buf += 2; diff --git a/scst/src/dev_handlers/scst_vdisk_priv.h b/scst/src/dev_handlers/scst_vdisk_priv.h index f976c2eb7..ebc875f01 100644 --- a/scst/src/dev_handlers/scst_vdisk_priv.h +++ b/scst/src/dev_handlers/scst_vdisk_priv.h @@ -19,7 +19,7 @@ #define INQ_BUF_SZ 256 struct scst_vdisk_dev { - uint64_t nblocks; + u64 nblocks; unsigned int opt_trans_len; /* @@ -87,14 +87,14 @@ struct scst_vdisk_dev { #endif /* Protected by flags_lock, together with format_active. */ - uint64_t format_progress_to_do, format_progress_done; + u64 format_progress_to_do, format_progress_done; int virt_id; /* Name of the virtual device, must be <= SCSI Model + 1 */ char name[64 + 1]; /* File name, protected by scst_mutex and suspended activities */ char *filename; - uint16_t command_set_version; + u16 command_set_version; unsigned int initial_cluster_mode:1; @@ -114,15 +114,15 @@ struct scst_vdisk_dev { char scsi_device_name[256 + 1]; char t10_dev_id[16 + 8 + 2]; /* T10 device ID */ int eui64_id_len; - uint8_t eui64_id[16]; + u8 eui64_id[16]; int naa_id_len; - uint8_t naa_id[16]; + u8 naa_id[16]; char usn[MAX_USN_LEN]; - uint8_t inq_vend_specific[MAX_INQ_VEND_SPECIFIC_LEN]; + u8 inq_vend_specific[MAX_INQ_VEND_SPECIFIC_LEN]; int inq_vend_specific_len; /* Unmap INQUIRY parameters */ - uint32_t unmap_opt_gran, unmap_align, unmap_max_lba_cnt; + u32 unmap_opt_gran, unmap_align, unmap_max_lba_cnt; struct scst_device *dev; struct list_head vdev_list_entry; diff --git a/scst/src/scst_copy_mgr.c b/scst/src/scst_copy_mgr.c index a656e81ae..f2e73d820 100644 --- a/scst/src/scst_copy_mgr.c +++ b/scst/src/scst_copy_mgr.c @@ -70,7 +70,7 @@ struct scst_cm_desig { struct scst_tgt_dev *desig_tgt_dev; int desig_len; - uint8_t desig[]; + u8 desig[]; }; /* It's IRQ and inner for sess_list_lock */ @@ -91,13 +91,13 @@ struct scst_cm_list_id { unsigned int cm_can_be_immed_free:1; int cm_segs_processed; - int64_t cm_written_size; /* in bytes */ + s64 cm_written_size; /* in bytes */ unsigned long cm_time_to_free; /* in jiffies */ int cm_status; unsigned short cm_sense_len; - uint8_t cm_sense[SCST_SENSE_BUFFERSIZE]; + u8 cm_sense[SCST_SENSE_BUFFERSIZE]; }; struct scst_cm_internal_cmd_priv { @@ -150,8 +150,8 @@ struct scst_cm_ec_cmd_priv { ** READ commands stuff **/ struct scst_tgt_dev *cm_read_tgt_dev; - int64_t cm_start_read_lba; /* in blocks */ - int64_t cm_cur_read_lba; /* in blocks */ + s64 cm_start_read_lba; /* in blocks */ + s64 cm_cur_read_lba; /* in blocks */ int cm_left_to_read; /* in blocks */ int cm_max_each_read;/* in blocks */ @@ -159,8 +159,8 @@ struct scst_cm_ec_cmd_priv { ** WRITE commands stuff **/ struct scst_tgt_dev *cm_write_tgt_dev; - int64_t cm_start_write_lba; /* in blocks */ - int64_t cm_written; /* in bytes */ + s64 cm_start_write_lba; /* in blocks */ + s64 cm_written; /* in bytes */ /** ** Current data descriptors and their count @@ -578,7 +578,7 @@ static void scst_cm_advance_seg_descr(struct scst_cmd *ec_cmd) static void scst_cm_prepare_final_sense(struct scst_cmd *ec_cmd) { struct scst_cm_ec_cmd_priv *priv = ec_cmd->cmd_data_descriptors; - uint8_t add_sense_len, *fsense = NULL; + u8 add_sense_len, *fsense = NULL; int d_sense = scst_get_cmd_dev_d_sense(ec_cmd); bool copy_sense = false; int sense_to_copy = ec_cmd->sense_valid_len; @@ -885,11 +885,11 @@ static void scst_cm_del_free_from_internal_cmd_list(struct scst_cmd *cmd, bool u static void scst_cm_read_cmd_finished(struct scst_cmd *rcmd); /* cm_mutex suppose to be locked */ -static int __scst_cm_push_single_read(struct scst_cmd *ec_cmd, int64_t lba, int blocks) +static int __scst_cm_push_single_read(struct scst_cmd *ec_cmd, s64 lba, int blocks) { int res; struct scst_cm_ec_cmd_priv *priv = ec_cmd->cmd_data_descriptors; - uint8_t read_cdb[32]; + u8 read_cdb[32]; struct scst_device *rdev = priv->cm_read_tgt_dev->dev; int block_shift = rdev->block_shift; int len = blocks << block_shift; @@ -993,7 +993,7 @@ static void scst_cm_read_retry_fn(struct scst_cmd *rcmd) TRACE_EXIT(); } -static int scst_cm_push_single_write(struct scst_cmd *ec_cmd, int64_t lba, int blocks, +static int scst_cm_push_single_write(struct scst_cmd *ec_cmd, s64 lba, int blocks, struct scst_cmd *rcmd); static void scst_cm_write_retry_fn(struct scst_cmd *wcmd) @@ -1125,12 +1125,12 @@ out_finished: goto out_put; } -static int scst_cm_push_single_write(struct scst_cmd *ec_cmd, int64_t lba, int blocks, +static int scst_cm_push_single_write(struct scst_cmd *ec_cmd, s64 lba, int blocks, struct scst_cmd *rcmd) { int res; struct scst_cm_ec_cmd_priv *priv = ec_cmd->cmd_data_descriptors; - uint8_t write16_cdb[16]; + u8 write16_cdb[16]; struct scst_cmd *wcmd; int len; @@ -1199,7 +1199,7 @@ static void scst_cm_read_cmd_finished(struct scst_cmd *rcmd) struct scst_cm_internal_cmd_priv *p = rcmd->tgt_i_priv; struct scst_cmd *ec_cmd = p->cm_orig_cmd; struct scst_cm_ec_cmd_priv *priv = ec_cmd->cmd_data_descriptors; - int64_t lba; + s64 lba; int rc, len, blocks; TRACE_ENTRY(); @@ -1454,7 +1454,7 @@ static int scst_cm_try_to_remap(struct scst_cmd *ec_cmd) struct scst_ext_copy_seg_descr *sd = &priv->cm_seg_descrs[priv->cm_cur_seg_descr]; struct scst_ext_copy_data_descr *dd = &sd->data_descr; struct scst_dev_type *handler = ec_cmd->dev->handler; - uint8_t cdb[16]; + u8 cdb[16]; struct scst_cmd *cmd; TRACE_ENTRY(); @@ -1985,7 +1985,7 @@ void scst_cm_free_pending_list_ids(struct scst_session *sess) static void scst_cm_copy_status(struct scst_cmd *cmd) { ssize_t length = 0; - uint8_t *buf, tbuf[12]; + u8 *buf, tbuf[12]; int list_id; struct scst_cm_list_id *l; struct scst_session *sess = cmd->sess; @@ -2053,7 +2053,7 @@ out_list_id_not_found: static void scst_cm_failed_seg_details(struct scst_cmd *cmd) { ssize_t length = 0; - uint8_t *buf, *tbuf; + u8 *buf, *tbuf; int list_id, size; struct scst_cm_list_id *l; struct scst_session *sess = cmd->sess; @@ -2149,7 +2149,7 @@ out_busy: static void scst_cm_oper_parameters(struct scst_cmd *cmd) { ssize_t length = 0; - uint8_t *buf, tbuf[44 + 2] /* 2 descriptors implemented */; + u8 *buf, tbuf[44 + 2] /* 2 descriptors implemented */; TRACE_ENTRY(); @@ -2262,7 +2262,7 @@ static void scst_cm_inq_retry_fn(struct scst_cmd *cmd) static void scst_cm_init_inq_finish(struct scst_cmd *cmd) { int length, page_len, off, rc; - uint8_t *buf; + u8 *buf; struct scst_cm_init_inq_priv *priv = cmd->tgt_i_priv; struct scst_device *dev = priv->dev; @@ -2387,7 +2387,7 @@ SCST_KUNIT_VISIBLE int scst_cm_send_init_inquiry(struct scst_device *dev, unsigned int unpacked_lun, struct scst_cm_init_inq_priv *priv) { - static const uint8_t inq_cdb[6] = { INQUIRY, 1, 0x83, 0x10, 0, 0 }; + static const u8 inq_cdb[6] = { INQUIRY, 1, 0x83, 0x10, 0, 0 }; __be64 lun; struct scst_cmd *cmd; int res = 0; @@ -2415,7 +2415,7 @@ int scst_cm_send_init_inquiry(struct scst_device *dev, unsigned int unpacked_lun lun = scst_pack_lun(unpacked_lun, scst_cm_sess->acg->addr_method); - cmd = scst_rx_cmd(scst_cm_sess, (const uint8_t *)&lun, sizeof(lun), inq_cdb, + cmd = scst_rx_cmd(scst_cm_sess, (const u8 *)&lun, sizeof(lun), inq_cdb, sizeof(inq_cdb), false); if (!cmd) { res = -ENOMEM; @@ -2497,9 +2497,9 @@ out: return res; } -static uint64_t scst_cm_get_free_lun(void) +static u64 scst_cm_get_free_lun(void) { - uint64_t lun; + u64 lun; while (1) { lun = scst_cm_next_lun++; @@ -2516,7 +2516,7 @@ static uint64_t scst_cm_get_free_lun(void) } SCST_KUNIT_VISIBLE -int scst_cm_dev_register(struct scst_device *dev, uint64_t lun) +int scst_cm_dev_register(struct scst_device *dev, u64 lun) { int res; struct scst_acg_dev *acg_dev; @@ -2788,7 +2788,7 @@ struct scst_acg *scst_cm_default_acg(void) } /* scst_mutex supposed to be held */ -int scst_cm_on_add_lun(struct scst_acg_dev *acg_dev, uint64_t lun, unsigned int *flags) +int scst_cm_on_add_lun(struct scst_acg_dev *acg_dev, u64 lun, unsigned int *flags) { int res = 0; @@ -2939,7 +2939,7 @@ struct scst_cm_tgt_descr { }; /* Parse the copy source or copy destination (CSCD) descriptors. */ -static int scst_cm_parse_id_tgt_descr(struct scst_cmd *cmd, const uint8_t *seg, int offs, +static int scst_cm_parse_id_tgt_descr(struct scst_cmd *cmd, const u8 *seg, int offs, struct scst_cm_tgt_descr *tgt_descr) { int res = 32; @@ -3228,7 +3228,7 @@ out_enomem: goto out; } -static int scst_cm_parse_b2b_seg_descr(struct scst_cmd *ec_cmd, const uint8_t *seg, +static int scst_cm_parse_b2b_seg_descr(struct scst_cmd *ec_cmd, const u8 *seg, const struct scst_cm_tgt_descr *tgt_descrs, int tgt_descrs_cnt, int seg_num) { @@ -3377,7 +3377,7 @@ int scst_cm_parse_descriptors(struct scst_cmd *ec_cmd) int res = 0, rc; struct scst_cm_list_id *plist_id = NULL; ssize_t length = 0; - uint8_t *buf; + u8 *buf; int list_id, list_id_usage, len, tgt_len, seg_len; struct scst_cm_ec_cmd_priv *p; int tgt_cnt, seg_cnt, i, offs, t; @@ -3706,10 +3706,10 @@ static const struct attribute *scst_cm_tgtt_attrs[] = { static int scst_cm_get_initiator_port_transport_id(struct scst_tgt *tgt, struct scst_session *scst_sess, - uint8_t **transport_id) + u8 **transport_id) { int res = 0; - uint8_t *tid = NULL; + u8 *tid = NULL; TRACE_ENTRY(); diff --git a/scst/src/scst_copy_mgr_test.h b/scst/src/scst_copy_mgr_test.h index e93e7f9d9..b1e6c92e2 100644 --- a/scst/src/scst_copy_mgr_test.h +++ b/scst/src/scst_copy_mgr_test.h @@ -11,7 +11,7 @@ struct scst_cm_init_inq_priv; int scst_cm_send_init_inquiry(struct scst_device *dev, unsigned int unpacked_lun, struct scst_cm_init_inq_priv *priv); unsigned int scst_cm_get_lun(const struct scst_device *dev); -int scst_cm_dev_register(struct scst_device *dev, uint64_t lun); +int scst_cm_dev_register(struct scst_device *dev, u64 lun); void scst_cm_dev_free_designators(struct scst_device *dev); void scst_cm_update_dev_start(struct scst_device *dev); void scst_cm_update_dev_fini(struct scst_device *dev); diff --git a/scst/src/scst_dlm.c b/scst/src/scst_dlm.c index 8bb981e33..cf75e9d55 100644 --- a/scst/src/scst_dlm.c +++ b/scst/src/scst_dlm.c @@ -199,10 +199,10 @@ static void scst_dlm_force_unlock_and_drain(dlm_lockspace_t *ls, } /* Number of persistent reservation registrants. */ -static uint32_t scst_pr_num_regs(struct scst_device *dev) +static u32 scst_pr_num_regs(struct scst_device *dev) { struct scst_dev_registrant *reg; - uint32_t num_regs = 0; + u32 num_regs = 0; lockdep_assert_pr_read_lock_held(dev); @@ -321,7 +321,7 @@ static int scst_copy_from_dlm(struct scst_device *dev, dlm_lockspace_t *ls, struct scst_lksb *reg_lksb = NULL; struct scst_dev_registrant *reg, *tmp_reg; int i, res = -ENOMEM; - uint32_t nr_registrants; + u32 nr_registrants; u8 *reg_lvb_content = NULL; lockdep_assert_held(&pr_dlm->ls_mutex); @@ -383,7 +383,7 @@ static int scst_copy_from_dlm(struct scst_device *dev, dlm_lockspace_t *ls, for (i = 0; i < nr_registrants; i++) { struct pr_reg_lvb *reg_lvb; - uint16_t rel_tgt_id; + u16 rel_tgt_id; reg_lvb = (struct pr_reg_lvb *)reg_lksb[i].lksb.sb_lvbptr; rel_tgt_id = be16_to_cpu(reg_lvb->rel_tgt_id); @@ -525,7 +525,7 @@ static void scst_copy_to_dlm(struct scst_device *dev, dlm_lockspace_t *ls) struct scst_dev_registrant *reg; struct scst_dlm_rem_ua *ua; char reg_name[32]; - uint32_t nr_registrants, tid_size; + u32 nr_registrants, tid_size; lockdep_assert_held(&pr_dlm->ls_mutex); @@ -1013,7 +1013,7 @@ static dlm_lockspace_t *get_lockspace(struct scst_device *dev) char lsp_name[32], lock_name[32]; int res; bool modified_lvb = false; - uint32_t flags; + u32 flags; if (pr_dlm->ls || !pr_dlm->cl_dev_id || in_interrupt() || time_is_after_jiffies(pr_dlm->latest_lscr_attempt + 1 * HZ)) diff --git a/scst/src/scst_dlm.h b/scst/src/scst_dlm.h index 863d3e397..a005d6138 100644 --- a/scst/src/scst_dlm.h +++ b/scst/src/scst_dlm.h @@ -73,13 +73,13 @@ struct scst_pr_dlm_data { unsigned long latest_lscr_attempt; /* Corosync node ID of the local node. */ - uint32_t local_nodeid; + u32 local_nodeid; /* Number of elements in the nodeid array. */ int participants; /* Corosync cluster node ID's. Protected by ls_mutex. */ - uint32_t *nodeid; + u32 *nodeid; /* Workqueue for copy_from_dlm_work. */ struct workqueue_struct *from_wq; @@ -106,10 +106,10 @@ struct scst_pr_dlm_data { struct scst_lksb post_upd_lksb; /* PR_DATA_LOCK LVB. */ - uint8_t lvb[PR_DLM_LVB_LEN]; + u8 lvb[PR_DLM_LVB_LEN]; /* SPC-2 reservation state information. */ - uint32_t reserved_by_nodeid; + u32 reserved_by_nodeid; }; /** diff --git a/scst/src/scst_event.c b/scst/src/scst_event.c index 119a62b06..275883c72 100644 --- a/scst/src/scst_event.c +++ b/scst/src/scst_event.c @@ -290,7 +290,7 @@ static void scst_event_queue_work_fn(struct work_struct *work) } /* Can be called on IRQ with any lock held */ -void scst_event_queue(uint32_t event_code, const char *issuer_name, struct scst_event_entry *e) +void scst_event_queue(u32 event_code, const char *issuer_name, struct scst_event_entry *e) { TRACE_ENTRY(); @@ -604,7 +604,7 @@ static int scst_event_get_event_from_user(struct scst_event_user __user *arg, { int res, rc; int event_entry_len, event_len; - uint32_t payload_len; + u32 payload_len; struct scst_event_entry *event_entry; struct scst_event *event; @@ -759,7 +759,7 @@ out: static int scst_event_user_next_event(struct scst_event_priv *priv, void __user *arg) { int res, rc; - int32_t max_event_size, needed_size; + s32 max_event_size, needed_size; struct scst_event_entry *event_entry; struct scst_event_user __user *event_user = arg; diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 6d15b0055..14ee7bbfa 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -464,8 +464,8 @@ static int get_cdb_info_dyn_runtime_attr(struct scst_cmd *cmd, #define SCST_CDB_NOTSUPP ' ' /* don't use */ struct scst_sdbops { - uint8_t ops; /* SCSI-2 op codes */ - uint8_t devkey[16] __nonstring; /* Key for every device type M,O,V,R + u8 ops; /* SCSI-2 op codes */ + u8 devkey[16] __nonstring; /* Key for every device type M,O,V,R * type_disk devkey[0] * type_tape devkey[1] * type_printer devkey[2] @@ -483,11 +483,11 @@ struct scst_sdbops { * type_reserv devkey[E] * type_reserv devkey[F] */ - uint8_t info_lba_off; /* LBA offset in cdb */ - uint8_t info_lba_len; /* LBA length in cdb */ - uint8_t info_len_off; /* length offset in cdb */ - uint8_t info_len_len; /* length of length in cdb */ - uint8_t info_data_direction; + u8 info_lba_off; /* LBA offset in cdb */ + u8 info_lba_len; /* LBA length in cdb */ + u8 info_len_off; /* length offset in cdb */ + u8 info_len_len; /* length of length in cdb */ + u8 info_data_direction; /* * init --> target: SCST_DATA_WRITE * target --> init: SCST_DATA_READ @@ -495,8 +495,8 @@ struct scst_sdbops { * SCST_DATA_WRITE */ /* If not zero, logarithm base 2 of the maximum data buffer length. */ - uint8_t log2_max_buf_len; - uint32_t info_op_flags; /* various flags of this opcode */ + u8 log2_max_buf_len; + u32 info_op_flags; /* various flags of this opcode */ const char *info_op_name;/* op code SCSI full name */ int (*get_cdb_info)(struct scst_cmd *cmd, const struct scst_sdbops *sdbops); }; @@ -1646,13 +1646,13 @@ static const struct scst_sdbops scst_scsi_op_table[] = { static void scst_del_tgt_dev(struct scst_tgt_dev *tgt_dev); static void scst_check_internal_sense(struct scst_device *dev, int result, - uint8_t *sense, int sense_len); + u8 *sense, int sense_len); static void scst_queue_report_luns_changed_UA(struct scst_session *sess, int flags); static void __scst_check_set_UA(struct scst_tgt_dev *tgt_dev, - const uint8_t *sense, int sense_len, int flags); + const u8 *sense, int sense_len, int flags); static void scst_alloc_set_UA(struct scst_tgt_dev *tgt_dev, - const uint8_t *sense, int sense_len, int flags); + const u8 *sense, int sense_len, int flags); static void scst_free_all_UA(struct scst_tgt_dev *tgt_dev); static void scst_release_space(struct scst_cmd *cmd); static void scst_clear_reservation(struct scst_tgt_dev *tgt_dev); @@ -1711,7 +1711,7 @@ EXPORT_SYMBOL(scst_alloc_sense); * and error code otherwise. */ int scst_alloc_set_sense(struct scst_cmd *cmd, int atomic, - const uint8_t *sense, unsigned int len) + const u8 *sense, unsigned int len) { int res; @@ -1870,7 +1870,7 @@ out: static int scst_set_lun_not_supported_inquiry(struct scst_cmd *cmd) { - uint8_t *buf; + u8 *buf; struct scatterlist *sg; int len; int res = 0; @@ -1949,7 +1949,7 @@ out: static int scst_set_lun_not_supported_report_luns(struct scst_cmd *cmd) { - uint8_t *buf; + u8 *buf; int dev_cnt = 0; struct scatterlist *sg; struct scst_tgt_dev *tgt_dev = NULL; @@ -2136,7 +2136,7 @@ out: EXPORT_SYMBOL(scst_set_cmd_error); int scst_set_cmd_error_and_inf(struct scst_cmd *cmd, int key, int asc, - int ascq, uint64_t information) + int ascq, u64 information) { int res; @@ -2148,7 +2148,7 @@ int scst_set_cmd_error_and_inf(struct scst_cmd *cmd, int key, int asc, case 0x70: { /* Fixed format */ - uint32_t i = information; + u32 i = information; cmd->sense[0] |= 0x80; /* Information field is valid */ put_unaligned_be32(i, &cmd->sense[3]); @@ -2171,7 +2171,7 @@ out: } EXPORT_SYMBOL(scst_set_cmd_error_and_inf); -static void scst_fill_field_pointer_sense(uint8_t *fp_sense, int field_offs, +static void scst_fill_field_pointer_sense(u8 *fp_sense, int field_offs, int bit_offs, bool cdb) { /* Sense key specific */ @@ -2259,7 +2259,7 @@ EXPORT_SYMBOL(scst_set_invalid_field_in_parm_list); * Sets the corresponding fields in the sense buffer taking sense type * into account. Returns resulting sense length. */ -int scst_set_sense(uint8_t *buffer, int len, bool d_sense, +int scst_set_sense(u8 *buffer, int len, bool d_sense, int key, int asc, int ascq) { int res; @@ -2324,7 +2324,7 @@ EXPORT_SYMBOL(scst_set_sense); * Valid_mask is one or several SCST_SENSE_*_VALID constants setting valid * (key, asc, ascq) values. */ -bool scst_analyze_sense(const uint8_t *sense, int len, unsigned int valid_mask, +bool scst_analyze_sense(const u8 *sense, int len, unsigned int valid_mask, int key, int asc, int ascq) { bool res = false; @@ -2404,7 +2404,7 @@ EXPORT_SYMBOL(scst_analyze_sense); * Returns true if the sense is valid and carrying a Unit * Attention or false otherwise. */ -bool scst_is_ua_sense(const uint8_t *sense, int len) +bool scst_is_ua_sense(const u8 *sense, int len) { if (scst_sense_valid(sense)) return scst_analyze_sense(sense, len, @@ -2414,7 +2414,7 @@ bool scst_is_ua_sense(const uint8_t *sense, int len) } EXPORT_SYMBOL(scst_is_ua_sense); -bool scst_is_ua_global(const uint8_t *sense, int len) +bool scst_is_ua_global(const u8 *sense, int len) { bool res; @@ -2487,7 +2487,7 @@ out: } EXPORT_SYMBOL(scst_check_convert_sense); -int scst_set_cmd_error_sense(struct scst_cmd *cmd, uint8_t *sense, +int scst_set_cmd_error_sense(struct scst_cmd *cmd, u8 *sense, unsigned int len) { int res; @@ -2586,7 +2586,7 @@ void scst_set_initial_UA(struct scst_session *sess, int key, int asc, int ascq) EXPORT_SYMBOL(scst_set_initial_UA); struct scst_aen *scst_alloc_aen(struct scst_session *sess, - uint64_t unpacked_lun) + u64 unpacked_lun) { struct scst_aen *aen; @@ -2642,7 +2642,7 @@ void scst_gen_aen_or_ua(struct scst_tgt_dev *tgt_dev, { struct scst_session *sess = tgt_dev->sess; struct scst_tgt_template *tgtt = sess->tgt->tgtt; - uint8_t sense_buffer[SCST_STANDARD_SENSE_LEN]; + u8 sense_buffer[SCST_STANDARD_SENSE_LEN]; int sl; TRACE_ENTRY(); @@ -2752,7 +2752,7 @@ static inline bool scst_is_report_luns_changed_type(int type) static void scst_queue_report_luns_changed_UA(struct scst_session *sess, int flags) { - uint8_t sense_buffer[SCST_STANDARD_SENSE_LEN]; + u8 sense_buffer[SCST_STANDARD_SENSE_LEN]; struct list_head *head; struct scst_tgt_dev *tgt_dev; int i; @@ -2821,7 +2821,7 @@ static void scst_report_luns_changed_sess(struct scst_session *sess) int i; struct scst_tgt_template *tgtt = sess->tgt->tgtt; int d_sense = 0; - uint64_t lun = 0; + u64 lun = 0; TRACE_ENTRY(); @@ -2933,9 +2933,9 @@ void scst_aen_done(struct scst_aen *aen) } else { struct scst_session *sess = aen->sess; struct scst_tgt_dev *tgt_dev; - uint64_t lun; + u64 lun; - lun = scst_unpack_lun((uint8_t *)&aen->lun, sizeof(aen->lun)); + lun = scst_unpack_lun((u8 *)&aen->lun, sizeof(aen->lun)); rcu_read_lock(); /* tgt_dev might get dead, so we need to reseek it */ @@ -2957,7 +2957,7 @@ out_free: } EXPORT_SYMBOL(scst_aen_done); -void scst_requeue_ua(struct scst_cmd *cmd, const uint8_t *buf, int size) +void scst_requeue_ua(struct scst_cmd *cmd, const u8 *buf, int size) { TRACE_ENTRY(); @@ -3360,7 +3360,7 @@ EXPORT_SYMBOL(scst_get_opcode_name); void scst_zero_write_rest(struct scst_cmd *cmd) { int len, offs = 0; - uint8_t *buf; + u8 *buf; TRACE_ENTRY(); @@ -4147,7 +4147,7 @@ bool __scst_is_relative_target_port_id_unique(u16 id, const struct scst_tgt *t) } /* scst_mutex supposed to be locked */ -bool scst_is_relative_target_port_id_unique(uint16_t id, +bool scst_is_relative_target_port_id_unique(u16 id, const struct scst_tgt *t) { bool res; @@ -4184,7 +4184,7 @@ int scst_alloc_relative_target_port_id(u16 *id, unsigned int *next) return -EOVERFLOW; } -int gen_relative_target_port_id(uint16_t *id) +int gen_relative_target_port_id(u16 *id) { static unsigned int next = SCST_MIN_REL_TGT_ID; int res; @@ -4410,12 +4410,12 @@ void scst_init_mem_lim(struct scst_mem_lim *mem_lim) { atomic_set(&mem_lim->alloced_pages, 0); mem_lim->max_allowed_pages = - ((uint64_t)scst_max_dev_cmd_mem << 10) >> (PAGE_SHIFT - 10); + ((u64)scst_max_dev_cmd_mem << 10) >> (PAGE_SHIFT - 10); } EXPORT_SYMBOL_GPL(scst_init_mem_lim); static struct scst_acg_dev *scst_alloc_acg_dev(struct scst_acg *acg, - struct scst_device *dev, uint64_t lun) + struct scst_device *dev, u64 lun) { struct scst_acg_dev *res; @@ -4588,7 +4588,7 @@ void scst_tgt_dev_sysfs_remove(struct scst_tgt_dev *tgt_dev) /* The caller must hold scst_mutex. */ int scst_acg_add_lun(struct scst_acg *acg, struct kobject *parent, - struct scst_device *dev, uint64_t lun, unsigned int flags, + struct scst_device *dev, u64 lun, unsigned int flags, struct scst_acg_dev **out_acg_dev) { int res; @@ -4683,7 +4683,7 @@ out_free: /* Delete a LUN without generating a unit attention. */ static struct scst_acg_dev *__scst_acg_del_lun(struct scst_acg *acg, - uint64_t lun, + u64 lun, struct list_head *tgt_dev_list, bool *report_luns_changed) { @@ -4747,7 +4747,7 @@ static void scst_wait_for_tgt_devs(struct list_head *tgt_dev_list) msleep(100); } -int scst_acg_del_lun(struct scst_acg *acg, uint64_t lun, +int scst_acg_del_lun(struct scst_acg *acg, u64 lun, bool gen_report_luns_changed) { int res = 0; @@ -4874,7 +4874,7 @@ void scst_async_lun_replace_set(bool val) /* Either add or replace a LUN according to flags argument */ int scst_acg_repl_lun(struct scst_acg *acg, struct kobject *parent, - struct scst_device *dev, uint64_t lun, + struct scst_device *dev, u64 lun, unsigned int flags) { struct scst_acg_dev *acg_dev; @@ -5532,7 +5532,7 @@ int scst_alloc_add_tgt_dev(struct scst_session *sess, struct scst_device *dev = acg_dev->dev; struct list_head *head; int sl; - uint8_t sense_buffer[SCST_STANDARD_SENSE_LEN]; + u8 sense_buffer[SCST_STANDARD_SENSE_LEN]; SCST_KUNIT_REDIRECT(scst_alloc_add_tgt_dev, sess, acg_dev, out_tgt_dev); @@ -5732,7 +5732,7 @@ void scst_nexus_loss(struct scst_tgt_dev *tgt_dev, bool queue_UA) TRACE_ENTRY(); if (queue_UA) { - uint8_t sense_buffer[SCST_STANDARD_SENSE_LEN]; + u8 sense_buffer[SCST_STANDARD_SENSE_LEN]; int sl = scst_set_sense(sense_buffer, sizeof(sense_buffer), tgt_dev->dev->d_sense, SCST_LOAD_SENSE(scst_sense_nexus_loss_UA)); @@ -5981,7 +5981,7 @@ out: * * Return: pointer to the newly allocated command or NULL. */ -struct scst_cmd *__scst_create_prepare_internal_cmd(const uint8_t *cdb, +struct scst_cmd *__scst_create_prepare_internal_cmd(const u8 *cdb, unsigned int cdb_len, enum scst_cmd_queue_type queue_type, struct scst_tgt_dev *tgt_dev, gfp_t gfp_mask, bool fantom) { @@ -6041,7 +6041,7 @@ out: } static struct scst_cmd *scst_create_prepare_internal_cmd( - struct scst_cmd *orig_cmd, const uint8_t *cdb, + struct scst_cmd *orig_cmd, const u8 *cdb, unsigned int cdb_len, enum scst_cmd_queue_type queue_type) { struct scst_cmd *res; @@ -6087,7 +6087,7 @@ static void scst_complete_request_sense(struct scst_cmd *req_cmd); int scst_prepare_request_sense(struct scst_cmd *orig_cmd) { - static const uint8_t request_sense[6] = { + static const u8 request_sense[6] = { REQUEST_SENSE, 0, 0, 0, SCST_SENSE_BUFFERSIZE, 0 }; struct scst_request_sense_priv *priv; @@ -6145,7 +6145,7 @@ static void scst_complete_request_sense(struct scst_cmd *req_cmd) { struct scst_request_sense_priv *priv = req_cmd->tgt_i_priv; struct scst_cmd *orig_cmd = priv->orig_cmd; - uint8_t *buf; + u8 *buf; int len; TRACE_ENTRY(); @@ -6468,13 +6468,13 @@ int scst_ws_build_write_cdb(const struct scst_write_same_priv *wsp, /* ws_mutex suppose to be locked */ static int scst_ws_push_single_write(struct scst_write_same_priv *wsp, - int64_t lba, int blocks) + s64 lba, int blocks) { struct scst_cmd *ws_cmd = wsp->ws_orig_cmd; struct scatterlist *ws_sg; int ws_sg_cnt; int res; - uint8_t write_cdb[32]; + u8 write_cdb[32]; int write_cdb_len; int len = blocks << ws_cmd->dev->block_shift; struct scst_cmd *cmd; @@ -6833,7 +6833,7 @@ void scst_write_same(struct scst_cmd *cmd, struct scst_data_descriptor *where) int i, rc; struct page *pg = NULL; unsigned int offset, length, mult, ws_sg_full_blocks, ws_sg_tail_blocks; - uint8_t ctrl_offs = (cmd->cdb_len < 32) ? 1 : 10; + u8 ctrl_offs = (cmd->cdb_len < 32) ? 1 : 10; TRACE_ENTRY(); @@ -6857,7 +6857,7 @@ void scst_write_same(struct scst_cmd *cmd, struct scst_data_descriptor *where) goto out_done; } - if (unlikely((uint64_t)cmd->data_len > cmd->dev->max_write_same_len)) { + if (unlikely((u64)cmd->data_len > cmd->dev->max_write_same_len)) { PRINT_WARNING("Invalid WRITE SAME data len %lld (max allowed %lld)", (long long)cmd->data_len, (long long)cmd->dev->max_write_same_len); @@ -7063,7 +7063,7 @@ static void scst_cwr_read_cmd_finished(struct scst_cmd *cmd) struct scst_cwr_priv *cwrp = cmd->tgt_i_priv; struct scst_cmd *cwr_cmd = cwrp->cwr_orig_cmd; bool c, dif; - uint8_t write16_cdb[16]; + u8 write16_cdb[16]; struct scst_cmd *wcmd; int data_len, miscompare_offs, rc; @@ -7181,10 +7181,10 @@ enum scst_exec_res scst_cmp_wr_local(struct scst_cmd *cmd) { enum scst_exec_res res = SCST_EXEC_COMPLETED; struct scst_cwr_priv *cwrp; - uint8_t read16_cdb[16]; + u8 read16_cdb[16]; struct scst_cmd *rcmd; const int data_len = cmd->data_len; - const uint32_t num_lbas = data_len >> cmd->dev->block_shift; + const u32 num_lbas = data_len >> cmd->dev->block_shift; TRACE_ENTRY(); @@ -7315,7 +7315,7 @@ static void scst_send_release(struct scst_device *dev) { struct scsi_device *scsi_dev; unsigned char cdb[6]; - uint8_t sense[SCSI_SENSE_BUFFERSIZE]; + u8 sense[SCSI_SENSE_BUFFERSIZE]; int rc, i; TRACE_ENTRY(); @@ -7574,7 +7574,7 @@ EXPORT_SYMBOL(scst_cmd_put); * scst_cmd_set_ext_cdb() - sets cmd's extended CDB and its length */ void scst_cmd_set_ext_cdb(struct scst_cmd *cmd, - uint8_t *ext_cdb, unsigned int ext_cdb_len, + u8 *ext_cdb, unsigned int ext_cdb_len, gfp_t gfp_mask) { unsigned int len = cmd->cdb_len + ext_cdb_len; @@ -7616,7 +7616,7 @@ out_err: } EXPORT_SYMBOL(scst_cmd_set_ext_cdb); -int scst_pre_init_cmd(struct scst_cmd *cmd, const uint8_t *cdb, +int scst_pre_init_cmd(struct scst_cmd *cmd, const u8 *cdb, unsigned int cdb_len, gfp_t gfp_mask) { int res; @@ -7627,7 +7627,7 @@ int scst_pre_init_cmd(struct scst_cmd *cmd, const uint8_t *cdb, /* cmd supposed to be zeroed */ { int i; - uint8_t *b = (uint8_t *)cmd; + u8 *b = (u8 *)cmd; for (i = 0; i < sizeof(*cmd); i++) EXTRACHECKS_BUG_ON(b[i] != 0); @@ -7690,7 +7690,7 @@ out: return res; } -struct scst_cmd *scst_alloc_cmd(const uint8_t *cdb, +struct scst_cmd *scst_alloc_cmd(const u8 *cdb, unsigned int cdb_len, gfp_t gfp_mask) { struct scst_cmd *cmd; @@ -9389,7 +9389,7 @@ EXPORT_SYMBOL_GPL(scst_copy_sg); * and copies the buffer there. Returns length of the buffer or negative * error code otherwise. */ -int scst_get_buf_full(struct scst_cmd *cmd, uint8_t **buf, bool always_copy) +int scst_get_buf_full(struct scst_cmd *cmd, u8 **buf, bool always_copy) { int res = 0; @@ -9399,7 +9399,7 @@ int scst_get_buf_full(struct scst_cmd *cmd, uint8_t **buf, bool always_copy) if (scst_get_buf_count(cmd) > 1) { int len; - uint8_t *tmp_buf; + u8 *tmp_buf; int full_size; full_size = 0; @@ -9426,7 +9426,7 @@ int scst_get_buf_full(struct scst_cmd *cmd, uint8_t **buf, bool always_copy) if (scst_cmd_get_data_direction(cmd) == SCST_DATA_WRITE || always_copy) { - uint8_t *buf_ptr; + u8 *buf_ptr; buf_ptr = *buf; @@ -9457,7 +9457,7 @@ EXPORT_SYMBOL(scst_get_buf_full); * Does the same as scst_get_buf_full(), but in case of error * additionally sets in cmd status code and sense. */ -int scst_get_buf_full_sense(struct scst_cmd *cmd, uint8_t **buf) +int scst_get_buf_full_sense(struct scst_cmd *cmd, u8 **buf) { int res = 0; @@ -9488,7 +9488,7 @@ EXPORT_SYMBOL(scst_get_buf_full_sense); * Reverse operation for scst_get_buf_full()/scst_get_buf_full_sense(). * If the buffer was vmalloced(), it vfree() the buffer. */ -void scst_put_buf_full(struct scst_cmd *cmd, uint8_t *buf) +void scst_put_buf_full(struct scst_cmd *cmd, u8 *buf) { TRACE_ENTRY(); @@ -9498,7 +9498,7 @@ void scst_put_buf_full(struct scst_cmd *cmd, uint8_t *buf) if (cmd->sg_buff_vmallocated) { if (scst_cmd_get_data_direction(cmd) == SCST_DATA_READ) { int len; - uint8_t *tmp_buf, *buf_p; + u8 *tmp_buf, *buf_p; buf_p = buf; @@ -9541,9 +9541,9 @@ static int scst_verify_dif_type1(struct scst_cmd *cmd) enum scst_dif_actions checks = scst_get_dif_checks(cmd->cmd_dif_actions); int len, tags_len = 0, tag_size = 1 << SCST_DIF_TAG_SHIFT; struct scatterlist *tags_sg = NULL; - uint8_t *buf, *tags_buf = NULL; + u8 *buf, *tags_buf = NULL; const struct t10_pi_tuple *t = NULL; /* to silence compiler warning */ - uint64_t lba = cmd->lba; + u64 lba = cmd->lba; int block_size = dev->block_size, block_shift = dev->block_shift; __be16 (*crc_fn)(const void *buffer, unsigned int len); @@ -9568,7 +9568,7 @@ static int scst_verify_dif_type1(struct scst_cmd *cmd) len = scst_get_buf_first(cmd, &buf); while (len > 0) { int i; - uint8_t *cur_buf = buf; + u8 *cur_buf = buf; for (i = 0; i < (len >> block_shift); i++) { if (tags_buf == NULL) { @@ -9696,9 +9696,9 @@ static int scst_generate_dif_type1(struct scst_cmd *cmd) struct scst_device *dev = cmd->dev; int len, tags_len = 0, tag_size = 1 << SCST_DIF_TAG_SHIFT; struct scatterlist *tags_sg = NULL; - uint8_t *buf, *tags_buf = NULL; + u8 *buf, *tags_buf = NULL; struct t10_pi_tuple *t = NULL; /* to silence compiler warning */ - uint64_t lba = cmd->lba; + u64 lba = cmd->lba; int block_size = dev->block_size, block_shift = dev->block_shift; __be16 (*crc_fn)(const void *buffer, unsigned int len); @@ -9721,7 +9721,7 @@ static int scst_generate_dif_type1(struct scst_cmd *cmd) len = scst_get_buf_first(cmd, &buf); while (len > 0) { int i; - uint8_t *cur_buf = buf; + u8 *cur_buf = buf; TRACE_DBG("len %d", len); @@ -9973,12 +9973,12 @@ static int scst_verify_dif_type2(struct scst_cmd *cmd) enum scst_dif_actions checks = scst_get_dif_checks(cmd->cmd_dif_actions); int len, tags_len = 0, tag_size = 1 << SCST_DIF_TAG_SHIFT; struct scatterlist *tags_sg = NULL; - uint8_t *buf, *tags_buf = NULL; + u8 *buf, *tags_buf = NULL; const struct t10_pi_tuple *t = NULL; /* to silence compiler warning */ - uint64_t lba = cmd->lba; + u64 lba = cmd->lba; int block_size = dev->block_size, block_shift = dev->block_shift; __be16 (*crc_fn)(const void *buffer, unsigned int len); - uint32_t ref_tag = scst_cmd_get_dif_exp_ref_tag(cmd); + u32 ref_tag = scst_cmd_get_dif_exp_ref_tag(cmd); /* Let's keep both in BE */ __be16 app_tag_mask = cpu_to_be16(scst_cmd_get_dif_app_tag_mask(cmd)); __be16 app_tag_masked = cpu_to_be16(scst_cmd_get_dif_exp_app_tag(cmd)) & app_tag_mask; @@ -10004,7 +10004,7 @@ static int scst_verify_dif_type2(struct scst_cmd *cmd) len = scst_get_buf_first(cmd, &buf); while (len > 0) { int i; - uint8_t *cur_buf = buf; + u8 *cur_buf = buf; for (i = 0; i < (len >> block_shift); i++) { if (tags_buf == NULL) { @@ -10098,11 +10098,11 @@ static int scst_generate_dif_type2(struct scst_cmd *cmd) struct scst_device *dev = cmd->dev; int len, tags_len = 0, tag_size = 1 << SCST_DIF_TAG_SHIFT; struct scatterlist *tags_sg = NULL; - uint8_t *buf, *tags_buf = NULL; + u8 *buf, *tags_buf = NULL; struct t10_pi_tuple *t = NULL; /* to silence compiler warning */ int block_size = dev->block_size, block_shift = dev->block_shift; __be16 (*crc_fn)(const void *buffer, unsigned int len); - uint32_t ref_tag = scst_cmd_get_dif_exp_ref_tag(cmd); + u32 ref_tag = scst_cmd_get_dif_exp_ref_tag(cmd); /* Let's keep both in BE */ __be16 app_tag_mask = cpu_to_be16(scst_cmd_get_dif_app_tag_mask(cmd)); __be16 app_tag_masked = cpu_to_be16(scst_cmd_get_dif_exp_app_tag(cmd)) & app_tag_mask; @@ -10126,7 +10126,7 @@ static int scst_generate_dif_type2(struct scst_cmd *cmd) len = scst_get_buf_first(cmd, &buf); while (len > 0) { int i; - uint8_t *cur_buf = buf; + u8 *cur_buf = buf; TRACE_DBG("len %d", len); @@ -10187,9 +10187,9 @@ static int scst_verify_dif_type3(struct scst_cmd *cmd) enum scst_dif_actions checks = scst_get_dif_checks(cmd->cmd_dif_actions); int len, tags_len = 0, tag_size = 1 << SCST_DIF_TAG_SHIFT; struct scatterlist *tags_sg = NULL; - uint8_t *buf, *tags_buf = NULL; + u8 *buf, *tags_buf = NULL; const struct t10_pi_tuple *t = NULL; /* to silence compiler warning */ - uint64_t lba = cmd->lba; + u64 lba = cmd->lba; int block_size = dev->block_size, block_shift = dev->block_shift; __be16 (*crc_fn)(const void *buffer, unsigned int len); @@ -10214,7 +10214,7 @@ static int scst_verify_dif_type3(struct scst_cmd *cmd) len = scst_get_buf_first(cmd, &buf); while (len > 0) { int i; - uint8_t *cur_buf = buf; + u8 *cur_buf = buf; for (i = 0; i < (len >> block_shift); i++) { if (tags_buf == NULL) { @@ -10309,7 +10309,7 @@ static int scst_generate_dif_type3(struct scst_cmd *cmd) struct scst_device *dev = cmd->dev; int len, tags_len = 0, tag_size = 1 << SCST_DIF_TAG_SHIFT; struct scatterlist *tags_sg = NULL; - uint8_t *buf, *tags_buf = NULL; + u8 *buf, *tags_buf = NULL; struct t10_pi_tuple *t = NULL; /* to silence compiler warning */ int block_size = dev->block_size, block_shift = dev->block_shift; __be16 (*crc_fn)(const void *buffer, unsigned int len); @@ -10333,7 +10333,7 @@ static int scst_generate_dif_type3(struct scst_cmd *cmd) len = scst_get_buf_first(cmd, &buf); while (len > 0) { int i; - uint8_t *cur_buf = buf; + u8 *cur_buf = buf; TRACE_DBG("len %d", len); @@ -10428,7 +10428,7 @@ static void scst_init_dif_checks(struct scst_device *dev) void scst_dev_set_dif_static_app_tag_combined( struct scst_device *dev, __be64 app_tag) { - uint64_t a = be64_to_cpu(app_tag); + u64 a = be64_to_cpu(app_tag); dev->dev_dif_static_app_tag = cpu_to_be16(a & 0xFFFF); if (dev->dev_dif_type == 3) @@ -11905,7 +11905,7 @@ static int get_cdb_info_write_same(struct scst_cmd *cmd, const struct scst_sdbops *sdbops, const bool ndob) { - const uint8_t ctrl_offs = cmd->cdb_len < 32 ? 1 : 10; + const u8 ctrl_offs = cmd->cdb_len < 32 ? 1 : 10; const bool anchor = (cmd->cdb[ctrl_offs] >> 4) & 1; const bool unmap = (cmd->cdb[ctrl_offs] >> 3) & 1; @@ -12292,7 +12292,7 @@ int scst_get_cdb_info(struct scst_cmd *cmd) { int dev_type = cmd->dev->type; int i, res = 0; - uint8_t op; + u8 op; const struct scst_sdbops *ptr = NULL; TRACE_ENTRY(); @@ -12345,9 +12345,9 @@ out: EXPORT_SYMBOL_GPL(scst_get_cdb_info); /* Packs SCST LUN back to SCSI form */ -__be64 scst_pack_lun(const uint64_t lun, enum scst_lun_addr_method addr_method) +__be64 scst_pack_lun(const u64 lun, enum scst_lun_addr_method addr_method) { - uint64_t res = 0; + u64 res = 0; if (lun) { res = (addr_method << 14) | (lun & 0x3fff); @@ -12364,9 +12364,9 @@ EXPORT_SYMBOL(scst_pack_lun); * order (big endian). Supports three LUN addressing methods: peripheral, flat * and logical unit. See also SAM-2, section 4.9.4 (page 40). */ -uint64_t scst_unpack_lun(const uint8_t *lun, int len) +u64 scst_unpack_lun(const u8 *lun, int len) { - uint64_t res = NO_SUCH_LUN; + u64 res = NO_SUCH_LUN; int address_method; TRACE_ENTRY(); @@ -12608,7 +12608,7 @@ int scst_tape_generic_parse(struct scst_cmd *cmd) */ if (cmd->op_flags & SCST_TRANSFER_LEN_TYPE_FIXED && cmd->cdb[1] & 1) { - uint32_t block_size = cmd->dev->block_size; + u32 block_size = cmd->dev->block_size; u64 max_blocks = LLONG_MAX; bool overflow; @@ -12817,7 +12817,7 @@ int scst_block_generic_dev_done(struct scst_cmd *cmd, if (scst_cmd_completed_good(cmd)) { /* Always keep track of disk capacity */ int buffer_size, sector_size, sh; - uint8_t *buffer; + u8 *buffer; /* Inspect the data returned by the backend, including split SGs. */ buffer_size = scst_get_buf_full(cmd, &buffer, true); @@ -12858,7 +12858,7 @@ int scst_tape_generic_dev_done(struct scst_cmd *cmd, int opcode = cmd->cdb[0]; int res = SCST_CMD_STATE_DEFAULT; int buffer_size, bs; - uint8_t *buffer = NULL; + u8 *buffer = NULL; TRACE_ENTRY(); @@ -12914,9 +12914,9 @@ out: } EXPORT_SYMBOL_GPL(scst_tape_generic_dev_done); -typedef void (*scst_set_cdb_lba_fn_t)(struct scst_cmd *cmd, int64_t lba); +typedef void (*scst_set_cdb_lba_fn_t)(struct scst_cmd *cmd, s64 lba); -static void scst_set_cdb_lba1(struct scst_cmd *cmd, int64_t lba) +static void scst_set_cdb_lba1(struct scst_cmd *cmd, s64 lba) { TRACE_ENTRY(); @@ -12925,7 +12925,7 @@ static void scst_set_cdb_lba1(struct scst_cmd *cmd, int64_t lba) TRACE_EXIT(); } -static void scst_set_cdb_lba2(struct scst_cmd *cmd, int64_t lba) +static void scst_set_cdb_lba2(struct scst_cmd *cmd, s64 lba) { TRACE_ENTRY(); @@ -12934,7 +12934,7 @@ static void scst_set_cdb_lba2(struct scst_cmd *cmd, int64_t lba) TRACE_EXIT(); } -static void scst_set_cdb_lba3(struct scst_cmd *cmd, int64_t lba) +static void scst_set_cdb_lba3(struct scst_cmd *cmd, s64 lba) { TRACE_ENTRY(); @@ -12943,7 +12943,7 @@ static void scst_set_cdb_lba3(struct scst_cmd *cmd, int64_t lba) TRACE_EXIT(); } -static void scst_set_cdb_lba4(struct scst_cmd *cmd, int64_t lba) +static void scst_set_cdb_lba4(struct scst_cmd *cmd, s64 lba) { TRACE_ENTRY(); @@ -12952,7 +12952,7 @@ static void scst_set_cdb_lba4(struct scst_cmd *cmd, int64_t lba) TRACE_EXIT(); } -static void scst_set_cdb_lba8(struct scst_cmd *cmd, int64_t lba) +static void scst_set_cdb_lba8(struct scst_cmd *cmd, s64 lba) { TRACE_ENTRY(); @@ -12969,7 +12969,7 @@ static const scst_set_cdb_lba_fn_t scst_set_cdb_lba_fns[9] = { [8] = scst_set_cdb_lba8, }; -int scst_set_cdb_lba(struct scst_cmd *cmd, int64_t lba) +int scst_set_cdb_lba(struct scst_cmd *cmd, s64 lba) { int res; @@ -13059,7 +13059,7 @@ int scst_set_cdb_transf_len(struct scst_cmd *cmd, int len) EXPORT_SYMBOL_GPL(scst_set_cdb_transf_len); static void scst_check_internal_sense(struct scst_device *dev, int result, - uint8_t *sense, int sense_len) + u8 *sense, int sense_len) { TRACE_ENTRY(); @@ -13174,7 +13174,7 @@ void scst_process_reset(struct scst_device *dev, } if (setUA) { - uint8_t sense_buffer[SCST_STANDARD_SENSE_LEN]; + u8 sense_buffer[SCST_STANDARD_SENSE_LEN]; int sl = scst_set_sense(sense_buffer, sizeof(sense_buffer), dev->d_sense, SCST_LOAD_SENSE(scst_sense_reset_UA)); /* @@ -13205,7 +13205,7 @@ void scst_tgt_dev_del_free_UA(struct scst_tgt_dev *tgt_dev, } /* No locks, no IRQ or IRQ-disabled context allowed */ -int scst_set_pending_UA(struct scst_cmd *cmd, uint8_t *buf, int *size) +int scst_set_pending_UA(struct scst_cmd *cmd, u8 *buf, int *size) { int res = 0, i; struct scst_tgt_dev_UA *UA_entry; @@ -13359,7 +13359,7 @@ out: * there's only one user of tgt_dev. */ static void scst_alloc_set_UA(struct scst_tgt_dev *tgt_dev, - const uint8_t *sense, int sense_len, int flags) + const u8 *sense, int sense_len, int flags) { struct scst_tgt_dev_UA *UA_entry = NULL; @@ -13402,7 +13402,7 @@ out: /* tgt_dev_lock supposed to be held and BH off */ static void __scst_check_set_UA(struct scst_tgt_dev *tgt_dev, - const uint8_t *sense, int sense_len, int flags) + const u8 *sense, int sense_len, int flags) { int skip_UA = 0; struct scst_tgt_dev_UA *UA_entry_tmp; @@ -13430,7 +13430,7 @@ static void __scst_check_set_UA(struct scst_tgt_dev *tgt_dev, } void scst_check_set_UA(struct scst_tgt_dev *tgt_dev, - const uint8_t *sense, int sense_len, int flags) + const u8 *sense, int sense_len, int flags) { TRACE_ENTRY(); @@ -13443,7 +13443,7 @@ void scst_check_set_UA(struct scst_tgt_dev *tgt_dev, /* Called under dev_lock and BH off */ void scst_dev_check_set_local_UA(struct scst_device *dev, - struct scst_cmd *exclude, const uint8_t *sense, int sense_len) + struct scst_cmd *exclude, const u8 *sense, int sense_len) { struct scst_tgt_dev *tgt_dev, *exclude_tgt_dev = NULL; @@ -13466,7 +13466,7 @@ void scst_dev_check_set_local_UA(struct scst_device *dev, * should be called outside of the dev_lock. */ static bool __scst_dev_check_set_UA(struct scst_device *dev, - struct scst_cmd *exclude, const uint8_t *sense, int sense_len) + struct scst_cmd *exclude, const u8 *sense, int sense_len) { bool res = false; @@ -13490,7 +13490,7 @@ static bool __scst_dev_check_set_UA(struct scst_device *dev, } void scst_dev_check_set_UA(struct scst_device *dev, - struct scst_cmd *exclude, const uint8_t *sense, int sense_len) + struct scst_cmd *exclude, const u8 *sense, int sense_len) { struct scst_lksb lksb; bool rc; @@ -13505,7 +13505,7 @@ void scst_dev_check_set_UA(struct scst_device *dev, void scst_set_tp_soft_threshold_reached_UA(struct scst_tgt_dev *tgt_dev) { - uint8_t sense[SCST_STANDARD_SENSE_LEN]; + u8 sense[SCST_STANDARD_SENSE_LEN]; int len; TRACE_ENTRY(); @@ -13850,12 +13850,12 @@ void scst_unblock_dev(struct scst_device *dev) * Returns 0 on success and not 0 otherwise. */ int scst_obtain_device_parameters(struct scst_device *dev, - const uint8_t *mode_select_cdb) + const u8 *mode_select_cdb) { int rc, i; - uint8_t cmd[16]; - uint8_t buffer[4+0x0A]; - uint8_t sense_buffer[SCSI_SENSE_BUFFERSIZE]; + u8 cmd[16]; + u8 buffer[4+0x0A]; + u8 sense_buffer[SCSI_SENSE_BUFFERSIZE]; TRACE_ENTRY(); @@ -14056,7 +14056,7 @@ static void scst_abort_cmds_dev(struct scst_device *dev, struct scst_cmd *exclude_cmd) { struct scst_tgt_dev *tgt_dev; - uint8_t sense_buffer[SCST_STANDARD_SENSE_LEN]; + u8 sense_buffer[SCST_STANDARD_SENSE_LEN]; int sl = 0; bool set_ua = (dev->tas == 0); @@ -14284,7 +14284,7 @@ out: * If sess is NULL, returns minimum of maximum commands count which can be * queued to any SCST device. */ -int scst_get_max_lun_commands(struct scst_session *sess, uint64_t lun) +int scst_get_max_lun_commands(struct scst_session *sess, u64 lun) { const int init_res = 0xFFFFFF; int res = init_res, i; @@ -14541,7 +14541,7 @@ static int scst_parse_unmap_descriptors(struct scst_cmd *cmd) { int res = 0; ssize_t length = 0; - uint8_t *address; + u8 *address; int i, cnt, offset, descriptor_len, total_len; struct scst_data_descriptor *pd; @@ -14678,7 +14678,7 @@ static void scst_free_descriptors(struct scst_cmd *cmd) #define SCST_DPICZ_LABEL "DPICZ" int scst_save_global_mode_pages(const struct scst_device *dev, - uint8_t *buf, int size) + u8 *buf, int size) { int res = 0; @@ -15127,7 +15127,7 @@ out: } static void scst_sync_ext_blocking_done(struct scst_device *dev, - uint8_t *data, int len) + u8 *data, int len) { wait_queue_head_t *w; @@ -15360,7 +15360,7 @@ int scst_copy_file(const char *src, const char *dest) { int res = 0; loff_t file_size, pos; - uint8_t *buf = NULL; + u8 *buf = NULL; struct file *file_src = NULL, *file_dest = NULL; TRACE_ENTRY(); @@ -15455,7 +15455,7 @@ EXPORT_SYMBOL_GPL(scst_remove_file); /* Returns 0 on success, error code otherwise */ int scst_write_file_transactional(const char *name, const char *name1, - const char *signature, int signature_len, const uint8_t *buf, int size) + const char *signature, int signature_len, const u8 *buf, int size) { int res; struct file *file; @@ -15531,7 +15531,7 @@ write_error_close: EXPORT_SYMBOL_GPL(scst_write_file_transactional); static int __scst_read_file_transactional(const char *file_name, - const char *signature, int signature_len, uint8_t *buf, int size) + const char *signature, int signature_len, u8 *buf, int size) { int res; struct file *file = NULL; @@ -15590,7 +15590,7 @@ out: * skipped. */ int scst_read_file_transactional(const char *name, const char *name1, - const char *signature, int signature_len, uint8_t *buf, int size) + const char *signature, int signature_len, u8 *buf, int size) { int res; @@ -15662,7 +15662,7 @@ EXPORT_SYMBOL(scst_parent_dir_exists); static void __init scst_scsi_op_list_init(void) { int i; - uint8_t op = 0xff; + u8 op = 0xff; TRACE_ENTRY(); @@ -16087,11 +16087,11 @@ void scst_check_debug_sn(struct scst_cmd *cmd) static void __scst_update_latency_stats(struct scst_cmd *cmd, struct scst_lat_stat_entry *stat, - const ktime_t now, uint64_t nowc) + const ktime_t now, u64 nowc) { - uint64_t delta; + u64 delta; #ifdef SCST_MEASURE_CLOCK_CYCLES - int64_t deltac; + s64 deltac; #endif if (stat && ktime_to_ns(cmd->last_state_update) != 0) { @@ -16151,7 +16151,7 @@ static void __scst_update_latency_stats(struct scst_cmd *cmd, void scst_update_latency_stats(struct scst_cmd *cmd, int new_state) { ktime_t now; - uint64_t nowc; + u64 nowc; int sz, dir; struct scst_lat_stat_entry *stat; unsigned long flags; diff --git a/scst/src/scst_local_cmd.c b/scst/src/scst_local_cmd.c index 7bcb4fa1c..29c87dba4 100644 --- a/scst/src/scst_local_cmd.c +++ b/scst/src/scst_local_cmd.c @@ -32,7 +32,7 @@ enum scst_exec_res scst_report_luns_local(struct scst_cmd *cmd) int buffer_size; int i; struct scst_tgt_dev *tgt_dev = NULL; - uint8_t *buffer; + u8 *buffer; int offs, overflow = 0; TRACE_ENTRY(); @@ -127,7 +127,7 @@ enum scst_exec_res scst_request_sense_local(struct scst_cmd *cmd) { enum scst_exec_res res = SCST_EXEC_COMPLETED; struct scst_tgt_dev *tgt_dev = cmd->tgt_dev; - uint8_t *buffer; + u8 *buffer; int buffer_size = 0, sl = 0; TRACE_ENTRY(); @@ -148,7 +148,7 @@ enum scst_exec_res scst_request_sense_local(struct scst_cmd *cmd) if (tgt_dev->tgt_dev_valid_sense_len == 0) { if (test_bit(SCST_TGT_DEV_UA_PENDING, &cmd->tgt_dev->tgt_dev_flags)) { int rc, size = sizeof(tgt_dev->tgt_dev_sense); - uint8_t *buf; + u8 *buf; spin_unlock_bh(&tgt_dev->tgt_dev_lock); @@ -250,11 +250,11 @@ out_unlock_put_not_completed: static enum scst_exec_res scst_report_tpgs(struct scst_cmd *cmd) { struct scst_device *dev; - uint8_t *address; + u8 *address; void *buf; - int32_t buf_len; - uint32_t data_length, length; - uint8_t data_format; + s32 buf_len; + u32 data_length, length; + u8 data_format; int res; TRACE_ENTRY(); @@ -275,7 +275,7 @@ static enum scst_exec_res scst_report_tpgs(struct scst_cmd *cmd) goto out_put; } - length = min_t(uint32_t, data_length, buf_len); + length = min_t(u32, data_length, buf_len); memcpy(address, buf, length); kfree(buf); if (length < cmd->resp_data_len) @@ -324,8 +324,8 @@ static enum scst_exec_res scst_report_supported_tm_fns(struct scst_cmd *cmd) { const enum scst_exec_res res = SCST_EXEC_COMPLETED; int length, resp_len = 0; - uint8_t *address; - uint8_t buf[16]; + u8 *address; + u8 buf[16]; TRACE_ENTRY(); @@ -373,8 +373,8 @@ static enum scst_exec_res scst_report_supported_opcodes(struct scst_cmd *cmd) { const enum scst_exec_res res = SCST_EXEC_COMPLETED; int length, buf_len, i, offs; - uint8_t *address; - uint8_t *buf; + u8 *address; + u8 *buf; bool inline_buf; bool rctd = cmd->cdb[2] >> 7; int options = cmd->cdb[2] & 7; @@ -753,7 +753,7 @@ enum scst_exec_res scst_persistent_reserve_in_local(struct scst_cmd *cmd) struct scst_tgt_dev *tgt_dev; struct scst_session *session; int action; - uint8_t *buffer; + u8 *buffer; int buffer_size; TRACE_ENTRY(); @@ -854,7 +854,7 @@ enum scst_exec_res scst_persistent_reserve_out_local(struct scst_cmd *cmd) struct scst_tgt_dev *tgt_dev; struct scst_session *session; int action; - uint8_t *buffer; + u8 *buffer; int buffer_size; struct scst_lksb pr_lksb; bool aborted = false; diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index b0966a7ec..4db9b964a 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -2367,7 +2367,7 @@ static int __init init_scst(void) if (!INIT_CACHEP(scst_ua_cachep, scst_tgt_dev_UA)) goto out_destroy_mgmt_stub_cache; { - struct scst_sense { uint8_t s[SCST_SENSE_BUFFERSIZE]; }; + struct scst_sense { u8 s[SCST_SENSE_BUFFERSIZE]; }; if (!INIT_CACHEP_USERCOPY(scst_sense_cachep, scst_sense, s)) goto out_destroy_ua_cache; } @@ -2445,8 +2445,8 @@ static int __init init_scst(void) si_meminfo(&si); #if BITS_PER_LONG == 32 - scst_max_cmd_mem = min((((uint64_t)(si.totalram - si.totalhigh) << PAGE_SHIFT) >> 20) >> 2, - (uint64_t)1 << 30); + scst_max_cmd_mem = min((((u64)(si.totalram - si.totalhigh) << PAGE_SHIFT) >> 20) >> 2, + (u64)1 << 30); #else scst_max_cmd_mem = (((si.totalram - si.totalhigh) << PAGE_SHIFT) >> 20) >> 2; #endif @@ -2462,7 +2462,7 @@ static int __init init_scst(void) scst_max_dev_cmd_mem = scst_max_cmd_mem * 2 / 5; } - res = scst_sgv_pools_init(((uint64_t)scst_max_cmd_mem << 10) >> (PAGE_SHIFT - 10), 0); + res = scst_sgv_pools_init(((u64)scst_max_cmd_mem << 10) >> (PAGE_SHIFT - 10), 0); if (res != 0) goto out_sysfs_cleanup; diff --git a/scst/src/scst_pres.c b/scst/src/scst_pres.c index a4badc826..ce7b64495 100644 --- a/scst/src/scst_pres.c +++ b/scst/src/scst_pres.c @@ -76,7 +76,7 @@ static inline void scst_assert_pr_mutex_held(struct scst_device *dev) #endif } -uint32_t scst_tid_size(const uint8_t *tid) +u32 scst_tid_size(const u8 *tid) { sBUG_ON(!tid); @@ -87,10 +87,10 @@ uint32_t scst_tid_size(const uint8_t *tid) } /* Secures transport ID by setting 0 in the last byte of ASCII transport IDs */ -static bool tid_secure(uint8_t *tid, unsigned int buf_size) +static bool tid_secure(u8 *tid, unsigned int buf_size) { if ((tid[0] & 0x0f) == SCSI_TRANSPORTID_PROTOCOLID_ISCSI) { - const uint32_t size = scst_tid_size(tid); + const u32 size = scst_tid_size(tid); if (size > buf_size) return false; @@ -101,7 +101,7 @@ static bool tid_secure(uint8_t *tid, unsigned int buf_size) } /* Returns false if tid's are not equal, true otherwise */ -bool tid_equal(const uint8_t *tid_a, const uint8_t *tid_b) +bool tid_equal(const u8 *tid_a, const u8 *tid_b) { int len; @@ -114,10 +114,10 @@ bool tid_equal(const uint8_t *tid_a, const uint8_t *tid_b) } if ((tid_a[0] & 0x0f) == SCSI_TRANSPORTID_PROTOCOLID_ISCSI) { - const uint8_t tid_a_fmt = tid_a[0] & 0xc0; - const uint8_t tid_b_fmt = tid_b[0] & 0xc0; - uint32_t tid_a_len, tid_a_max = scst_tid_size(tid_a) - 4; - uint32_t tid_b_len, tid_b_max = scst_tid_size(tid_b) - 4; + const u8 tid_a_fmt = tid_a[0] & 0xc0; + const u8 tid_b_fmt = tid_b[0] & 0xc0; + u32 tid_a_len, tid_a_max = scst_tid_size(tid_a) - 4; + u32 tid_b_len, tid_b_max = scst_tid_size(tid_b) - 4; int i; tid_a += 4; @@ -127,7 +127,7 @@ bool tid_equal(const uint8_t *tid_a, const uint8_t *tid_b) tid_a_len = strnlen(tid_a, tid_a_max); } else if (tid_a_fmt == 0x40) { if (tid_a_fmt != tid_b_fmt) { - uint8_t *p = strnchr(tid_a, tid_a_max, ','); + u8 *p = strnchr(tid_a, tid_a_max, ','); if (!p) goto out_error; @@ -145,7 +145,7 @@ bool tid_equal(const uint8_t *tid_a, const uint8_t *tid_b) tid_b_len = strnlen(tid_b, tid_b_max); } else if (tid_b_fmt == 0x40) { if (tid_a_fmt != tid_b_fmt) { - uint8_t *p = strnchr(tid_b, tid_b_max, ','); + u8 *p = strnchr(tid_b, tid_b_max, ','); if (!p) goto out_error; @@ -181,8 +181,8 @@ out_error: } /* Must be called under dev_pr_mutex */ -void scst_pr_set_holder(struct scst_device *dev, struct scst_dev_registrant *holder, uint8_t scope, - uint8_t type) +void scst_pr_set_holder(struct scst_device *dev, struct scst_dev_registrant *holder, u8 scope, + u8 type) { scst_assert_pr_mutex_held(dev); @@ -316,8 +316,8 @@ static void scst_pr_find_registrants_list_key(struct scst_device *dev, __be64 ke } /* dev_pr_mutex must be locked */ -struct scst_dev_registrant *scst_pr_find_reg(struct scst_device *dev, const uint8_t *transport_id, - const uint16_t rel_tgt_id) +struct scst_dev_registrant *scst_pr_find_reg(struct scst_device *dev, const u8 *transport_id, + const u16 rel_tgt_id) { struct scst_dev_registrant *reg, *res = NULL; @@ -378,8 +378,8 @@ void scst_pr_clear_holder(struct scst_device *dev) /* Must be called under dev_pr_mutex */ struct scst_dev_registrant *scst_pr_add_registrant(struct scst_device *dev, - const uint8_t *transport_id, - const uint16_t rel_tgt_id, __be64 key, + const u8 *transport_id, + const u16 rel_tgt_id, __be64 key, bool dev_lock_locked) { struct scst_dev_registrant *reg; @@ -508,7 +508,7 @@ static void scst_pr_remove_registrants(struct scst_device *dev) void scst_pr_send_ua_reg(struct scst_device *dev, struct scst_dev_registrant *reg, int key, int asc, int ascq) { - static uint8_t ua[SCST_STANDARD_SENSE_LEN]; + static u8 ua[SCST_STANDARD_SENSE_LEN]; TRACE_ENTRY(); @@ -587,7 +587,7 @@ static void scst_pr_abort_reg(struct scst_device *dev, struct scst_cmd *pr_cmd, } if (reg->tgt_dev != pr_cmd->tgt_dev && !dev->tas) { - uint8_t sense_buffer[SCST_STANDARD_SENSE_LEN]; + u8 sense_buffer[SCST_STANDARD_SENSE_LEN]; int sl; sl = scst_set_sense(sense_buffer, sizeof(sense_buffer), dev->d_sense, @@ -617,10 +617,10 @@ static int scst_pr_do_load_device_file(struct scst_device *dev, const char *file struct file *file = NULL; char *buf = NULL; loff_t file_size, pos, data_size; - uint64_t sign, version; - uint8_t pr_is_set, aptpl; + u64 sign, version; + u8 pr_is_set, aptpl; __be64 key; - uint16_t rel_tgt_id; + u16 rel_tgt_id; TRACE_ENTRY(); @@ -682,7 +682,7 @@ static int scst_pr_do_load_device_file(struct scst_device *dev, const char *file pos = 0; - sign = get_unaligned((uint64_t *)&buf[pos]); + sign = get_unaligned((u64 *)&buf[pos]); if (sign != SCST_PR_FILE_SIGN) { res = -EINVAL; PRINT_ERROR("Invalid persistent file signature %016llx (expected %016llx)", @@ -691,7 +691,7 @@ static int scst_pr_do_load_device_file(struct scst_device *dev, const char *file } pos += sizeof(sign); - version = get_unaligned((uint64_t *)&buf[pos]); + version = get_unaligned((u64 *)&buf[pos]); if (version != SCST_PR_FILE_VERSION) { res = -EINVAL; PRINT_ERROR("Invalid persistent file version %016llx (expected %016llx)", @@ -701,7 +701,7 @@ static int scst_pr_do_load_device_file(struct scst_device *dev, const char *file pos += sizeof(version); while (data_size + 1 < file_size) { - uint8_t *tid; + u8 *tid; data_size++; tid = &buf[data_size]; @@ -732,8 +732,8 @@ static int scst_pr_do_load_device_file(struct scst_device *dev, const char *file pos += sizeof(dev->pr_scope); while (pos + 1 < file_size) { - uint8_t is_holder; - uint8_t *tid; + u8 is_holder; + u8 *tid; struct scst_dev_registrant *reg = NULL; is_holder = buf[pos++]; @@ -744,7 +744,7 @@ static int scst_pr_do_load_device_file(struct scst_device *dev, const char *file key = get_unaligned((__be64 *)&buf[pos]); pos += sizeof(key); - rel_tgt_id = get_unaligned((uint16_t *)&buf[pos]); + rel_tgt_id = get_unaligned((u16 *)&buf[pos]); pos += sizeof(rel_tgt_id); reg = scst_pr_add_registrant(dev, tid, rel_tgt_id, key, false); @@ -824,9 +824,9 @@ void scst_pr_sync_device_file(struct scst_device *dev) int res = 0; struct file *file; loff_t pos = 0; - uint64_t sign; - uint64_t version; - uint8_t pr_is_set, aptpl; + u64 sign; + u64 version; + u8 pr_is_set, aptpl; struct scst_dev_registrant *reg; TRACE_ENTRY(); @@ -896,8 +896,8 @@ void scst_pr_sync_device_file(struct scst_device *dev) */ list_for_each_entry(reg, &dev->dev_registrants_list, dev_registrants_list_entry) { - uint8_t is_holder = 0; - uint32_t size; + u8 is_holder = 0; + u32 size; is_holder = (dev->pr_holder == reg); @@ -1143,8 +1143,8 @@ int scst_pr_init_tgt_dev(struct scst_tgt_dev *tgt_dev) int res = 0; struct scst_dev_registrant *reg; struct scst_device *dev = tgt_dev->dev; - const uint8_t *transport_id = tgt_dev->sess->transport_id; - const uint16_t rel_tgt_id = tgt_dev->sess->tgt->rel_tgt_id; + const u8 *transport_id = tgt_dev->sess->transport_id; + const u16 rel_tgt_id = tgt_dev->sess->tgt->rel_tgt_id; TRACE_ENTRY(); @@ -1207,8 +1207,8 @@ void scst_pr_clear_tgt_dev(struct scst_tgt_dev *tgt_dev) } /* Called with dev_pr_mutex locked. Might also be called under scst_mutex2. */ -static int scst_pr_register_with_spec_i_pt(struct scst_cmd *cmd, const uint16_t rel_tgt_id, - uint8_t *buffer, int buffer_size, +static int scst_pr_register_with_spec_i_pt(struct scst_cmd *cmd, const u16 rel_tgt_id, + u8 *buffer, int buffer_size, struct list_head *rollback_list) { int res = 0; @@ -1233,8 +1233,8 @@ static int scst_pr_register_with_spec_i_pt(struct scst_cmd *cmd, const uint16_t offset = 0; while (offset < ext_size) { - uint8_t *const transport_id = &buffer[28 + offset]; - const uint32_t tid_size = scst_tid_size(transport_id); + u8 *const transport_id = &buffer[28 + offset]; + const u32 tid_size = scst_tid_size(transport_id); if (offset + tid_size > ext_size) { TRACE_PR("Invalid transport_id size %d (max %d)", @@ -1249,7 +1249,7 @@ static int scst_pr_register_with_spec_i_pt(struct scst_cmd *cmd, const uint16_t offset = 0; while (offset < ext_size) { - uint8_t *transport_id = &buffer[28 + offset]; + u8 *transport_id = &buffer[28 + offset]; struct scst_tgt_dev *t; TRACE_PR("rel_tgt_id %d, transport_id %s", @@ -1324,7 +1324,7 @@ out: static void scst_pr_unregister(struct scst_device *dev, struct scst_dev_registrant *reg) { bool is_holder; - uint8_t pr_type; + u8 pr_type; TRACE_ENTRY(); @@ -1352,10 +1352,10 @@ static void scst_pr_unregister(struct scst_device *dev, struct scst_dev_registra } /* Called with dev_pr_mutex locked, no IRQ */ -static void scst_pr_unregister_all_tg_pt(struct scst_device *dev, const uint8_t *transport_id) +static void scst_pr_unregister_all_tg_pt(struct scst_device *dev, const u8 *transport_id) { struct scst_tgt_template *tgtt; - uint8_t proto_id = transport_id[0] & 0x0f; + u8 proto_id = transport_id[0] & 0x0f; TRACE_ENTRY(); @@ -1393,8 +1393,8 @@ static void scst_pr_unregister_all_tg_pt(struct scst_device *dev, const uint8_t } /* Called with dev_pr_mutex locked. Might also be called under scst_mutex2. */ -static int scst_pr_register_on_tgt_id(struct scst_cmd *cmd, const uint16_t rel_tgt_id, - uint8_t *buffer, int buffer_size, bool spec_i_pt, +static int scst_pr_register_on_tgt_id(struct scst_cmd *cmd, const u16 rel_tgt_id, + u8 *buffer, int buffer_size, bool spec_i_pt, struct list_head *rollback_list) { int res; @@ -1439,7 +1439,7 @@ out: } /* Add registrants for remote ports. Called with dev_pr_mutex locked, no IRQ. */ -static int scst_register_remote_ports(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size, +static int scst_register_remote_ports(struct scst_cmd *cmd, u8 *buffer, int buffer_size, bool spec_i_pt, struct list_head *rollback_list) { struct scst_dev_group *dg; @@ -1476,12 +1476,12 @@ out_unlock: } /* Register all target ports. Called with dev_pr_mutex locked, no IRQ. */ -static int scst_pr_register_all_tg_pt(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size, +static int scst_pr_register_all_tg_pt(struct scst_cmd *cmd, u8 *buffer, int buffer_size, bool spec_i_pt, struct list_head *rollback_list) { int res = 0; struct scst_tgt_template *tgtt; - uint8_t proto_id = cmd->sess->transport_id[0] & 0x0f; + u8 proto_id = cmd->sess->transport_id[0] & 0x0f; TRACE_ENTRY(); @@ -1531,7 +1531,7 @@ out_unlock: } /* Called with dev_pr_mutex locked, no IRQ */ -static int __scst_pr_register(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size, +static int __scst_pr_register(struct scst_cmd *cmd, u8 *buffer, int buffer_size, bool spec_i_pt, bool all_tg_pt) { int res; @@ -1575,7 +1575,7 @@ out_rollback: } /* Called with dev_pr_mutex locked, no IRQ */ -void scst_pr_register(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size) +void scst_pr_register(struct scst_cmd *cmd, u8 *buffer, int buffer_size) { int aptpl, spec_i_pt, all_tg_pt; __be64 key, action_key; @@ -1657,7 +1657,7 @@ out: } /* Called with dev_pr_mutex locked, no IRQ */ -void scst_pr_register_and_ignore(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size) +void scst_pr_register_and_ignore(struct scst_cmd *cmd, u8 *buffer, int buffer_size) { int aptpl, all_tg_pt; __be64 action_key; @@ -1718,7 +1718,7 @@ out: } /* Called with dev_pr_mutex locked, no IRQ */ -void scst_pr_register_and_move(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size) +void scst_pr_register_and_move(struct scst_cmd *cmd, u8 *buffer, int buffer_size) { int aptpl; int unreg; @@ -1728,9 +1728,9 @@ void scst_pr_register_and_move(struct scst_cmd *cmd, uint8_t *buffer, int buffer struct scst_tgt_dev *tgt_dev = cmd->tgt_dev; struct scst_session *sess = cmd->sess; struct scst_dev_registrant *reg, *reg_move; - const uint8_t *transport_id = NULL; - uint8_t *transport_id_move = NULL; - uint16_t rel_tgt_id_move; + const u8 *transport_id = NULL; + u8 *transport_id_move = NULL; + u16 rel_tgt_id_move; TRACE_ENTRY(); @@ -1791,7 +1791,7 @@ void scst_pr_register_and_move(struct scst_cmd *cmd, uint8_t *buffer, int buffer } transport_id = sess->transport_id; - transport_id_move = (uint8_t *)&buffer[24]; + transport_id_move = (u8 *)&buffer[24]; rel_tgt_id_move = get_unaligned_be16(&buffer[18]); if ((scst_tid_size(transport_id_move) + 24) > buffer_size) { @@ -1858,9 +1858,9 @@ out: } /* Called with dev_pr_mutex locked, no IRQ */ -void scst_pr_reserve(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size) +void scst_pr_reserve(struct scst_cmd *cmd, u8 *buffer, int buffer_size) { - uint8_t scope, type; + u8 scope, type; __be64 key; struct scst_device *dev = cmd->dev; struct scst_tgt_dev *tgt_dev = cmd->tgt_dev; @@ -1936,14 +1936,14 @@ out: } /* Called with dev_pr_mutex locked, no IRQ */ -void scst_pr_release(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size) +void scst_pr_release(struct scst_cmd *cmd, u8 *buffer, int buffer_size) { int scope, type; __be64 key; struct scst_device *dev = cmd->dev; struct scst_tgt_dev *tgt_dev = cmd->tgt_dev; struct scst_dev_registrant *reg; - uint8_t cur_pr_type; + u8 cur_pr_type; TRACE_ENTRY(); @@ -2008,7 +2008,7 @@ out: } /* Called with dev_pr_mutex locked, no IRQ */ -void scst_pr_clear(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size) +void scst_pr_clear(struct scst_cmd *cmd, u8 *buffer, int buffer_size) { __be64 key; struct scst_device *dev = cmd->dev; @@ -2054,7 +2054,7 @@ out: TRACE_EXIT(); } -static void scst_pr_do_preempt(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size, bool abort) +static void scst_pr_do_preempt(struct scst_cmd *cmd, u8 *buffer, int buffer_size, bool abort) { __be64 key, action_key; int scope, type; @@ -2204,7 +2204,7 @@ out_error: } /* Called with dev_pr_mutex locked, no IRQ */ -void scst_pr_preempt(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size) +void scst_pr_preempt(struct scst_cmd *cmd, u8 *buffer, int buffer_size) { TRACE_ENTRY(); @@ -2240,7 +2240,7 @@ out: * Called with dev_pr_mutex locked, no IRQ. Expects session_list_lock * not locked */ -void scst_pr_preempt_and_abort(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size) +void scst_pr_preempt_and_abort(struct scst_cmd *cmd, u8 *buffer, int buffer_size) { TRACE_ENTRY(); @@ -2278,7 +2278,7 @@ bool scst_pr_crh_case(struct scst_cmd *cmd) struct scst_device *dev = cmd->dev; struct scst_tgt_dev *tgt_dev = cmd->tgt_dev; struct scst_dev_registrant *reg; - uint8_t type; + u8 type; TRACE_ENTRY(); @@ -2336,7 +2336,7 @@ bool scst_pr_is_cmd_allowed(struct scst_cmd *cmd) struct scst_device *dev = cmd->dev; struct scst_tgt_dev *tgt_dev = cmd->tgt_dev; struct scst_dev_registrant *reg; - uint8_t type; + u8 type; TRACE_ENTRY(); @@ -2408,7 +2408,7 @@ out_unlock: } /* Called with dev_pr_mutex locked, no IRQ */ -void scst_pr_read_keys(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size) +void scst_pr_read_keys(struct scst_cmd *cmd, u8 *buffer, int buffer_size) { int offset = 0, size, size_max; struct scst_device *dev = cmd->dev; @@ -2456,10 +2456,10 @@ skip: } /* Called with dev_pr_mutex locked, no IRQ */ -void scst_pr_read_reservation(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size) +void scst_pr_read_reservation(struct scst_cmd *cmd, u8 *buffer, int buffer_size) { struct scst_device *dev = cmd->dev; - uint8_t b[24] = { }; + u8 b[24] = { }; int size = 0; TRACE_ENTRY(); @@ -2511,7 +2511,7 @@ out: } /* Called with dev_pr_mutex locked, no IRQ */ -void scst_pr_report_caps(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size) +void scst_pr_report_caps(struct scst_cmd *cmd, u8 *buffer, int buffer_size) { int offset = 0; unsigned int crh = 1; @@ -2552,7 +2552,7 @@ skip: } /* Called with dev_pr_mutex locked, no IRQ */ -void scst_pr_read_full_status(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size) +void scst_pr_read_full_status(struct scst_cmd *cmd, u8 *buffer, int buffer_size) { int offset = 0, size, size_max; struct scst_device *dev = cmd->dev; @@ -2572,8 +2572,8 @@ void scst_pr_read_full_status(struct scst_cmd *cmd, uint8_t *buffer, int buffer_ size_max = buffer_size - 8; list_for_each_entry(reg, &dev->dev_registrants_list, dev_registrants_list_entry) { - const uint32_t ts = scst_tid_size(reg->transport_id); - const uint32_t rec_len = 24 + ts; + const u32 ts = scst_tid_size(reg->transport_id); + const u32 rec_len = 24 + ts; if (size_max - size > rec_len) { memset(&buffer[offset], 0, rec_len); diff --git a/scst/src/scst_pres.h b/scst/src/scst_pres.h index d37fbcbca..1d874b1a1 100644 --- a/scst/src/scst_pres.h +++ b/scst/src/scst_pres.h @@ -54,7 +54,7 @@ /* Persistent reservation SCOPE field */ #define SCOPE_LU 0x00 -static inline bool scst_pr_type_valid(uint8_t type) +static inline bool scst_pr_type_valid(u8 type) { switch (type) { case TYPE_WRITE_EXCLUSIVE: @@ -111,33 +111,33 @@ void scst_pr_clear_tgt_dev(struct scst_tgt_dev *tgt_dev); bool scst_pr_crh_case(struct scst_cmd *cmd); bool scst_pr_is_cmd_allowed(struct scst_cmd *cmd); -void scst_pr_register(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size); -void scst_pr_register_and_ignore(struct scst_cmd *cmd, uint8_t *buffer, +void scst_pr_register(struct scst_cmd *cmd, u8 *buffer, int buffer_size); +void scst_pr_register_and_ignore(struct scst_cmd *cmd, u8 *buffer, int buffer_size); -void scst_pr_register_and_move(struct scst_cmd *cmd, uint8_t *buffer, +void scst_pr_register_and_move(struct scst_cmd *cmd, u8 *buffer, int buffer_size); -void scst_pr_reserve(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size); -void scst_pr_release(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size); -void scst_pr_clear(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size); -void scst_pr_preempt(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size); -void scst_pr_preempt_and_abort(struct scst_cmd *cmd, uint8_t *buffer, +void scst_pr_reserve(struct scst_cmd *cmd, u8 *buffer, int buffer_size); +void scst_pr_release(struct scst_cmd *cmd, u8 *buffer, int buffer_size); +void scst_pr_clear(struct scst_cmd *cmd, u8 *buffer, int buffer_size); +void scst_pr_preempt(struct scst_cmd *cmd, u8 *buffer, int buffer_size); +void scst_pr_preempt_and_abort(struct scst_cmd *cmd, u8 *buffer, int buffer_size); -void scst_pr_read_keys(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size); -void scst_pr_read_reservation(struct scst_cmd *cmd, uint8_t *buffer, +void scst_pr_read_keys(struct scst_cmd *cmd, u8 *buffer, int buffer_size); +void scst_pr_read_reservation(struct scst_cmd *cmd, u8 *buffer, int buffer_size); -void scst_pr_report_caps(struct scst_cmd *cmd, uint8_t *buffer, int buffer_size); -void scst_pr_read_full_status(struct scst_cmd *cmd, uint8_t *buffer, +void scst_pr_report_caps(struct scst_cmd *cmd, u8 *buffer, int buffer_size); +void scst_pr_read_full_status(struct scst_cmd *cmd, u8 *buffer, int buffer_size); -uint32_t scst_tid_size(const uint8_t *tid); -bool tid_equal(const uint8_t *tid_a, const uint8_t *tid_b); +u32 scst_tid_size(const u8 *tid); +bool tid_equal(const u8 *tid_a, const u8 *tid_b); struct scst_dev_registrant *scst_pr_find_reg(struct scst_device *dev, - const uint8_t *transport_id, const uint16_t rel_tgt_id); + const u8 *transport_id, const u16 rel_tgt_id); struct scst_dev_registrant *scst_pr_add_registrant(struct scst_device *dev, - const uint8_t *transport_id, - const uint16_t rel_tgt_id, + const u8 *transport_id, + const u16 rel_tgt_id, __be64 key, bool dev_lock_locked); void scst_pr_remove_registrant(struct scst_device *dev, @@ -146,8 +146,8 @@ void scst_pr_send_ua_reg(struct scst_device *dev, struct scst_dev_registrant *reg, int key, int asc, int ascq); void scst_pr_set_holder(struct scst_device *dev, - struct scst_dev_registrant *holder, uint8_t scope, - uint8_t type); + struct scst_dev_registrant *holder, u8 scope, + u8 type); void scst_pr_clear_holder(struct scst_device *dev); void scst_pr_sync_device_file(struct scst_device *dev); diff --git a/scst/src/scst_priv.h b/scst/src/scst_priv.h index c2b141d3a..477e11a0a 100644 --- a/scst/src/scst_priv.h +++ b/scst/src/scst_priv.h @@ -373,10 +373,10 @@ void scst_nexus_loss(struct scst_tgt_dev *tgt_dev, bool queue_UA); #define SCST_REPL_LUN_GEN_UA 8 int scst_acg_add_lun(struct scst_acg *acg, struct kobject *parent, struct scst_device *dev, - uint64_t lun, unsigned int flags, struct scst_acg_dev **out_acg_dev); -int scst_acg_del_lun(struct scst_acg *acg, uint64_t lun, bool gen_report_luns_changed); + u64 lun, unsigned int flags, struct scst_acg_dev **out_acg_dev); +int scst_acg_del_lun(struct scst_acg *acg, u64 lun, bool gen_report_luns_changed); int scst_acg_repl_lun(struct scst_acg *acg, struct kobject *parent, - struct scst_device *dev, uint64_t lun, + struct scst_device *dev, u64 lun, unsigned int flags); int scst_acg_add_acn(struct scst_acg *acg, const char *name); @@ -386,7 +386,7 @@ struct scst_acn *scst_find_acn(struct scst_acg *acg, const char *name); int scst_prepare_request_sense(struct scst_cmd *orig_cmd); int scst_finish_internal_cmd(struct scst_cmd *cmd); -int scst_set_cmd_error_sense(struct scst_cmd *cmd, uint8_t *sense, unsigned int len); +int scst_set_cmd_error_sense(struct scst_cmd *cmd, u8 *sense, unsigned int len); int scst_process_check_condition(struct scst_cmd *cmd); @@ -405,7 +405,7 @@ void scst_check_retries(struct scst_tgt *tgt); static inline int scst_dlm_new_lockspace(const char *name, int namelen, dlm_lockspace_t **lockspace, - uint32_t flags, + u32 flags, int lvblen) { return dlm_new_lockspace(name, scst_cluster_name, flags, lvblen, @@ -547,16 +547,16 @@ static inline void scst_clear_dev_reservation(struct scst_device *dev) void scst_tgt_dev_del_free_UA(struct scst_tgt_dev *tgt_dev, struct scst_tgt_dev_UA *ua); void scst_dev_check_set_UA(struct scst_device *dev, struct scst_cmd *exclude, - const uint8_t *sense, int sense_len); + const u8 *sense, int sense_len); void scst_dev_check_set_local_UA(struct scst_device *dev, struct scst_cmd *exclude, - const uint8_t *sense, int sense_len); + const u8 *sense, int sense_len); #define SCST_SET_UA_FLAG_AT_HEAD 1 #define SCST_SET_UA_FLAG_GLOBAL 2 -void scst_check_set_UA(struct scst_tgt_dev *tgt_dev, const uint8_t *sense, int sense_len, +void scst_check_set_UA(struct scst_tgt_dev *tgt_dev, const u8 *sense, int sense_len, int flags); -int scst_set_pending_UA(struct scst_cmd *cmd, uint8_t *buf, int *size); +int scst_set_pending_UA(struct scst_cmd *cmd, u8 *buf, int *size); void scst_report_luns_changed(struct scst_acg *acg); @@ -570,10 +570,10 @@ void scst_unblock_aborted_cmds(const struct scst_tgt *tgt, const struct scst_ses const struct scst_device *device); void scst_clear_aca(struct scst_tgt_dev *tgt_dev, bool other_ini); -bool scst_is_ua_global(const uint8_t *sense, int len); -void scst_requeue_ua(struct scst_cmd *cmd, const uint8_t *buf, int size); +bool scst_is_ua_global(const u8 *sense, int len); +void scst_requeue_ua(struct scst_cmd *cmd, const u8 *buf, int size); -struct scst_aen *scst_alloc_aen(struct scst_session *sess, uint64_t unpacked_lun); +struct scst_aen *scst_alloc_aen(struct scst_session *sess, u64 unpacked_lun); void scst_free_aen(struct scst_aen *aen); void scst_gen_aen_or_ua(struct scst_tgt_dev *tgt_dev, int key, int asc, int ascq); @@ -675,8 +675,8 @@ static inline void scst_sess_put(struct scst_session *sess) percpu_ref_put(&sess->refcnt); } -struct scst_cmd *scst_alloc_cmd(const uint8_t *cdb, unsigned int cdb_len, gfp_t gfp_mask); -int scst_pre_init_cmd(struct scst_cmd *cmd, const uint8_t *cdb, unsigned int cdb_len, +struct scst_cmd *scst_alloc_cmd(const u8 *cdb, unsigned int cdb_len, gfp_t gfp_mask); +int scst_pre_init_cmd(struct scst_cmd *cmd, const u8 *cdb, unsigned int cdb_len, gfp_t gfp_mask); void scst_free_cmd(struct kref *ref); @@ -712,12 +712,12 @@ void scst_vfs_unlink_and_put(struct path *path); int scst_copy_file(const char *src, const char *dest); -struct scst_cmd *__scst_create_prepare_internal_cmd(const uint8_t *cdb, unsigned int cdb_len, +struct scst_cmd *__scst_create_prepare_internal_cmd(const u8 *cdb, unsigned int cdb_len, enum scst_cmd_queue_type queue_type, struct scst_tgt_dev *tgt_dev, gfp_t gfp_mask, bool fantom); -static inline bool scst_lba1_inside_lba2(int64_t lba1, int64_t lba2, int64_t lba2_blocks) +static inline bool scst_lba1_inside_lba2(s64 lba1, s64 lba2, s64 lba2_blocks) { bool res; @@ -739,7 +739,7 @@ void scst_cm_on_dev_unregister(struct scst_device *dev); int scst_cm_on_add_acg(struct scst_acg *acg); void scst_cm_on_del_acg(struct scst_acg *acg); -int scst_cm_on_add_lun(struct scst_acg_dev *acg_dev, uint64_t lun, unsigned int *flags); +int scst_cm_on_add_lun(struct scst_acg_dev *acg_dev, u64 lun, unsigned int *flags); bool scst_cm_on_del_lun(struct scst_acg_dev *acg_dev, bool gen_report_luns_changed); int scst_cm_parse_descriptors(struct scst_cmd *ec_cmd); @@ -797,13 +797,13 @@ static inline void scst_check_debug_sn(struct scst_cmd *cmd) } #endif -static inline int scst_sn_before(uint32_t seq1, uint32_t seq2) +static inline int scst_sn_before(u32 seq1, u32 seq2) { - return (int32_t)(seq1 - seq2) < 0; + return (s32)(seq1 - seq2) < 0; } -int gen_relative_target_port_id(uint16_t *id); -bool scst_is_relative_target_port_id_unique(uint16_t id, const struct scst_tgt *t); +int gen_relative_target_port_id(u16 *id); +bool scst_is_relative_target_port_id_unique(u16 id, const struct scst_tgt *t); int scst_event_init(void); void scst_event_exit(void); diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c index aedcd8736..ec4a61dba 100644 --- a/scst/src/scst_sysfs.c +++ b/scst/src/scst_sysfs.c @@ -2331,7 +2331,7 @@ static int scst_process_rel_tgt_id_store(struct scst_sysfs_work_item *work) /* tgt protected by kobject_get() */ TRACE_DBG("Trying to set relative target port id %d", - (uint16_t)rel_tgt_id); + (u16)rel_tgt_id); if (tgt->tgtt->is_target_enabled) enabled = tgt->tgtt->is_target_enabled(tgt); @@ -2341,7 +2341,7 @@ static int scst_process_rel_tgt_id_store(struct scst_sysfs_work_item *work) if (enabled && rel_tgt_id != tgt->rel_tgt_id) { if (!scst_is_relative_target_port_id_unique(rel_tgt_id, tgt)) { PRINT_ERROR("Relative port id %d is not unique", - (uint16_t)rel_tgt_id); + (u16)rel_tgt_id); res = -EBADSLT; goto out_put; } @@ -2352,13 +2352,13 @@ static int scst_process_rel_tgt_id_store(struct scst_sysfs_work_item *work) goto set; PRINT_ERROR("Invalid relative port id %d", - (uint16_t)rel_tgt_id); + (u16)rel_tgt_id); res = -EINVAL; goto out_put; } set: - tgt->rel_tgt_id = (uint16_t)rel_tgt_id; + tgt->rel_tgt_id = (u16)rel_tgt_id; out_put: kobject_put(&tgt->tgt_kobj); @@ -2869,7 +2869,7 @@ static int scst_tgt_sysfs_##attr##_show_work_fn(struct scst_sysfs_work_item *wor struct scst_tgt *tgt = work->tgt; \ struct scst_session *sess; \ int res; \ - uint64_t c = 0; \ + u64 c = 0; \ \ BUILD_BUG_ON((unsigned int)(dir) >= ARRAY_SIZE(sess->io_stats)); \ \ @@ -3753,7 +3753,7 @@ static ssize_t scst_dev_block_show(struct kobject *kobj, struct kobj_attribute * return ret; } -static void scst_sysfs_ext_blocking_done(struct scst_device *dev, uint8_t *data, int len) +static void scst_sysfs_ext_blocking_done(struct scst_device *dev, u8 *data, int len) { scst_event_queue_ext_blocking_done(dev, data, len); } @@ -4458,11 +4458,11 @@ static ssize_t scst_sess_latency_show(struct kobject *kobj, struct kobj_attribut int i, j, k; long sz; struct scst_lat_stat_entry *d; - uint64_t avg, stddev; + u64 avg, stddev; #ifdef SCST_MEASURE_CLOCK_CYCLES - uint64_t min, max, sumc = 0, sumsqc = 0; + u64 min, max, sumc = 0, sumsqc = 0; #else - uint64_t sum = 0, sumsq = 0; + u64 sum = 0, sumsq = 0; #endif unsigned int count = 0, numst = 0; u64 d_min_div_10, d_max_div_10, avg_div_10, stddev_div_10; @@ -4828,7 +4828,7 @@ static ssize_t scst_sess_sysfs_##exported_name##_show(struct kobject *kobj, \ struct kobj_attribute *attr, char *buf) \ { \ struct scst_session *sess; \ - uint64_t v; \ + u64 v; \ \ BUILD_BUG_ON(SCST_DATA_UNKNOWN != 0); \ BUILD_BUG_ON(SCST_DATA_WRITE != 1); \ @@ -7735,10 +7735,10 @@ static DEFINE_MUTEX(scst_sysfs_user_info_mutex); /* All protected by scst_sysfs_user_info_mutex */ static LIST_HEAD(scst_sysfs_user_info_list); -static uint32_t scst_sysfs_info_cur_cookie; +static u32 scst_sysfs_info_cur_cookie; /* scst_sysfs_user_info_mutex supposed to be held */ -static struct scst_sysfs_user_info *scst_sysfs_user_find_info(uint32_t cookie) +static struct scst_sysfs_user_info *scst_sysfs_user_find_info(u32 cookie) { struct scst_sysfs_user_info *info, *res = NULL; @@ -7763,7 +7763,7 @@ static struct scst_sysfs_user_info *scst_sysfs_user_find_info(uint32_t cookie) * * Returns found entry or NULL. */ -struct scst_sysfs_user_info *scst_sysfs_user_get_info(uint32_t cookie) +struct scst_sysfs_user_info *scst_sysfs_user_get_info(u32 cookie) { struct scst_sysfs_user_info *res = NULL; diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index 3f90c2018..a48ab0e2d 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -52,7 +52,7 @@ static void scst_cmd_set_sn(struct scst_cmd *cmd); #define DEFAULT_SYMBOL_NAMESPACE SCST_NAMESPACE static int __scst_init_cmd(struct scst_cmd *cmd); -static struct scst_cmd *__scst_find_cmd_by_tag(struct scst_session *sess, uint64_t tag, +static struct scst_cmd *__scst_find_cmd_by_tag(struct scst_session *sess, u64 tag, bool to_abort); static void scst_process_redirect_cmd(struct scst_cmd *cmd, enum scst_exec_context context, int check_retries); @@ -95,7 +95,7 @@ static inline void scst_schedule_tasklet(struct scst_cmd *cmd) preempt_enable(); } -static bool scst_unmap_overlap(struct scst_cmd *cmd, int64_t lba2, int64_t lba2_blocks) +static bool scst_unmap_overlap(struct scst_cmd *cmd, s64 lba2, s64 lba2_blocks) { bool res = false; struct scst_data_descriptor *pd = cmd->cmd_data_descriptors; @@ -571,7 +571,7 @@ void scst_check_unblock_dev(struct scst_cmd *cmd) TRACE_EXIT(); } -static void __scst_rx_cmd(struct scst_cmd *cmd, struct scst_session *sess, const uint8_t *lun, +static void __scst_rx_cmd(struct scst_cmd *cmd, struct scst_session *sess, const u8 *lun, int lun_len, gfp_t gfp_mask) { TRACE_ENTRY(); @@ -612,8 +612,8 @@ static void __scst_rx_cmd(struct scst_cmd *cmd, struct scst_session *sess, const * * Return: 0 upon success or a negative error code otherwise. */ -int scst_rx_cmd_prealloced(struct scst_cmd *cmd, struct scst_session *sess, const uint8_t *lun, - int lun_len, const uint8_t *cdb, unsigned int cdb_len, bool atomic) +int scst_rx_cmd_prealloced(struct scst_cmd *cmd, struct scst_session *sess, const u8 *lun, + int lun_len, const u8 *cdb, unsigned int cdb_len, bool atomic) { int res; gfp_t gfp_mask = atomic ? GFP_ATOMIC : cmd->cmd_gfp_mask; @@ -658,8 +658,8 @@ EXPORT_SYMBOL(scst_rx_cmd_prealloced); * Return: pointer to newly allocated SCST command upon success or NULL upon * failure. */ -struct scst_cmd *scst_rx_cmd(struct scst_session *sess, const uint8_t *lun, int lun_len, - const uint8_t *cdb, unsigned int cdb_len, bool atomic) +struct scst_cmd *scst_rx_cmd(struct scst_session *sess, const u8 *lun, int lun_len, + const u8 *cdb, unsigned int cdb_len, bool atomic) { struct scst_cmd *cmd; gfp_t gfp_mask = atomic ? GFP_ATOMIC : GFP_NOIO; @@ -2110,7 +2110,7 @@ out: return res; } -static void scst_do_cmd_done(struct scst_cmd *cmd, int result, const uint8_t *rq_sense, +static void scst_do_cmd_done(struct scst_cmd *cmd, int result, const u8 *rq_sense, int rq_sense_len, int resid) { TRACE_ENTRY(); @@ -2170,8 +2170,8 @@ scst_optimize_post_exec_context(struct scst_cmd *cmd, enum scst_exec_context con */ static void scst_replace_port_info(struct scst_cmd *cmd) { - uint8_t *buf, *end, *p, designator_length; - int32_t length, page_length; + u8 *buf, *end, *p, designator_length; + s32 length, page_length; if (!scst_cmd_inquired_dev_ident(cmd)) return; @@ -2184,9 +2184,9 @@ static void scst_replace_port_info(struct scst_cmd *cmd) end = buf + min(length, 4 + page_length); for (p = buf + 4; p + 4 <= end; p += 4 + designator_length) { - const uint8_t code_set = p[0] & 0xf; - const uint8_t association = (p[1] & 0x30) >> 4; - const uint8_t designator_type = p[1] & 0xf; + const u8 code_set = p[0] & 0xf; + const u8 association = (p[1] & 0x30) >> 4; + const u8 designator_type = p[1] & 0xf; designator_length = p[3]; @@ -3020,7 +3020,7 @@ static int scst_check_sense(struct scst_cmd *cmd) scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_reset_UA)); } else { int sl; - uint8_t sense[SCST_STANDARD_SENSE_LEN]; + u8 sense[SCST_STANDARD_SENSE_LEN]; TRACE(TRACE_MGMT, "DID_RESET received for device %s, triggering reset UA", @@ -3199,8 +3199,8 @@ next: cmd->dev->type == TYPE_WORM || cmd->dev->type == TYPE_MOD || cmd->dev->type == TYPE_TAPE)) { - int32_t length; - uint8_t *address; + s32 length; + u8 *address; bool err = false; length = scst_get_buf_full(cmd, &address, true); @@ -3261,7 +3261,7 @@ static int scst_mode_select_checks(struct scst_cmd *cmd) cmd->cdb[0] == LOG_SELECT)) { struct scst_device *dev = cmd->dev; int sl; - uint8_t sense_buffer[SCST_STANDARD_SENSE_LEN]; + u8 sense_buffer[SCST_STANDARD_SENSE_LEN]; if (atomic && dev->scsi_dev) { TRACE_DBG("MODE/LOG SELECT: thread context required"); @@ -5632,7 +5632,7 @@ static int scst_clear_task_set(struct scst_mgmt_cmd *mcmd) __scst_unblock_aborted_cmds(NULL, NULL, dev); if (!dev->tas) { - uint8_t sense_buffer[SCST_STANDARD_SENSE_LEN]; + u8 sense_buffer[SCST_STANDARD_SENSE_LEN]; int sl; sl = scst_set_sense(sense_buffer, sizeof(sense_buffer), @@ -7470,7 +7470,7 @@ int scst_global_mgmt_thread(void *arg) } /* Called under sess->sess_list_lock */ -static struct scst_cmd *__scst_find_cmd_by_tag(struct scst_session *sess, uint64_t tag, +static struct scst_cmd *__scst_find_cmd_by_tag(struct scst_session *sess, u64 tag, bool to_abort) { struct scst_cmd *cmd, *res = NULL; @@ -7573,7 +7573,7 @@ EXPORT_SYMBOL(scst_find_cmd); * that previously set by scst_cmd_set_tag(). Returns the found command on * success or NULL otherwise. */ -struct scst_cmd *scst_find_cmd_by_tag(struct scst_session *sess, uint64_t tag) +struct scst_cmd *scst_find_cmd_by_tag(struct scst_session *sess, u64 tag) { unsigned long flags; struct scst_cmd *cmd; diff --git a/scst/src/scst_tg.c b/scst/src/scst_tg.c index b10f267cb..5f113ad16 100644 --- a/scst/src/scst_tg.c +++ b/scst/src/scst_tg.c @@ -165,7 +165,7 @@ static struct scst_target_group *__lookup_tg_by_name(struct scst_dev_group *dg, /* Look up a target group by group ID. */ static struct scst_target_group *__lookup_tg_by_group_id(struct scst_dev_group *dg, - uint16_t group_id) + u16 group_id) { struct scst_target_group *tg; @@ -1452,12 +1452,12 @@ void scst_tg_cleanup(void) * * Returns a non-zero number if the lookup was successful and zero if not. */ -uint16_t scst_lookup_tg_id(struct scst_device *dev, struct scst_tgt *tgt) +u16 scst_lookup_tg_id(struct scst_device *dev, struct scst_tgt *tgt) { struct scst_dev_group *dg; struct scst_target_group *tg; struct scst_tg_tgt *tg_tgt; - uint16_t tg_id = 0; + u16 tg_id = 0; TRACE_ENTRY(); mutex_lock(&scst_dg_mutex); @@ -1534,16 +1534,16 @@ EXPORT_SYMBOL_GPL(scst_alua_configured); * @dev: Pointer to the SCST device for which to obtain group information. * @data_format: Three-bit response data format specification. */ -int scst_tg_get_group_info(void **buf, uint32_t *length, - struct scst_device *dev, uint8_t data_format) +int scst_tg_get_group_info(void **buf, u32 *length, + struct scst_device *dev, u8 data_format) { struct scst_dev_group *dg; struct scst_target_group *tg; struct scst_tg_tgt *tgtgt; struct scst_tgt *tgt; - uint8_t *p; - uint32_t ret_data_len; - uint16_t rel_tgt_id; + u8 *p; + u32 ret_data_len; + u16 rel_tgt_id; int res; TRACE_ENTRY(); @@ -1631,7 +1631,7 @@ int scst_tg_get_group_info(void **buf, uint32_t *length, } done: - WARN_ON(p - (uint8_t *)*buf != *length); + WARN_ON(p - (u8 *)*buf != *length); res = 0; @@ -1672,7 +1672,7 @@ static void scst_stpg_check_blocking_done(struct scst_stpg_wait *wait) } /* No locks */ -static void scst_stpg_ext_blocking_done(struct scst_device *dev, uint8_t *data, int len) +static void scst_stpg_ext_blocking_done(struct scst_device *dev, u8 *data, int len) { sBUG_ON(len != sizeof(data)); scst_stpg_check_blocking_done(*((struct scst_stpg_wait **)data)); @@ -1690,7 +1690,7 @@ static void scst_stpg_ext_blocking_done(struct scst_device *dev, uint8_t *data, * @new_state: new target port group ALUA state. */ struct osi { - uint16_t group_id; + u16 group_id; struct scst_target_group *tg; enum scst_tg_state prev_state; enum scst_tg_state new_state; @@ -1852,7 +1852,7 @@ out: int scst_tg_set_group_info(struct scst_cmd *cmd) { struct scst_device *dev = cmd->dev; - uint8_t *buf; + u8 *buf; int len; int i, j, res = 1, tpg_desc_count; struct scst_dev_group *dg; diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index 82f1ffee8..57f093840 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -97,8 +97,8 @@ struct scst_local_tgt { struct list_head tgts_list_entry; /* SCSI version descriptors */ - uint16_t scsi_transport_version; - uint16_t phys_transport_version; + u16 scsi_transport_version; + u16 phys_transport_version; }; struct scst_local_sess { @@ -113,7 +113,7 @@ struct scst_local_sess { int number; struct mutex tr_id_mutex; - uint8_t *transport_id; + u8 *transport_id; int transport_id_len; struct work_struct aen_work; @@ -151,12 +151,12 @@ MODULE_LICENSE("GPL"); MODULE_VERSION(SCST_LOCAL_VERSION); MODULE_IMPORT_NS(SCST_NAMESPACE); -static int scst_local_get_sas_transport_id(struct scst_local_sess *sess, uint8_t **transport_id, +static int scst_local_get_sas_transport_id(struct scst_local_sess *sess, u8 **transport_id, int *len) { int res = 0; int tr_id_size = 0; - uint8_t *tr_id = NULL; + u8 *tr_id = NULL; TRACE_ENTRY(); @@ -201,7 +201,7 @@ out: static int scst_local_get_initiator_port_transport_id(struct scst_tgt *tgt, struct scst_session *scst_sess, - uint8_t **transport_id) + u8 **transport_id) { int res = 0; struct scst_local_sess *sess; @@ -457,7 +457,7 @@ static ssize_t scst_local_transport_id_show(struct kobject *kobj, struct kobj_at { struct scst_session *scst_sess; struct scst_local_sess *sess; - uint8_t *tr_id; + u8 *tr_id; int tr_id_len, i; ssize_t res; @@ -1321,7 +1321,7 @@ static void scst_local_targ_task_mgmt_done(struct scst_mgmt_cmd *mgmt_cmd) TRACE_EXIT(); } -static uint16_t scst_local_get_scsi_transport_version(struct scst_tgt *scst_tgt) +static u16 scst_local_get_scsi_transport_version(struct scst_tgt *scst_tgt) { struct scst_local_tgt *tgt = scst_tgt_get_tgt_priv(scst_tgt); @@ -1336,7 +1336,7 @@ static uint16_t scst_local_get_scsi_transport_version(struct scst_tgt *scst_tgt) return tgt->scsi_transport_version; } -static uint16_t scst_local_get_phys_transport_version(struct scst_tgt *scst_tgt) +static u16 scst_local_get_phys_transport_version(struct scst_tgt *scst_tgt) { struct scst_local_tgt *tgt = scst_tgt_get_tgt_priv(scst_tgt); diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index afb3c0752..73a419227 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -1155,8 +1155,8 @@ static int srpt_get_desc_tbl(struct srpt_recv_ioctx *recv_ioctx, } else if (fmt == SRP_DATA_DESC_IMM) { struct srp_imm_buf *imm_buf = srpt_get_desc_buf(srp_cmd); void *data = (u8 *)srp_cmd + imm_data_offset; - uint32_t len = be32_to_cpu(imm_buf->len); - uint32_t req_size = imm_data_offset + len; + u32 len = be32_to_cpu(imm_buf->len); + u32 req_size = imm_data_offset + len; if (req_size > srp_max_req_size) { pr_err("Immediate data (length %d + %d) exceeds request size %d\n", @@ -2039,7 +2039,7 @@ static void srpt_process_send_completion(struct ib_cq *cq, struct srpt_rdma_ch *ch, struct ib_wc *wc) { - uint32_t index; + u32 index; enum srpt_opcode opcode; index = idx_from_wr_id(wc->wr_id); @@ -2628,7 +2628,7 @@ static int srpt_cm_req_recv(struct srpt_device *const sdev, ch->state = CH_CONNECTING; INIT_WORK(&ch->completion, srpt_do_compl_work); INIT_LIST_HEAD(&ch->cmd_wait_list); - ch->max_rsp_size = max_t(uint32_t, srp_max_rsp_size, MIN_MAX_RSP_SIZE); + ch->max_rsp_size = max_t(u32, srp_max_rsp_size, MIN_MAX_RSP_SIZE); ch->rsp_buf_cache = kmem_cache_create("srpt-rsp-buf", ch->max_rsp_size, 512, 0, NULL); @@ -3783,13 +3783,13 @@ static void srpt_tsk_mgmt_done(struct scst_mgmt_cmd *mcmnd) * See also SPC-3, section 7.5.4.5, TransportID for initiator ports using SRP. */ static int srpt_get_initiator_port_transport_id(struct scst_tgt *tgt, struct scst_session *sess, - uint8_t **transport_id) + u8 **transport_id) { struct srpt_rdma_ch *ch; struct spc_rdma_transport_id { - uint8_t protocol_identifier; - uint8_t reserved[7]; - uint8_t i_port_id[16]; + u8 protocol_identifier; + u8 reserved[7]; + u8 i_port_id[16]; }; struct spc_rdma_transport_id *tr_id; int res = SCSI_TRANSPORTID_PROTOCOLID_SRP; @@ -3812,7 +3812,7 @@ static int srpt_get_initiator_port_transport_id(struct scst_tgt *tgt, struct scs memcpy(tr_id->i_port_id, ch->nexus->i_port_id, sizeof(tr_id->i_port_id)); - *transport_id = (uint8_t *)tr_id; + *transport_id = (u8 *)tr_id; out: return res; @@ -3933,7 +3933,7 @@ static int srpt_release(struct scst_tgt *scst_tgt) * This function is called from scst_pres.c, the code that implements * persistent reservation support. */ -static uint16_t srpt_get_scsi_transport_version(struct scst_tgt *scst_tgt) +static u16 srpt_get_scsi_transport_version(struct scst_tgt *scst_tgt) { return 0x0940; /* SRP */ } diff --git a/srpt/src/ib_srpt.h b/srpt/src/ib_srpt.h index 3dc197437..12653d260 100644 --- a/srpt/src/ib_srpt.h +++ b/srpt/src/ib_srpt.h @@ -264,8 +264,8 @@ enum srpt_command_state { struct srpt_ioctx { void *buf; dma_addr_t dma; - uint32_t offset; - uint32_t index; + u32 offset; + u32 index; }; /** @@ -336,7 +336,7 @@ struct srpt_send_ioctx { struct srpt_tsk_mgmt tsk_mgmt; u8 rdma_ius_buf[2 * sizeof(struct rdma_iu) + 2 * sizeof(struct ib_sge)] - __aligned(sizeof(uint64_t)); + __aligned(sizeof(u64)); struct scst_cmd cmd; scst_data_direction dir; }; @@ -431,7 +431,7 @@ struct srpt_rdma_ch { struct ib_wc wc[16]; struct list_head list; struct list_head cmd_wait_list; - uint16_t pkey; + u16 pkey; u16 comp_vector; bool using_rdma_cm; bool processing_wait_list;