Author: kib
Date: Wed Jan  5 12:47:42 2011
New Revision: 217003
URL: http://svn.freebsd.org/changeset/base/217003

Log:
  MFC r216794:
  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.

Modified:
  stable/8/sys/dev/md/md.c
  stable/8/sys/geom/geom_disk.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/md/md.c
==============================================================================
--- stable/8/sys/dev/md/md.c    Wed Jan  5 12:45:11 2011        (r217002)
+++ stable/8/sys/dev/md/md.c    Wed Jan  5 12:47:42 2011        (r217003)
@@ -716,11 +716,12 @@ md_kthread(void *arg)
                }
                mtx_unlock(&sc->queue_mtx);
                if (bp->bio_cmd == BIO_GETATTR) {
-                       if (sc->fwsectors && sc->fwheads &&
+                       if ((sc->fwsectors && sc->fwheads &&
                            (g_handleattr_int(bp, "GEOM::fwsectors",
                            sc->fwsectors) ||
                            g_handleattr_int(bp, "GEOM::fwheads",
-                           sc->fwheads)))
+                           sc->fwheads))) ||
+                           g_handleattr_int(bp, "GEOM::candelete", 1))
                                error = -1;
                        else
                                error = EOPNOTSUPP;

Modified: stable/8/sys/geom/geom_disk.c
==============================================================================
--- stable/8/sys/geom/geom_disk.c       Wed Jan  5 12:45:11 2011        
(r217002)
+++ stable/8/sys/geom/geom_disk.c       Wed Jan  5 12:47:42 2011        
(r217003)
@@ -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;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to