Fix incorrect whitespaces

At a few places there where spaces where tabulators where appropriate
This commit is contained in:
Peter Lieven
2012-10-20 19:08:57 +02:00
parent 3f5a75ce5e
commit 20cf2b279e
6 changed files with 31 additions and 32 deletions

View File

@@ -87,13 +87,13 @@ iscsi_login_cb(struct iscsi_context *iscsi, int status, void *command_data _U_,
{ {
struct connect_task *ct = private_data; struct connect_task *ct = private_data;
if (status == SCSI_STATUS_REDIRECT && iscsi->target_address) { if (status == SCSI_STATUS_REDIRECT && iscsi->target_address) {
iscsi_disconnect(iscsi); iscsi_disconnect(iscsi);
if (iscsi_connect_async(iscsi, iscsi->target_address, iscsi_connect_cb, iscsi->connect_data) != 0) { if (iscsi_connect_async(iscsi, iscsi->target_address, iscsi_connect_cb, iscsi->connect_data) != 0) {
return; return;
} }
return; return;
} }
if (status != 0) { if (status != 0) {
ct->cb(iscsi, SCSI_STATUS_ERROR, NULL, ct->private_data); ct->cb(iscsi, SCSI_STATUS_ERROR, NULL, ct->private_data);
@@ -171,7 +171,7 @@ int iscsi_reconnect(struct iscsi_context *old_iscsi)
{ {
struct iscsi_context *iscsi = old_iscsi; struct iscsi_context *iscsi = old_iscsi;
DPRINTF(iscsi,2,"reconnect initiated"); DPRINTF(iscsi,2,"reconnect initiated");
/* This is mainly for tests, where we do not want to automatically /* This is mainly for tests, where we do not want to automatically
reconnect but rather want the commands to fail with an error reconnect but rather want the commands to fail with an error
@@ -210,8 +210,8 @@ int iscsi_reconnect(struct iscsi_context *old_iscsi)
return 0; return 0;
} }
int retry = 0; int retry = 0;
srand (time(NULL)^getpid()); srand (time(NULL)^getpid());
try_again: try_again:

View File

@@ -272,7 +272,7 @@ iscsi_destroy_context(struct iscsi_context *iscsi)
free(discard_const(iscsi->chap_c)); free(discard_const(iscsi->chap_c));
iscsi->chap_c = NULL; iscsi->chap_c = NULL;
if (iscsi->connected_portal != NULL) { if (iscsi->connected_portal != NULL) {
free(discard_const(iscsi->connected_portal)); free(discard_const(iscsi->connected_portal));
iscsi->connected_portal = NULL; iscsi->connected_portal = NULL;
} }
@@ -587,8 +587,7 @@ iscsi_destroy_url(struct iscsi_url *iscsi_url)
int int
iscsi_set_initiator_username_pwd(struct iscsi_context *iscsi, iscsi_set_initiator_username_pwd(struct iscsi_context *iscsi,
const char *user, const char *user, const char *passwd)
const char *passwd)
{ {
free(discard_const(iscsi->user)); free(discard_const(iscsi->user));
iscsi->user = strdup(user); iscsi->user = strdup(user);

View File

@@ -1088,12 +1088,12 @@ iscsi_process_login_reply(struct iscsi_context *iscsi, struct iscsi_pdu *pdu,
size -= len + 1; size -= len + 1;
} }
if (status == SCSI_STATUS_REDIRECT && iscsi->target_address) { if (status == SCSI_STATUS_REDIRECT && iscsi->target_address) {
DPRINTF(iscsi,2,"target requests redirect to %s",iscsi->target_address); DPRINTF(iscsi,2,"target requests redirect to %s",iscsi->target_address);
pdu->callback(iscsi, SCSI_STATUS_REDIRECT, NULL, pdu->callback(iscsi, SCSI_STATUS_REDIRECT, NULL,
pdu->private_data); pdu->private_data);
return 0; return 0;
} }
if (status != 0) { if (status != 0) {
iscsi_set_error(iscsi, "Failed to log in to target. Status: %s(%d)", iscsi_set_error(iscsi, "Failed to log in to target. Status: %s(%d)",

View File

@@ -76,8 +76,8 @@ scsi_malloc(struct scsi_task *task, size_t size)
} }
struct value_string { struct value_string {
int value; int value;
const char *string; const char *string;
}; };
static const char * static const char *
@@ -1285,7 +1285,7 @@ scsi_cdb_compareandwrite(uint64_t lba, uint32_t xferlen, int blocksize, int wrpr
task->xfer_dir = SCSI_XFER_WRITE; task->xfer_dir = SCSI_XFER_WRITE;
} else { } else {
task->xfer_dir = SCSI_XFER_NONE; task->xfer_dir = SCSI_XFER_NONE;
} }
task->expxferlen = xferlen; task->expxferlen = xferlen;
task->params.compareandwrite.lba = lba; task->params.compareandwrite.lba = lba;
@@ -2390,9 +2390,9 @@ scsi_get_task_private_ptr(struct scsi_task *task)
struct scsi_data_buffer { struct scsi_data_buffer {
struct scsi_data_buffer *next; struct scsi_data_buffer *next;
uint32_t len; uint32_t len;
unsigned char *data; unsigned char *data;
}; };
int int

View File

@@ -114,7 +114,7 @@ iscsi_connect_async(struct iscsi_context *iscsi, const char *portal,
struct addrinfo *ai = NULL; struct addrinfo *ai = NULL;
int socksize; int socksize;
DPRINTF(iscsi,2,"connecting to portal %s",portal); DPRINTF(iscsi,2,"connecting to portal %s",portal);
if (iscsi->fd != -1) { if (iscsi->fd != -1) {
iscsi_set_error(iscsi, iscsi_set_error(iscsi,
@@ -212,7 +212,7 @@ iscsi_connect_async(struct iscsi_context *iscsi, const char *portal,
set_tcp_user_timeout(iscsi); set_tcp_user_timeout(iscsi);
} }
if (iscsi->tcp_syncnt > 0) { if (iscsi->tcp_syncnt > 0) {
set_tcp_syncnt(iscsi); set_tcp_syncnt(iscsi);
} }
@@ -497,7 +497,7 @@ iscsi_service(struct iscsi_context *iscsi, int revents)
return iscsi_service_reconnect_if_loggedin(iscsi); return iscsi_service_reconnect_if_loggedin(iscsi);
} }
DPRINTF(iscsi,2,"connection to %s established",iscsi->connected_portal); DPRINTF(iscsi,2,"connection to %s established",iscsi->connected_portal);
iscsi->is_connected = 1; iscsi->is_connected = 1;
iscsi->socket_status_cb(iscsi, SCSI_STATUS_GOOD, NULL, iscsi->socket_status_cb(iscsi, SCSI_STATUS_GOOD, NULL,
@@ -568,32 +568,32 @@ iscsi_free_iscsi_inqueue(struct iscsi_in_pdu *inqueue)
void iscsi_set_tcp_syncnt(struct iscsi_context *iscsi, int value) void iscsi_set_tcp_syncnt(struct iscsi_context *iscsi, int value)
{ {
iscsi->tcp_syncnt=value; iscsi->tcp_syncnt=value;
DPRINTF(iscsi,2,"TCP_SYNCNT will be set to %d on next socket creation",value); DPRINTF(iscsi,2,"TCP_SYNCNT will be set to %d on next socket creation",value);
} }
void iscsi_set_tcp_user_timeout(struct iscsi_context *iscsi, int timeout_ms) void iscsi_set_tcp_user_timeout(struct iscsi_context *iscsi, int timeout_ms)
{ {
iscsi->tcp_user_timeout=timeout_ms; iscsi->tcp_user_timeout=timeout_ms;
DPRINTF(iscsi,2,"TCP_USER_TIMEOUT will be set to %dms on next socket creation",timeout_ms); DPRINTF(iscsi,2,"TCP_USER_TIMEOUT will be set to %dms on next socket creation",timeout_ms);
} }
void iscsi_set_tcp_keepidle(struct iscsi_context *iscsi, int value) void iscsi_set_tcp_keepidle(struct iscsi_context *iscsi, int value)
{ {
iscsi->tcp_keepidle=value; iscsi->tcp_keepidle=value;
DPRINTF(iscsi,2,"TCP_KEEPIDLE will be set to %d on next socket creation",value); DPRINTF(iscsi,2,"TCP_KEEPIDLE will be set to %d on next socket creation",value);
} }
void iscsi_set_tcp_keepcnt(struct iscsi_context *iscsi, int value) void iscsi_set_tcp_keepcnt(struct iscsi_context *iscsi, int value)
{ {
iscsi->tcp_keepcnt=value; iscsi->tcp_keepcnt=value;
DPRINTF(iscsi,2,"TCP_KEEPCNT will be set to %d on next socket creation",value); DPRINTF(iscsi,2,"TCP_KEEPCNT will be set to %d on next socket creation",value);
} }
void iscsi_set_tcp_keepintvl(struct iscsi_context *iscsi, int value) void iscsi_set_tcp_keepintvl(struct iscsi_context *iscsi, int value)
{ {
iscsi->tcp_keepintvl=value; iscsi->tcp_keepintvl=value;
DPRINTF(iscsi,2,"TCP_KEEPINTVL will be set to %d on next socket creation",value); DPRINTF(iscsi,2,"TCP_KEEPINTVL will be set to %d on next socket creation",value);
} }
int iscsi_set_tcp_keepalive(struct iscsi_context *iscsi, int idle, int count, int interval) int iscsi_set_tcp_keepalive(struct iscsi_context *iscsi, int idle, int count, int interval)

View File

@@ -30,9 +30,9 @@
#include "scsi-lowlevel.h" #include "scsi-lowlevel.h"
struct iscsi_sync_state { struct iscsi_sync_state {
int finished; int finished;
int status; int status;
struct scsi_task *task; struct scsi_task *task;
}; };
static void static void