Bug 26822 — Fix benchmarking for large files
authorDaniele Napolitano <dnax88@gmail.com>
Tue, 2 Mar 2010 07:18:47 +0000 (08:18 +0100)
committerMartin Pitt <martin.pitt@ubuntu.com>
Tue, 2 Mar 2010 07:18:47 +0000 (08:18 +0100)
Use lseek64() instead of lseek() in job-drive-benchmark.c (as in the rest of
the code), to also work with large devices.

Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
src/helpers/job-drive-benchmark.c

index 766f300..8672968 100644 (file)
@@ -172,7 +172,7 @@ measure_transfer_rate (guint num_samples,
       /* O_DIRECT also only wants to read from page offsets */
       pos &= ~(page_size - 1);
 
-      if (lseek (fd, pos, SEEK_SET) == -1)
+      if (lseek64 (fd, pos, SEEK_SET) == -1)
         {
           g_printerr ("Error seeking to position %" G_GSSIZE_FORMAT " for %s: %m\n",
                       pos,
@@ -257,7 +257,7 @@ measure_write_transfer_rate (guint num_samples,
       /* O_DIRECT also only wants to read from page offsets */
       pos &= ~(page_size - 1);
 
-      if (lseek (fd, pos, SEEK_SET) == -1)
+      if (lseek64 (fd, pos, SEEK_SET) == -1)
         {
           g_printerr ("Error seeking to position %" G_GSSIZE_FORMAT " for %s: %m\n",
                       pos,
@@ -347,7 +347,7 @@ measure_access_time (guint num_samples,
       pos &= ~(page_size - 1);
 
       g_get_current_time (&begin_time);
-      if (lseek (fd, pos, SEEK_SET) == -1)
+      if (lseek64 (fd, pos, SEEK_SET) == -1)
         {
           g_printerr ("Error seeking to position %" G_GSSIZE_FORMAT " for %s: %m\n",
                       pos,