Remove trailing blanks

The files touched here need a bug fix which is applied with the
following patch.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil
2015-03-07 09:32:14 +01:00
parent 54e32122d3
commit d7a8ab0f1e
5 changed files with 48 additions and 48 deletions

View File

@@ -1,16 +1,16 @@
/* /*
Copyright (C) 2010 by Ronnie Sahlberg <ronniesahlberg@gmail.com> Copyright (C) 2010 by Ronnie Sahlberg <ronniesahlberg@gmail.com>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@@ -234,7 +234,7 @@ void list_luns(struct client_state *clnt, const char *target, const char *portal
void discoverylogout_cb(struct iscsi_context *iscsi, int status, void *command_data _U_, void *private_data) void discoverylogout_cb(struct iscsi_context *iscsi, int status, void *command_data _U_, void *private_data)
{ {
struct client_state *state = (struct client_state *)private_data; struct client_state *state = (struct client_state *)private_data;
if (status != 0) { if (status != 0) {
fprintf(stderr, "Failed to logout from target. : %s\n", iscsi_get_error(iscsi)); fprintf(stderr, "Failed to logout from target. : %s\n", iscsi_get_error(iscsi));
exit(10); exit(10);
@@ -257,7 +257,7 @@ void discovery_cb(struct iscsi_context *iscsi, int status, void *command_data, v
exit(10); exit(10);
} }
for(addr=command_data; addr; addr=addr->next) { for(addr=command_data; addr; addr=addr->next) {
printf("Target:%s Portal:%s\n", addr->target_name, addr->target_address); printf("Target:%s Portal:%s\n", addr->target_name, addr->target_address);
if (showluns != 0) { if (showluns != 0) {
list_luns(private_data, addr->target_name, addr->target_address); list_luns(private_data, addr->target_name, addr->target_address);
@@ -391,13 +391,13 @@ int main(int argc, char *argv[])
} }
iscsi_url = iscsi_parse_portal_url(iscsi, url); iscsi_url = iscsi_parse_portal_url(iscsi, url);
if (url) { if (url) {
free(discard_const(url)); free(discard_const(url));
} }
if (iscsi_url == NULL) { if (iscsi_url == NULL) {
fprintf(stderr, "Failed to parse URL: %s\n", fprintf(stderr, "Failed to parse URL: %s\n",
iscsi_get_error(iscsi)); iscsi_get_error(iscsi));
exit(10); exit(10);
} }

View File

@@ -1,16 +1,16 @@
/* /*
Copyright (C) 2010 by Ronnie Sahlberg <ronniesahlberg@gmail.com> Copyright (C) 2010 by Ronnie Sahlberg <ronniesahlberg@gmail.com>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@@ -262,7 +262,7 @@ int main(int argc, char *argv[])
} }
iscsi_url = iscsi_parse_full_url(client.src_iscsi, src_url); iscsi_url = iscsi_parse_full_url(client.src_iscsi, src_url);
if (iscsi_url == NULL) { if (iscsi_url == NULL) {
fprintf(stderr, "Failed to parse URL: %s\n", fprintf(stderr, "Failed to parse URL: %s\n",
iscsi_get_error(client.src_iscsi)); iscsi_get_error(client.src_iscsi));
exit(10); exit(10);
} }
@@ -321,7 +321,7 @@ int main(int argc, char *argv[])
} }
iscsi_url = iscsi_parse_full_url(client.dst_iscsi, dst_url); iscsi_url = iscsi_parse_full_url(client.dst_iscsi, dst_url);
if (iscsi_url == NULL) { if (iscsi_url == NULL) {
fprintf(stderr, "Failed to parse URL: %s\n", fprintf(stderr, "Failed to parse URL: %s\n",
iscsi_get_error(client.dst_iscsi)); iscsi_get_error(client.dst_iscsi));
exit(10); exit(10);
} }

View File

@@ -74,7 +74,7 @@ int open(const char *path, int flags, mode_t mode)
if (mode & O_NONBLOCK) { if (mode & O_NONBLOCK) {
LD_ISCSI_DPRINTF(0,"Non-blocking I/O is currently not supported"); LD_ISCSI_DPRINTF(0,"Non-blocking I/O is currently not supported");
errno = EINVAL; errno = EINVAL;
return -1; return -1;
} }
iscsi = iscsi_create_context(initiator); iscsi = iscsi_create_context(initiator);
@@ -131,7 +131,7 @@ int open(const char *path, int flags, mode_t mode)
errno = EIO; errno = EIO;
return -1; return -1;
} }
LD_ISCSI_DPRINTF(4,"readcapacity16_sync: block_size: %d, num_blocks: %"PRIu64,rc16->block_length,rc16->returned_lba + 1); LD_ISCSI_DPRINTF(4,"readcapacity16_sync: block_size: %d, num_blocks: %"PRIu64,rc16->block_length,rc16->returned_lba + 1);
fd = iscsi_get_fd(iscsi); fd = iscsi_get_fd(iscsi);
@@ -141,7 +141,7 @@ int open(const char *path, int flags, mode_t mode)
iscsi_destroy_context(iscsi); iscsi_destroy_context(iscsi);
errno = ENFILE; errno = ENFILE;
return -1; return -1;
} }
iscsi_fd_list[fd].is_iscsi = 1; iscsi_fd_list[fd].is_iscsi = 1;
iscsi_fd_list[fd].dup2fd = -1; iscsi_fd_list[fd].dup2fd = -1;
@@ -263,7 +263,7 @@ int __lxstat(int ver, const char *path, struct stat *buf)
ret = __fxstat(ver, fd, buf); ret = __fxstat(ver, fd, buf);
close(fd); close(fd);
return ret; return ret;
} }
return real_lxstat(ver, path, buf); return real_lxstat(ver, path, buf);
@@ -303,7 +303,7 @@ off_t lseek(int fd, off_t offset, int whence) {
iscsi_fd_list[fd].offset=new_offset; iscsi_fd_list[fd].offset=new_offset;
return iscsi_fd_list[fd].offset; return iscsi_fd_list[fd].offset;
} }
return real_lseek(fd, offset, whence); return real_lseek(fd, offset, whence);
} }
@@ -415,7 +415,7 @@ ssize_t read(int fd, void *buf, size_t count)
return real_read(fd, buf, count); return real_read(fd, buf, count);
} }
ssize_t (*real_pread)(int fd, void *buf, size_t count, off_t offset); ssize_t (*real_pread)(int fd, void *buf, size_t count, off_t offset);
ssize_t pread(int fd, void *buf, size_t count, off_t offset) { ssize_t pread(int fd, void *buf, size_t count, off_t offset) {
if ((iscsi_fd_list[fd].is_iscsi == 1 && iscsi_fd_list[fd].in_flight == 0)) { if ((iscsi_fd_list[fd].is_iscsi == 1 && iscsi_fd_list[fd].in_flight == 0)) {
off_t old_offset; off_t old_offset;
@@ -438,7 +438,7 @@ ssize_t pread(int fd, void *buf, size_t count, off_t offset) {
ssize_t (*real_write)(int fd, const void *buf, size_t count); ssize_t (*real_write)(int fd, const void *buf, size_t count);
ssize_t write(int fd, const void *buf, size_t count) ssize_t write(int fd, const void *buf, size_t count)
{ {
if ((iscsi_fd_list[fd].is_iscsi == 1) && (iscsi_fd_list[fd].in_flight == 0)) { if ((iscsi_fd_list[fd].is_iscsi == 1) && (iscsi_fd_list[fd].in_flight == 0)) {
uint64_t offset; uint64_t offset;
@@ -485,7 +485,7 @@ ssize_t write(int fd, const void *buf, size_t count)
iscsi_fd_list[fd].offset += count; iscsi_fd_list[fd].offset += count;
scsi_free_scsi_task(task); scsi_free_scsi_task(task);
return count; return count;
} }
@@ -578,7 +578,7 @@ int __lxstat64(int ver, const char *path, struct stat64 *buf)
ret = __fxstat64(ver, fd, buf); ret = __fxstat64(ver, fd, buf);
close(fd); close(fd);
return ret; return ret;
} }
return real_lxstat64(ver, path, buf); return real_lxstat64(ver, path, buf);

View File

@@ -482,7 +482,7 @@ iscsi_queue_pdu(struct iscsi_context *iscsi, struct iscsi_pdu *pdu)
int int
orwrite(struct scsi_device *sdev, uint64_t lba, orwrite(struct scsi_device *sdev, uint64_t lba,
uint32_t datalen, int blocksize, int wrprotect, uint32_t datalen, int blocksize, int wrprotect,
int dpo, int fua, int fua_nv, int group, int dpo, int fua, int fua_nv, int group,
unsigned char *data, unsigned char *data,
int status, enum scsi_sense_key key, int *ascq, int num_ascq) int status, enum scsi_sense_key key, int *ascq, int num_ascq)
@@ -1581,7 +1581,7 @@ read6(struct scsi_device *sdev, struct scsi_task **out_task, uint32_t lba,
int int
read10(struct scsi_device *sdev, struct scsi_task **out_task, read10(struct scsi_device *sdev, struct scsi_task **out_task,
uint32_t lba, uint32_t lba,
uint32_t datalen, int blocksize, int rdprotect, uint32_t datalen, int blocksize, int rdprotect,
int dpo, int fua, int fua_nv, int group, int dpo, int fua, int fua_nv, int group,
unsigned char *data, unsigned char *data,
int status, enum scsi_sense_key key, int *ascq, int num_ascq) int status, enum scsi_sense_key key, int *ascq, int num_ascq)
@@ -1615,7 +1615,7 @@ read10(struct scsi_device *sdev, struct scsi_task **out_task,
int int
read12(struct scsi_device *sdev, uint32_t lba, read12(struct scsi_device *sdev, uint32_t lba,
uint32_t datalen, int blocksize, int rdprotect, uint32_t datalen, int blocksize, int rdprotect,
int dpo, int fua, int fua_nv, int group, int dpo, int fua, int fua_nv, int group,
unsigned char *data, unsigned char *data,
int status, enum scsi_sense_key key, int *ascq, int num_ascq) int status, enum scsi_sense_key key, int *ascq, int num_ascq)
@@ -1647,7 +1647,7 @@ read12(struct scsi_device *sdev, uint32_t lba,
int int
read16(struct scsi_device *sdev, uint64_t lba, read16(struct scsi_device *sdev, uint64_t lba,
uint32_t datalen, int blocksize, int rdprotect, uint32_t datalen, int blocksize, int rdprotect,
int dpo, int fua, int fua_nv, int group, int dpo, int fua, int fua_nv, int group,
unsigned char *data, unsigned char *data,
int status, enum scsi_sense_key key, int *ascq, int num_ascq) int status, enum scsi_sense_key key, int *ascq, int num_ascq)
@@ -2170,7 +2170,7 @@ writesame16(struct scsi_device *sdev, uint64_t lba, uint32_t datalen, int num, i
int int
writeverify10(struct scsi_device *sdev, uint32_t lba, writeverify10(struct scsi_device *sdev, uint32_t lba,
uint32_t datalen, int blocksize, int wrprotect, uint32_t datalen, int blocksize, int wrprotect,
int dpo, int bytchk, int group, unsigned char *data, int dpo, int bytchk, int group, unsigned char *data,
int status, enum scsi_sense_key key, int *ascq, int num_ascq) int status, enum scsi_sense_key key, int *ascq, int num_ascq)
{ {
@@ -2206,7 +2206,7 @@ writeverify10(struct scsi_device *sdev, uint32_t lba,
int int
writeverify12(struct scsi_device *sdev, uint32_t lba, writeverify12(struct scsi_device *sdev, uint32_t lba,
uint32_t datalen, int blocksize, int wrprotect, uint32_t datalen, int blocksize, int wrprotect,
int dpo, int bytchk, int group, unsigned char *data, int dpo, int bytchk, int group, unsigned char *data,
int status, enum scsi_sense_key key, int *ascq, int num_ascq) int status, enum scsi_sense_key key, int *ascq, int num_ascq)
{ {
@@ -2242,7 +2242,7 @@ writeverify12(struct scsi_device *sdev, uint32_t lba,
int int
writeverify16(struct scsi_device *sdev, uint64_t lba, writeverify16(struct scsi_device *sdev, uint64_t lba,
uint32_t datalen, int blocksize, int wrprotect, uint32_t datalen, int blocksize, int wrprotect,
int dpo, int bytchk, int group, unsigned char *data, int dpo, int bytchk, int group, unsigned char *data,
int status, enum scsi_sense_key key, int *ascq, int num_ascq) int status, enum scsi_sense_key key, int *ascq, int num_ascq)
{ {
@@ -2316,7 +2316,7 @@ get_command_descriptor(int opcode, int sa)
return &rsop->descriptors[i]; return &rsop->descriptors[i];
} }
} }
return NULL; return NULL;
} }

View File

@@ -1,16 +1,16 @@
/* /*
Copyright (C) 2014 by Peter Lieven <pl@kamp.de> Copyright (C) 2014 by Peter Lieven <pl@kamp.de>
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or the Free Software Foundation; either version 2 of the License, or
(at your option) any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@@ -86,7 +86,7 @@ void progress(struct client *client) {
uint64_t _runtime = (now - client->first_ns) / 1000000000UL; uint64_t _runtime = (now - client->first_ns) / 1000000000UL;
if (runtime) _runtime = runtime - _runtime; if (runtime) _runtime = runtime - _runtime;
printf ("\r"); printf ("\r");
uint64_t aiops = 1000000000UL * (client->iops) / (now - client->first_ns); uint64_t aiops = 1000000000UL * (client->iops) / (now - client->first_ns);
if (!_runtime) { if (!_runtime) {
@@ -197,9 +197,9 @@ int main(int argc, char *argv[])
int option_index; int option_index;
memset(&client, 0, sizeof(client)); memset(&client, 0, sizeof(client));
srand(time(NULL)); srand(time(NULL));
printf("iscsi-perf version %s - (c) 2014 by Peter Lieven <pl@ĸamp.de>\n\n", VERSION); printf("iscsi-perf version %s - (c) 2014 by Peter Lieven <pl@ĸamp.de>\n\n", VERSION);
while ((c = getopt_long(argc, argv, "i:m:b:t:nr", long_options, while ((c = getopt_long(argc, argv, "i:m:b:t:nr", long_options,
@@ -244,7 +244,7 @@ int main(int argc, char *argv[])
} }
iscsi_url = iscsi_parse_full_url(client.iscsi, url); iscsi_url = iscsi_parse_full_url(client.iscsi, url);
if (iscsi_url == NULL) { if (iscsi_url == NULL) {
fprintf(stderr, "Failed to parse URL: %s\n", fprintf(stderr, "Failed to parse URL: %s\n",
iscsi_get_error(client.iscsi)); iscsi_get_error(client.iscsi));
exit(10); exit(10);
} }
@@ -286,12 +286,12 @@ int main(int argc, char *argv[])
client.blocksize = rc16->block_length; client.blocksize = rc16->block_length;
client.num_blocks = rc16->returned_lba + 1; client.num_blocks = rc16->returned_lba + 1;
scsi_free_scsi_task(task); scsi_free_scsi_task(task);
printf("capacity is %" PRIu64 " blocks or %" PRIu64 " byte (%" PRIu64 " MB)\n", client.num_blocks, client.num_blocks * client.blocksize, printf("capacity is %" PRIu64 " blocks or %" PRIu64 " byte (%" PRIu64 " MB)\n", client.num_blocks, client.num_blocks * client.blocksize,
(client.num_blocks * client.blocksize) >> 20); (client.num_blocks * client.blocksize) >> 20);
printf("performing %s READ with %d parallel requests\nfixed transfer size of %d blocks (%d byte)\n", printf("performing %s READ with %d parallel requests\nfixed transfer size of %d blocks (%d byte)\n",
client.random ? "random" : "sequential", max_in_flight, blocks_per_io, blocks_per_io * client.blocksize); client.random ? "random" : "sequential", max_in_flight, blocks_per_io, blocks_per_io * client.blocksize);
@@ -300,18 +300,18 @@ int main(int argc, char *argv[])
} else { } else {
printf("infinite runtime - press CTRL-C to abort.\n"); printf("infinite runtime - press CTRL-C to abort.\n");
} }
struct sigaction sa; struct sigaction sa;
sa.sa_handler = &sig_handler; sa.sa_handler = &sig_handler;
sa.sa_flags = SA_RESTART; sa.sa_flags = SA_RESTART;
sigaction(SIGINT, &sa, NULL); sigaction(SIGINT, &sa, NULL);
sigaction(SIGTERM, &sa, NULL); sigaction(SIGTERM, &sa, NULL);
printf("\n"); printf("\n");
client.first_ns = client.last_ns = get_clock_ns(); client.first_ns = client.last_ns = get_clock_ns();
fill_read_queue(&client); fill_read_queue(&client);
while (client.in_flight) { while (client.in_flight) {
@@ -326,9 +326,9 @@ int main(int argc, char *argv[])
break; break;
} }
} }
progress(&client); progress(&client);
printf ("\n\nfinished.\n"); printf ("\n\nfinished.\n");
iscsi_logout_sync(client.iscsi); iscsi_logout_sync(client.iscsi);