diff options
author | pjd <pjd@FreeBSD.org> | 2011-10-25 14:07:17 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2011-10-25 14:07:17 +0000 |
commit | 2f532a77b77cfd82219275864929f27b49ad0daa (patch) | |
tree | 8709b3056c011061074c140710f757428e8c45f0 /sys/geom/geom_disk.c | |
parent | 2536f7a375dd6bc0539adab2cd5f12d413a0c241 (diff) | |
download | FreeBSD-src-2f532a77b77cfd82219275864929f27b49ad0daa.zip FreeBSD-src-2f532a77b77cfd82219275864929f27b49ad0daa.tar.gz |
Allow upper layers to discover than BIO_DELETE and/or BIO_FLUSH is not
supported by returning EOPNOTSUPP instead of 0 or ENODEV.
MFC after: 3 days
Diffstat (limited to 'sys/geom/geom_disk.c')
-rw-r--r-- | sys/geom/geom_disk.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c index fd5955d..6b6c5ae 100644 --- a/sys/geom/geom_disk.c +++ b/sys/geom/geom_disk.c @@ -305,7 +305,7 @@ g_disk_start(struct bio *bp) switch(bp->bio_cmd) { case BIO_DELETE: if (!(dp->d_flags & DISKFLAG_CANDELETE)) { - error = 0; + error = EOPNOTSUPP; break; } /* fall-through */ @@ -394,8 +394,8 @@ g_disk_start(struct bio *bp) g_trace(G_T_TOPOLOGY, "g_disk_flushcache(%s)", bp->bio_to->name); if (!(dp->d_flags & DISKFLAG_CANFLUSHCACHE)) { - g_io_deliver(bp, ENODEV); - return; + error = EOPNOTSUPP; + break; } bp2 = g_clone_bio(bp); if (bp2 == NULL) { |