svn commit: r306678 - head/sys/geom
Adrian Chadd
adrian at FreeBSD.org
Tue Oct 4 16:35:39 UTC 2016
Author: adrian
Date: Tue Oct 4 16:35:38 2016
New Revision: 306678
URL: https://svnweb.freebsd.org/changeset/base/306678
Log:
[geom_redboot] Extend geom_redboot to handle non-zero fis offset.
Submitted by: Mori Hiroki <yamori813 at yahoo.co.jp>
Differential Revision: https://reviews.freebsd.org/D7237
Modified:
head/sys/geom/geom_redboot.c
Modified: head/sys/geom/geom_redboot.c
==============================================================================
--- head/sys/geom/geom_redboot.c Tue Oct 4 16:33:03 2016 (r306677)
+++ head/sys/geom/geom_redboot.c Tue Oct 4 16:35:38 2016 (r306678)
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
#include <sys/bio.h>
#include <sys/lock.h>
#include <sys/mutex.h>
+#include <sys/bus.h>
#include <sys/sbuf.h>
#include <geom/geom.h>
@@ -246,6 +247,16 @@ g_redboot_taste(struct g_class *mp, stru
u_int blksize; /* NB: flash block size stored as stripesize */
u_char *buf;
off_t offset;
+ const char *value;
+ char *op;
+
+ offset = 0;
+ if (resource_string_value("redboot", 0, "fisoffset", &value) == 0) {
+ offset = strtouq(value, &op, 0);
+ if (*op != '\0') {
+ offset = 0;
+ }
+ }
g_trace(G_T_TOPOLOGY, "redboot_taste(%s,%s)", mp->name, pp->name);
g_topology_assert();
@@ -278,7 +289,8 @@ g_redboot_taste(struct g_class *mp, stru
return (NULL);
g_topology_unlock();
head = NULL;
- offset = cp->provider->mediasize - blksize;
+ if(offset == 0)
+ offset = cp->provider->mediasize - blksize;
again:
buf = g_read_data(cp, offset, blksize, NULL);
if (buf != NULL)
More information about the svn-src-all
mailing list