FreeBSD Bugzilla – Attachment 142724 Details for
Bug 189788
add kern.geom.disk.%s.activity_led to attach a LED to display disk activity
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.48 KB, created by
Keith White
on 2014-05-14 01:00:00 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Keith White
Created:
2014-05-14 01:00:00 UTC
Size:
2.48 KB
patch
obsolete
>Index: sys/conf/options >=================================================================== >--- sys/conf/options (revision 265947) >+++ sys/conf/options (working copy) >@@ -97,6 +97,7 @@ > GEOM_BSD opt_geom.h > GEOM_CACHE opt_geom.h > GEOM_CONCAT opt_geom.h >+GEOM_DISK_ACTIVITY_LED opt_geom.h > GEOM_ELI opt_geom.h > GEOM_FOX opt_geom.h > GEOM_GATE opt_geom.h >Index: sys/geom/geom_disk.c >=================================================================== >--- sys/geom/geom_disk.c (revision 265947) >+++ sys/geom/geom_disk.c (working copy) >@@ -57,6 +57,21 @@ > #include <geom/geom_int.h> > > #include <dev/led/led.h> >+#ifdef GEOM_DISK_ACTIVITY_LED >+#define ACTIVITY_LED_SET(set, negset) do { \ >+ if (sc->activity_led[0] != 0) { \ >+ if (sc->activity_led[0] != '!') \ >+ led_set(sc->activity_led, (set)); \ >+ else \ >+ led_set(sc->activity_led+1, (negset)); \ >+ } \ >+} while (0) >+#define ACTIVITY_LED_ON ACTIVITY_LED_SET("1", "0") >+#define ACTIVITY_LED_OFF ACTIVITY_LED_SET("0", "1") >+#else >+#define ACTIVITY_LED_ON >+#define ACTIVITY_LED_OFF >+#endif > > struct g_disk_softc { > struct mtx done_mtx; >@@ -66,6 +81,9 @@ > char led[64]; > uint32_t state; > struct mtx start_mtx; >+#ifdef GEOM_DISK_ACTIVITY_LED >+ char activity_led[64]; >+#endif > }; > > static g_access_t g_disk_access; >@@ -233,6 +251,7 @@ > } else > mtx_unlock(&sc->done_mtx); > g_destroy_bio(bp); >+ ACTIVITY_LED_OFF; > } > > static void >@@ -250,6 +269,7 @@ > mtx_lock(&sc->done_mtx); > devstat_end_transaction_bio_bt(sc->dp->d_devstat, bp, &now); > mtx_unlock(&sc->done_mtx); >+ ACTIVITY_LED_OFF; > } > g_io_deliver(bp, bp->bio_error); > } >@@ -306,6 +326,7 @@ > devstat_start_transaction_bio(dp->d_devstat, bp); > mtx_unlock(&sc->start_mtx); > dp->d_strategy(bp); >+ ACTIVITY_LED_ON; > break; > } > off = 0; >@@ -315,6 +336,7 @@ > error = ENOMEM; > break; > } >+ ACTIVITY_LED_ON; > do { > bp2->bio_offset += off; > bp2->bio_length -= off; >@@ -565,6 +587,15 @@ > SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, "led", > CTLFLAG_RW | CTLFLAG_TUN, sc->led, sizeof(sc->led), > "LED name"); >+#ifdef GEOM_DISK_ACTIVITY_LED >+ snprintf(tmpstr, sizeof(tmpstr), >+ "kern.geom.disk.%s.activity_led", gp->name); >+ TUNABLE_STR_FETCH(tmpstr, sc->activity_led, sizeof(sc->activity_led)); >+ SYSCTL_ADD_STRING(&sc->sysctl_ctx, >+ SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO, "activity_led", >+ CTLFLAG_RW | CTLFLAG_TUN, sc->activity_led, sizeof(sc->activity_led), >+ "(!)Activity LED name"); >+#endif > } > pp->private = sc; > dp->d_geom = gp;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 189788
: 142724