summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2013-02-04 19:17:15 +0000
committerdelphij <delphij@FreeBSD.org>2013-02-04 19:17:15 +0000
commit204e766e8c1366763cd863b125c572e0a185fa19 (patch)
tree3b37be8e56dc88b72cda4f72c91179772a4cb838 /sbin
parent4276b11f079dc95b96111a7a20af3feeb9716e62 (diff)
downloadFreeBSD-src-204e766e8c1366763cd863b125c572e0a185fa19.zip
FreeBSD-src-204e766e8c1366763cd863b125c572e0a185fa19.tar.gz
Use stripesize as smallest block size if it's available.
MFC after: 2 weeks
Diffstat (limited to 'sbin')
-rw-r--r--sbin/recoverdisk/recoverdisk.c5
1 files changed, 5 insertions, 0 deletions
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;
OpenPOWER on IntegriCloud