From 0ac99ad7100334933a993413333521087e29297b Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 21 Sep 2024 08:57:08 +0200 Subject: Update documentation and adjust blocksize if larger than the device size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- deadshred.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'deadshred.c') diff --git a/deadshred.c b/deadshred.c index c471982..d7f2f5f 100644 --- a/deadshred.c +++ b/deadshred.c @@ -4,7 +4,6 @@ USAGE("[-b blocksize] [-o offset] [-l length | -e postend] [-r] device [< random-source]"); -/* TODO document (also in README and man pages) options -b and -r */ struct status status = STATUS_INIT; @@ -417,6 +416,8 @@ main(int argc, char *argv[]) close(fd); return 0; } + while ((off_t)spans[0].blocksize >> 1 > total_size) + spans[0].blocksize >>= 1; humansize1000(total_size, total_size_1000); humansize1024(total_size, total_size_1024); @@ -473,7 +474,6 @@ main(int argc, char *argv[]) print_status(1, &status); if (nspans) { - /* TODO document in man page */ dump_map(STDOUT_FILENO, ""); if (close(STDOUT_FILENO)) eprintf("write "); -- cgit v1.2.3-70-g09d2