Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-582 test: fix bug in get_ost_param in sanity.sh
[fs/lustre-release.git]
/
lustre
/
tests
/
mpi
/
cascading_rw.c
diff --git
a/lustre/tests/mpi/cascading_rw.c
b/lustre/tests/mpi/cascading_rw.c
index
f23d0a8
..
1d73fad
100644
(file)
--- a/
lustre/tests/mpi/cascading_rw.c
+++ b/
lustre/tests/mpi/cascading_rw.c
@@
-1,6
+1,4
@@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@
-26,7
+24,7
@@
* GPL HEADER END
*/
/*
* GPL HEADER END
*/
/*
- * Copyright
2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright
(c) 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
/*
* Use is subject to license terms.
*/
/*
@@
-44,18
+42,20
@@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
+#include <asm/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <getopt.h>
#include <errno.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <getopt.h>
#include <errno.h>
+
+#include <lustre/lustreapi.h>
#include "lp_utils.h"
#ifndef _IOWR
# include <ioctl.h>
#endif
#include "lp_utils.h"
#ifndef _IOWR
# include <ioctl.h>
#endif
-#include <lustre/liblustreapi.h>
int rank = 0;
int size = 0;
int rank = 0;
int size = 0;
@@
-65,13
+65,12
@@
char *testdir = NULL;
void rw_file(char *name, long stride, unsigned int seed)
{
char filename[MAX_FILENAME_LEN];
void rw_file(char *name, long stride, unsigned int seed)
{
char filename[MAX_FILENAME_LEN];
- char path[MAX_FILENAME_LEN];
char errmsg[MAX_FILENAME_LEN+20];
char *buf, *o_buf;
struct lov_user_md lum = {0};
int fd, rc, i, bad = 0, root = 0;
long off;
char errmsg[MAX_FILENAME_LEN+20];
char *buf, *o_buf;
struct lov_user_md lum = {0};
int fd, rc, i, bad = 0, root = 0;
long off;
- long
PAGE_SIZE
= sysconf(_SC_PAGESIZE);
+ long
page_size
= sysconf(_SC_PAGESIZE);
sprintf(filename, "%s/%s", testdir, name);
sprintf(filename, "%s/%s", testdir, name);
@@
-100,13
+99,6
@@
void rw_file(char *name, long stride, unsigned int seed)
sprintf(errmsg, "close of file %s", filename);
FAIL(errmsg);
}
sprintf(errmsg, "close of file %s", filename);
FAIL(errmsg);
}
-
- strncpy(path, filename, MAX_FILENAME_LEN);
- rc = llapi_file_get_stripe(path, &lum);
- if (rc == -1) {
- sprintf(errmsg, "get stripe of file %s", filename);
- FAIL(errmsg);
- }
}
MPI_Barrier(MPI_COMM_WORLD);
}
MPI_Barrier(MPI_COMM_WORLD);
@@
-114,7
+106,7
@@
void rw_file(char *name, long stride, unsigned int seed)
if (stride < 0) {
if (rank == 0) {
srandom(seed);
if (stride < 0) {
if (rank == 0) {
srandom(seed);
- while (stride <
PAGE_SIZE
/2) {
+ while (stride <
page_size
/2) {
stride = random();
stride -= stride % 16;
if (stride < 0)
stride = random();
stride -= stride % 16;
if (stride < 0)
@@
-317,8
+309,7
@@
void usage(char *proc)
int main(int argc, char *argv[])
{
int main(int argc, char *argv[])
{
- int i, iterations = 16;
- char c;
+ int i, iterations = 16, c;
long stride = -1;
unsigned int seed = 0;
long stride = -1;
unsigned int seed = 0;