The patch below contains the following changes:

- Substituted lun_t by uint64_t and removed typedef lun_t.
- Fixed the following class of checkpatch errors (two instances):
    ERROR: space required before the open parenthesis '('

This patch has been verified as follows:
- Checked that the following command still works and did not produce any
  new compiler warnings:
    make -s clean && make -C srpt -s clean && make -s scst iscsi-scst && make -C srpt -s
- Checked that the patch generated by generate-kernel-patch still applies
  cleanly to the 2.6.25.6 kernel, and that the patched kernel tree still
  compiles, installs and boots fine, and that the iscsi-scst, ib_srpt,
  scst_disk and scst_vdisk modules still load.
- Verified that checkpatch does not report any new warnings or errors.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@444 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2008-07-09 17:19:24 +00:00
parent 7857b2532e
commit 2853eeec6c
4 changed files with 21 additions and 17 deletions

View File

@@ -403,7 +403,11 @@ struct scst_acg;
struct scst_acg_dev;
struct scst_acn;
typedef uint64_t lun_t;
/*
* 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)
typedef enum dma_data_direction scst_data_direction;
@@ -1122,7 +1126,7 @@ struct scst_cmd {
struct scst_tgt_dev *tgt_dev; /* corresponding device for this cmd */
lun_t lun; /* LUN for this cmd */
uint64_t lun; /* LUN for this cmd */
unsigned long start_time;
@@ -1282,7 +1286,7 @@ struct scst_mgmt_cmd {
/* Number of completed commands, protected by scst_mcmd_lock */
int completed_cmd_count;
lun_t lun; /* LUN for this mgmt cmd */
uint64_t lun; /* LUN for this mgmt cmd */
/* or (and for iSCSI) */
uint64_t tag; /* tag of the corresponding cmd */
@@ -1446,7 +1450,7 @@ struct scst_tgt_dev {
struct list_head sess_tgt_dev_list_entry;
struct scst_device *dev; /* to save extra dereferences */
lun_t lun; /* to save extra dereferences */
uint64_t lun; /* to save extra dereferences */
/* How many cmds alive on this dev in this session */
atomic_t tgt_dev_cmd_count;
@@ -1510,7 +1514,7 @@ struct scst_tgt_dev {
*/
struct scst_acg_dev {
struct scst_device *dev; /* corresponding device */
lun_t lun; /* device's LUN in this acg */
uint64_t lun; /* device's LUN in this acg */
unsigned int rd_only_flag:1; /* if != 0, then read only */
struct scst_acg *acg; /* parent acg */

View File

@@ -192,7 +192,7 @@ int scst_get_cmd_abnormal_done_state(const struct scst_cmd *cmd)
TRACE_ENTRY();
switch(cmd->state) {
switch (cmd->state) {
case SCST_CMD_STATE_INIT_WAIT:
case SCST_CMD_STATE_INIT:
case SCST_CMD_STATE_PRE_PARSE:
@@ -215,7 +215,7 @@ void scst_set_cmd_abnormal_done_state(struct scst_cmd *cmd)
TRACE_ENTRY();
#ifdef EXTRACHECKS
switch(cmd->state) {
switch (cmd->state) {
case SCST_CMD_STATE_PRE_XMIT_RESP:
case SCST_CMD_STATE_XMIT_RESP:
case SCST_CMD_STATE_FINISHED:
@@ -347,7 +347,7 @@ void scst_init_mem_lim(struct scst_mem_lim *mem_lim)
EXPORT_SYMBOL(scst_init_mem_lim);
struct scst_acg_dev *scst_alloc_acg_dev(struct scst_acg *acg,
struct scst_device *dev, lun_t lun)
struct scst_device *dev, uint64_t lun)
{
struct scst_acg_dev *res;
@@ -746,8 +746,8 @@ void scst_sess_free_tgt_devs(struct scst_session *sess)
}
/* The activity supposed to be suspended and scst_mutex held */
int scst_acg_add_dev(struct scst_acg *acg, struct scst_device *dev, lun_t lun,
int read_only)
int scst_acg_add_dev(struct scst_acg *acg, struct scst_device *dev,
uint64_t lun, int read_only)
{
int res = 0;
struct scst_acg_dev *acg_dev;
@@ -1922,9 +1922,9 @@ EXPORT_SYMBOL(scst_get_cdb_info);
* (see SAM-2, Section 4.12.3 page 40)
* Supports 2 types of lun unpacking: peripheral and logical unit.
*/
lun_t scst_unpack_lun(const uint8_t *lun, int len)
uint64_t scst_unpack_lun(const uint8_t *lun, int len)
{
lun_t res = (lun_t)-1;
uint64_t res = NO_SUCH_LUN;
int address_method;
TRACE_ENTRY();

View File

@@ -286,8 +286,8 @@ int scst_sess_alloc_tgt_devs(struct scst_session *sess);
void scst_sess_free_tgt_devs(struct scst_session *sess);
void scst_nexus_loss(struct scst_tgt_dev *tgt_dev);
int scst_acg_add_dev(struct scst_acg *acg, struct scst_device *dev, lun_t lun,
int read_only);
int scst_acg_add_dev(struct scst_acg *acg, struct scst_device *dev,
uint64_t lun, int read_only);
int scst_acg_remove_dev(struct scst_acg *acg, struct scst_device *dev);
int scst_acg_add_name(struct scst_acg *acg, const char *name);
@@ -359,7 +359,7 @@ int scst_alloc_space(struct scst_cmd *cmd);
void scst_release_space(struct scst_cmd *cmd);
void scst_scsi_op_list_init(void);
lun_t scst_unpack_lun(const uint8_t *lun, int len);
uint64_t scst_unpack_lun(const uint8_t *lun, int len);
struct scst_cmd *__scst_find_cmd_by_tag(struct scst_session *sess,
uint64_t tag);

View File

@@ -249,7 +249,7 @@ void scst_cmd_init_done(struct scst_cmd *cmd, int pref_context)
spin_unlock_irqrestore(&sess->sess_list_lock, flags);
if (unlikely(cmd->lun == (lun_t)-1)) {
if (unlikely(cmd->lun == NO_SUCH_LUN)) {
PRINT_ERROR("Wrong LUN %d, finishing cmd", -1);
scst_set_cmd_error(cmd,
SCST_LOAD_SENSE(scst_sense_lun_not_supported));
@@ -4821,7 +4821,7 @@ int scst_rx_mgmt_fn(struct scst_session *sess,
if (params->lun_set) {
mcmd->lun = scst_unpack_lun(params->lun, params->lun_len);
if (mcmd->lun == (lun_t)-1)
if (mcmd->lun == NO_SUCH_LUN)
goto out_free;
mcmd->lun_set = 1;
}