diff --git a/aros/iscsi-ls.c b/aros/iscsi-ls.c index 1e45d2c..8d22901 100644 --- a/aros/iscsi-ls.c +++ b/aros/iscsi-ls.c @@ -1,16 +1,16 @@ -/* +/* Copyright (C) 2010 by Ronnie Sahlberg - + 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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, see . */ @@ -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) { struct client_state *state = (struct client_state *)private_data; - + if (status != 0) { fprintf(stderr, "Failed to logout from target. : %s\n", iscsi_get_error(iscsi)); exit(10); @@ -257,7 +257,7 @@ void discovery_cb(struct iscsi_context *iscsi, int status, void *command_data, v 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); if (showluns != 0) { 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); - + if (url) { free(discard_const(url)); } if (iscsi_url == NULL) { - fprintf(stderr, "Failed to parse URL: %s\n", + fprintf(stderr, "Failed to parse URL: %s\n", iscsi_get_error(iscsi)); exit(10); } diff --git a/examples/iscsi-dd.c b/examples/iscsi-dd.c index 27dc228..2b2cbd0 100644 --- a/examples/iscsi-dd.c +++ b/examples/iscsi-dd.c @@ -1,16 +1,16 @@ -/* +/* Copyright (C) 2010 by Ronnie Sahlberg - + 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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, see . */ @@ -262,7 +262,7 @@ int main(int argc, char *argv[]) } iscsi_url = iscsi_parse_full_url(client.src_iscsi, src_url); 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)); exit(10); } @@ -321,7 +321,7 @@ int main(int argc, char *argv[]) } iscsi_url = iscsi_parse_full_url(client.dst_iscsi, dst_url); 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)); exit(10); } diff --git a/examples/ld_iscsi.c b/examples/ld_iscsi.c index 02f9d25..a05eb66 100644 --- a/examples/ld_iscsi.c +++ b/examples/ld_iscsi.c @@ -74,7 +74,7 @@ int open(const char *path, int flags, mode_t mode) if (mode & O_NONBLOCK) { LD_ISCSI_DPRINTF(0,"Non-blocking I/O is currently not supported"); errno = EINVAL; - return -1; + return -1; } iscsi = iscsi_create_context(initiator); @@ -131,7 +131,7 @@ int open(const char *path, int flags, mode_t mode) errno = EIO; return -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); @@ -141,7 +141,7 @@ int open(const char *path, int flags, mode_t mode) iscsi_destroy_context(iscsi); errno = ENFILE; return -1; - } + } iscsi_fd_list[fd].is_iscsi = 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); close(fd); - return ret; + return ret; } 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; return iscsi_fd_list[fd].offset; } - + 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); } -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) { if ((iscsi_fd_list[fd].is_iscsi == 1 && iscsi_fd_list[fd].in_flight == 0)) { 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 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)) { uint64_t offset; @@ -485,7 +485,7 @@ ssize_t write(int fd, const void *buf, size_t count) iscsi_fd_list[fd].offset += count; scsi_free_scsi_task(task); - + return count; } @@ -578,7 +578,7 @@ int __lxstat64(int ver, const char *path, struct stat64 *buf) ret = __fxstat64(ver, fd, buf); close(fd); - return ret; + return ret; } return real_lxstat64(ver, path, buf); diff --git a/test-tool/iscsi-support.c b/test-tool/iscsi-support.c index abdde7d..028ccfe 100644 --- a/test-tool/iscsi-support.c +++ b/test-tool/iscsi-support.c @@ -482,7 +482,7 @@ iscsi_queue_pdu(struct iscsi_context *iscsi, struct iscsi_pdu *pdu) int 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, unsigned char *data, 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 read10(struct scsi_device *sdev, struct scsi_task **out_task, 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, unsigned char *data, 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 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, unsigned char *data, 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 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, unsigned char *data, 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 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 status, enum scsi_sense_key key, int *ascq, int num_ascq) { @@ -2206,7 +2206,7 @@ writeverify10(struct scsi_device *sdev, uint32_t lba, int 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 status, enum scsi_sense_key key, int *ascq, int num_ascq) { @@ -2242,7 +2242,7 @@ writeverify12(struct scsi_device *sdev, uint32_t lba, int 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 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 NULL; } diff --git a/utils/iscsi-perf.c b/utils/iscsi-perf.c index 3827903..f43e575 100644 --- a/utils/iscsi-perf.c +++ b/utils/iscsi-perf.c @@ -1,16 +1,16 @@ -/* +/* Copyright (C) 2014 by Peter Lieven - + 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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, see . */ @@ -86,7 +86,7 @@ void progress(struct client *client) { uint64_t _runtime = (now - client->first_ns) / 1000000000UL; if (runtime) _runtime = runtime - _runtime; - + printf ("\r"); uint64_t aiops = 1000000000UL * (client->iops) / (now - client->first_ns); if (!_runtime) { @@ -197,9 +197,9 @@ int main(int argc, char *argv[]) int option_index; memset(&client, 0, sizeof(client)); - + srand(time(NULL)); - + printf("iscsi-perf version %s - (c) 2014 by Peter Lieven \n\n", VERSION); 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); 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)); exit(10); } @@ -286,12 +286,12 @@ int main(int argc, char *argv[]) client.blocksize = rc16->block_length; client.num_blocks = rc16->returned_lba + 1; - + scsi_free_scsi_task(task); 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); - + 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); @@ -300,18 +300,18 @@ int main(int argc, char *argv[]) } else { printf("infinite runtime - press CTRL-C to abort.\n"); } - + struct sigaction sa; sa.sa_handler = &sig_handler; sa.sa_flags = SA_RESTART; - + sigaction(SIGINT, &sa, NULL); sigaction(SIGTERM, &sa, NULL); - + printf("\n"); - + client.first_ns = client.last_ns = get_clock_ns(); - + fill_read_queue(&client); while (client.in_flight) { @@ -326,9 +326,9 @@ int main(int argc, char *argv[]) break; } } - + progress(&client); - + printf ("\n\nfinished.\n"); iscsi_logout_sync(client.iscsi);