Whamcloud - gitweb
LU-1513 libcfs: call cfs_alloc with proper masks
[fs/lustre-release.git] / lustre / tests / writemany.c
index c9db9f9..9e70741 100644 (file)
@@ -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.
@@ -26,7 +24,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  */
 /*
@@ -178,6 +176,7 @@ int run_one_child(char *file, int thread, int seconds)
                 maxrand *= 10;
 
         gettimeofday(&start, NULL);
+        cur = start;
 
         while(!rc) {
                 if (usr1_received)
@@ -233,7 +232,8 @@ int run_one_child(char *file, int thread, int seconds)
                 printf("%s: %7ld files, %4ld MB in %.2fs (%7.2f files/s, "
                        "%5.2f MB/s): rc = %d\n",
                        cmdname, nfiles, nbytes >> 20, diff,
-                       (double)nfiles / diff, (double)nbytes/1024/1024 / diff,
+                       diff == 0 ? (double)0 : (double)nfiles / diff,
+                       diff == 0 ? (double)0 : (double)nbytes/1024/1024 / diff,
                        rc);
 
         return rc;