Fix incorrect whitespaces
At a few places there where spaces where tabulators where appropriate
This commit is contained in:
@@ -87,13 +87,13 @@ iscsi_login_cb(struct iscsi_context *iscsi, int status, void *command_data _U_,
|
||||
{
|
||||
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);
|
||||
if (iscsi_connect_async(iscsi, iscsi->target_address, iscsi_connect_cb, iscsi->connect_data) != 0) {
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (status != 0) {
|
||||
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;
|
||||
|
||||
DPRINTF(iscsi,2,"reconnect initiated");
|
||||
DPRINTF(iscsi,2,"reconnect initiated");
|
||||
|
||||
/* This is mainly for tests, where we do not want to automatically
|
||||
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;
|
||||
}
|
||||
|
||||
int retry = 0;
|
||||
srand (time(NULL)^getpid());
|
||||
int retry = 0;
|
||||
srand (time(NULL)^getpid());
|
||||
|
||||
try_again:
|
||||
|
||||
|
||||
@@ -272,7 +272,7 @@ iscsi_destroy_context(struct iscsi_context *iscsi)
|
||||
free(discard_const(iscsi->chap_c));
|
||||
iscsi->chap_c = NULL;
|
||||
|
||||
if (iscsi->connected_portal != NULL) {
|
||||
if (iscsi->connected_portal != NULL) {
|
||||
free(discard_const(iscsi->connected_portal));
|
||||
iscsi->connected_portal = NULL;
|
||||
}
|
||||
@@ -587,8 +587,7 @@ iscsi_destroy_url(struct iscsi_url *iscsi_url)
|
||||
|
||||
int
|
||||
iscsi_set_initiator_username_pwd(struct iscsi_context *iscsi,
|
||||
const char *user,
|
||||
const char *passwd)
|
||||
const char *user, const char *passwd)
|
||||
{
|
||||
free(discard_const(iscsi->user));
|
||||
iscsi->user = strdup(user);
|
||||
|
||||
@@ -1088,12 +1088,12 @@ iscsi_process_login_reply(struct iscsi_context *iscsi, struct iscsi_pdu *pdu,
|
||||
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);
|
||||
pdu->callback(iscsi, SCSI_STATUS_REDIRECT, NULL,
|
||||
pdu->private_data);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (status != 0) {
|
||||
iscsi_set_error(iscsi, "Failed to log in to target. Status: %s(%d)",
|
||||
|
||||
@@ -76,8 +76,8 @@ scsi_malloc(struct scsi_task *task, size_t size)
|
||||
}
|
||||
|
||||
struct value_string {
|
||||
int value;
|
||||
const char *string;
|
||||
int value;
|
||||
const char *string;
|
||||
};
|
||||
|
||||
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;
|
||||
} else {
|
||||
task->xfer_dir = SCSI_XFER_NONE;
|
||||
}
|
||||
}
|
||||
task->expxferlen = xferlen;
|
||||
|
||||
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 *next;
|
||||
uint32_t len;
|
||||
unsigned char *data;
|
||||
struct scsi_data_buffer *next;
|
||||
uint32_t len;
|
||||
unsigned char *data;
|
||||
};
|
||||
|
||||
int
|
||||
|
||||
26
lib/socket.c
26
lib/socket.c
@@ -114,7 +114,7 @@ iscsi_connect_async(struct iscsi_context *iscsi, const char *portal,
|
||||
struct addrinfo *ai = NULL;
|
||||
int socksize;
|
||||
|
||||
DPRINTF(iscsi,2,"connecting to portal %s",portal);
|
||||
DPRINTF(iscsi,2,"connecting to portal %s",portal);
|
||||
|
||||
if (iscsi->fd != -1) {
|
||||
iscsi_set_error(iscsi,
|
||||
@@ -212,7 +212,7 @@ iscsi_connect_async(struct iscsi_context *iscsi, const char *portal,
|
||||
set_tcp_user_timeout(iscsi);
|
||||
}
|
||||
|
||||
if (iscsi->tcp_syncnt > 0) {
|
||||
if (iscsi->tcp_syncnt > 0) {
|
||||
set_tcp_syncnt(iscsi);
|
||||
}
|
||||
|
||||
@@ -497,7 +497,7 @@ iscsi_service(struct iscsi_context *iscsi, int revents)
|
||||
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->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)
|
||||
{
|
||||
iscsi->tcp_syncnt=value;
|
||||
DPRINTF(iscsi,2,"TCP_SYNCNT will be set to %d on next socket creation",value);
|
||||
iscsi->tcp_syncnt=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)
|
||||
{
|
||||
iscsi->tcp_user_timeout=timeout_ms;
|
||||
DPRINTF(iscsi,2,"TCP_USER_TIMEOUT will be set to %dms on next socket creation",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);
|
||||
}
|
||||
|
||||
void iscsi_set_tcp_keepidle(struct iscsi_context *iscsi, int value)
|
||||
{
|
||||
iscsi->tcp_keepidle=value;
|
||||
DPRINTF(iscsi,2,"TCP_KEEPIDLE will be set to %d on next socket creation",value);
|
||||
iscsi->tcp_keepidle=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)
|
||||
{
|
||||
iscsi->tcp_keepcnt=value;
|
||||
DPRINTF(iscsi,2,"TCP_KEEPCNT will be set to %d on next socket creation",value);
|
||||
iscsi->tcp_keepcnt=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)
|
||||
{
|
||||
iscsi->tcp_keepintvl=value;
|
||||
DPRINTF(iscsi,2,"TCP_KEEPINTVL will be set to %d on next socket creation",value);
|
||||
iscsi->tcp_keepintvl=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)
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
#include "scsi-lowlevel.h"
|
||||
|
||||
struct iscsi_sync_state {
|
||||
int finished;
|
||||
int status;
|
||||
struct scsi_task *task;
|
||||
int finished;
|
||||
int status;
|
||||
struct scsi_task *task;
|
||||
};
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user