Add implicit-fallthrough decorator
Also some minor style-cleanups
Test-Parameters: trivial
HPE-bug-id: LUS-10201
Fixes:
689714eb51 ("LU-13846 llite: move iov iter forward by ourself")
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I3be3b27c1c006d13820ea55a84c083fbfc8c4b0f
Reviewed-on: https://review.whamcloud.com/46297
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
- * version of copy command using async i/o
+ * version of copy command using async I/O
* From: Stephen Hemminger <shemminger@osdl.org>
* Modified by Daniel McNeil <daniel@osdl.org> for testing aio.
* - added -a alignment
* - added -b blksize option
* From: Stephen Hemminger <shemminger@osdl.org>
* Modified by Daniel McNeil <daniel@osdl.org> for testing aio.
* - added -a alignment
* - added -b blksize option
- * _ added -s size option
+ * - added -s size option
* - added -f open_flag option
* - added -w (no write) option (reads from source only)
* - added -n (num aio) option
* - added -f open_flag option
* - added -w (no write) option (reads from source only)
* - added -n (num aio) option
* - 2/2004 Marty Ridgeway (mridge@us.ibm.com) Changes to adapt to LTP
*/
* - 2/2004 Marty Ridgeway (mridge@us.ibm.com) Changes to adapt to LTP
*/
-//#define _GNU_SOURCE
-//#define DEBUG 1
+/* #define _GNU_SOURCE */
+/* #define DEBUG 1 */
#undef DEBUG
#include <unistd.h>
#undef DEBUG
#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/select.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/select.h>
+#include <lustre/lustreapi.h>
#include <libaio.h>
#define AIO_BLKSIZE (64*1024)
#include <libaio.h>
#define AIO_BLKSIZE (64*1024)
static int aio_blksize = AIO_BLKSIZE;
static int aio_maxio = AIO_MAXIO;
static int aio_blksize = AIO_BLKSIZE;
static int aio_maxio = AIO_MAXIO;
-static int busy; // # of I/O's in flight
-static int tocopy; // # of blocks left to copy
-static int srcfd; // source fd
-static int dstfd = -1; // destination file descriptor
+static int busy; /* # of I/O's in flight */
+static int tocopy; /* # of blocks left to copy */
+static int srcfd; /* source fd */
+static int dstfd = -1; /* destination file descriptor */
static const char *dstname;
static const char *srcname;
static int source_open_flag = O_RDONLY; /* open flags on source file */
static const char *dstname;
static const char *srcname;
static int source_open_flag = O_RDONLY; /* open flags on source file */
static int zero; /* write zero's only */
static int debug;
static int zero; /* write zero's only */
static int debug;
-static int count_io_q_waits; /* how many time io_queue_wait called */
+static int count_io_q_waits; /* how many times io_queue_wait called */
struct iocb **iocb_free; /* array of pointers to iocb */
int iocb_free_count; /* current free count */
int alignment = 512; /* buffer alignment */
struct iocb **iocb_free; /* array of pointers to iocb */
int iocb_free_count; /* current free count */
int alignment = 512; /* buffer alignment */
-struct timeval delay; /* delay between i/o */
+struct timeval delay; /* delay between I/O */
int init_iocb(int n, int iosize)
{
int init_iocb(int n, int iosize)
{
io_error("aio write", res2);
if (res != iocb->u.c.nbytes) {
io_error("aio write", res2);
if (res != iocb->u.c.nbytes) {
- fprintf(stderr, "write missed bytes expect %lu got %ld\n",
+ fprintf(stderr, "write missed bytes expected %lu got %ld\n",
iocb->u.c.nbytes, res2);
exit(1);
}
iocb->u.c.nbytes, res2);
exit(1);
}
if (res2 != 0)
io_error("aio read", res2);
if (res != iosize) {
if (res2 != 0)
io_error("aio read", res2);
if (res != iosize) {
- fprintf(stderr, "read missing bytes expect %lu got %ld\n",
+ fprintf(stderr, "read missed bytes expected %lu got %ld\n",
iocb->u.c.nbytes, res);
exit(1);
}
iocb->u.c.nbytes, res);
exit(1);
}
case 'g':
case 'G':
value *= 1024;
case 'g':
case 'G':
value *= 1024;
case 'm':
case 'M':
value *= 1024;
case 'm':
case 'M':
value *= 1024;
case 'k':
case 'K':
value *= 1024;
case 'k':
case 'K':
value *= 1024;
io_queue_init(aio_maxio, &myctx);
tocopy = howmany(length, aio_blksize);
if (init_iocb(aio_maxio, aio_blksize) < 0) {
io_queue_init(aio_maxio, &myctx);
tocopy = howmany(length, aio_blksize);
if (init_iocb(aio_maxio, aio_blksize) < 0) {
- fprintf(stderr, "Error allocating the i/o buffers\n");
+ fprintf(stderr, "Error allocating the I/O buffers\n");
- * We have submitted all the i/o requests.
+ * We have submitted all the I/O requests.
* Wait for at least one to complete and call the callbacks.
*/
count_io_q_waits++;
* Wait for at least one to complete and call the callbacks.
*/
count_io_q_waits++;