X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fmpi%2Fcascading_rw.c;h=24927289086fdc818070849f9e4036d30d9b37b9;hb=b71766311daa0faf3560a2435778f7b2de1e3ad6;hp=f23d0a8605a872c2473c9c02ada30b5789221079;hpb=f91373a85ceb65cb1ea8558b1da242a1770fc2a3;p=fs%2Flustre-release.git diff --git a/lustre/tests/mpi/cascading_rw.c b/lustre/tests/mpi/cascading_rw.c index f23d0a8..2492728 100644 --- 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. @@ -17,16 +15,12 @@ * * You should have received a copy of the GNU General Public License * version 2 along with this program; If not, see - * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. + * http://www.gnu.org/licenses/gpl-2.0.html * * 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. */ /* @@ -44,18 +38,20 @@ #include #include #include +#include #include #include #include #include #include #include + +#include #include "lp_utils.h" #ifndef _IOWR # include #endif -#include int rank = 0; int size = 0; @@ -65,13 +61,12 @@ char *testdir = NULL; 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; - long PAGE_SIZE = sysconf(_SC_PAGESIZE); + long page_size = sysconf(_SC_PAGESIZE); sprintf(filename, "%s/%s", testdir, name); @@ -100,13 +95,6 @@ void rw_file(char *name, long stride, unsigned int seed) 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); @@ -114,7 +102,7 @@ void rw_file(char *name, long stride, unsigned int 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) @@ -317,8 +305,7 @@ void usage(char *proc) int main(int argc, char *argv[]) { - int i, iterations = 16; - char c; + int i, iterations = 16, c; long stride = -1; unsigned int seed = 0;