[PATCH] drivescan: allow override of saved state disk util
authorJens Axboe <axboe@suse.de>
Tue, 18 Oct 2005 12:23:38 +0000 (14:23 +0200)
committerJens Axboe <axboe@suse.de>
Tue, 18 Oct 2005 12:23:38 +0000 (14:23 +0200)
drivescan.c

index b75608fd198be7fe7ce8e2cbb1b9b4725e0ffbfd..2b55da725221910d8953fa68d6fa155e4824011f 100644 (file)
@@ -105,6 +105,7 @@ static int restore_state = 1;
 static struct timeval start;
 static int sequential;
 static int disk_util = 100;
+static int disk_util_set;
 static int state_file_fd = -1;
 static int state_restored;
 
@@ -232,7 +233,8 @@ int load_progress_state(void)
 
        dev_size = state.blocks;
        block_size = state.bs;
-       disk_util = state.disk_util;
+       if (!disk_util_set)
+               disk_util = state.disk_util;
        printf("Restored state: %lu blocks\n", blocks_read);
        state_restored = 1;
        return 0;
@@ -582,6 +584,7 @@ int get_options(int argc, char *argv[])
                                        disk_util = 1;
                                if (disk_util > 100)
                                        disk_util = 100;
+                               disk_util_set = 1;
                                break;
                }
        }