From 204e766e8c1366763cd863b125c572e0a185fa19 Mon Sep 17 00:00:00 2001 From: delphij Date: Mon, 4 Feb 2013 19:17:15 +0000 Subject: Use stripesize as smallest block size if it's available. MFC after: 2 weeks --- sbin/recoverdisk/recoverdisk.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sbin/recoverdisk') diff --git a/sbin/recoverdisk/recoverdisk.c b/sbin/recoverdisk/recoverdisk.c index 3a92d1d..caa8ebd 100644 --- a/sbin/recoverdisk/recoverdisk.c +++ b/sbin/recoverdisk/recoverdisk.c @@ -156,6 +156,7 @@ main(int argc, char * const argv[]) int error, state; u_char *buf; u_int sectorsize; + u_int stripesize; time_t t1, t2; struct stat sb; u_int n, snapshot = 60; @@ -201,6 +202,10 @@ main(int argc, char * const argv[]) if (error < 0) err(1, "DIOCGSECTORSIZE failed"); + error = ioctl(fdr, DIOCGSTRIPESIZE, &stripesize); + if (error == 0 && stripesize > sectorsize) + sectorsize = stripesize; + minsize = sectorsize; bigsize = (bigsize / sectorsize) * sectorsize; -- cgit v1.1