diff options
author | Arnd Bergmann <arnd@arndb.de> | 2011-03-29 15:59:52 +0200 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-03-29 15:59:52 +0200 |
commit | 4fb06b5dc1d258cce04f501e99d71d1063f0152e (patch) | |
tree | cfe5d3dca046085bcfdfb01acbe7eb17834463b9 | |
parent | c32531a81a6206588ebb6b2413675c715dccb76e (diff) |
flashbench: start at multiple of erasesize for --open-au
Apparently, 1.5 MB erase blocks or multiples of that are more
common than I first thought, so automatically try to handle these
by starting at a multiple of the erase blcok.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r-- | flashbench.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/flashbench.c b/flashbench.c index aaf4c5d..0a1016f 100644 --- a/flashbench.c +++ b/flashbench.c @@ -514,9 +514,9 @@ static int try_open_au(struct device *dev, unsigned int erasesize, unsigned long long offset, bool random) { - /* start 16 MB into the device, to skip FAT */ + /* start 16 MB into the device, to skip FAT, round up to full erase blocks */ if (offset == -1ull) - offset = 1024 * 1024 * 16; + offset = (1024 * 1024 * 16 + erasesize - 1) / erasesize * erasesize; /* find maximum number of open AUs */ struct operation program[] = { |