summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_disk.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2010-12-29 12:11:07 +0000
committerkib <kib@FreeBSD.org>2010-12-29 12:11:07 +0000
commitcbd7f9d93119559fe8dad982bbdf95ca468381da (patch)
tree54df4f93483cbf1cdcaf76e9fcbe38728c166257 /sys/geom/geom_disk.c
parent41c444747f81b148ec5714017fd6303d6163611f (diff)
downloadFreeBSD-src-cbd7f9d93119559fe8dad982bbdf95ca468381da.zip
FreeBSD-src-cbd7f9d93119559fe8dad982bbdf95ca468381da.tar.gz
Add reporting of GEOM::candelete BIO_GETATTR for md(4) and geom_disk(4).
Non-zero value of attribute means that device supports BIO_DELETE. Suggested and reviewed by: pjd Tested by: pho MFC after: 1 week
Diffstat (limited to 'sys/geom/geom_disk.c')
-rw-r--r--sys/geom/geom_disk.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index 25d2e3b..4f918e8 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -297,7 +297,11 @@ g_disk_start(struct bio *bp)
} while (bp2 != NULL);
break;
case BIO_GETATTR:
- if (g_handleattr_int(bp, "GEOM::fwsectors", dp->d_fwsectors))
+ if (g_handleattr_int(bp, "GEOM::candelete",
+ (dp->d_flags & DISKFLAG_CANDELETE) != 0))
+ break;
+ else if (g_handleattr_int(bp, "GEOM::fwsectors",
+ dp->d_fwsectors))
break;
else if (g_handleattr_int(bp, "GEOM::fwheads", dp->d_fwheads))
break;
OpenPOWER on IntegriCloud