aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Strobl <marius@FreeBSD.org>2014-05-02 23:23:18 +0000
committerMarius Strobl <marius@FreeBSD.org>2014-05-02 23:23:18 +0000
commit02e17f0b93420562b8f192d75ddad3d5d0d4220b (patch)
tree960de5389937d5d67606bbc729de427e3d28c5d3
parentf2b1eaec33f16116533e1fbf0825ba45142ddf5c (diff)
downloadsrc-02e17f0b93420562b8f192d75ddad3d5d0d4220b.tar.gz
src-02e17f0b93420562b8f192d75ddad3d5d0d4220b.zip
Allow GEOM_VINUM to be statically compiled into the kernel.
Submitted by: gleb MFC after: 3 days
Notes
Notes: svn path=/head/; revision=265248
-rw-r--r--sbin/gvinum/gvinum.c15
-rw-r--r--sbin/gvinum/gvinum.h3
-rw-r--r--sys/conf/NOTES1
-rw-r--r--sys/conf/files15
-rw-r--r--sys/conf/options1
5 files changed, 28 insertions, 7 deletions
diff --git a/sbin/gvinum/gvinum.c b/sbin/gvinum/gvinum.c
index 5760d2b8bb28..7033b63bb4af 100644
--- a/sbin/gvinum/gvinum.c
+++ b/sbin/gvinum/gvinum.c
@@ -95,8 +95,10 @@ main(int argc, char **argv)
char buffer[BUFSIZ], *inputline, *token[GV_MAXARGS];
/* Load the module if necessary. */
- if (kldfind(GVINUMMOD) < 0 && kldload(GVINUMMOD) < 0)
- err(1, GVINUMMOD ": Kernel module not available");
+ if (modfind(GVINUMMOD) < 0) {
+ if (kldload(GVINUMKLD) < 0 && modfind(GVINUMMOD) < 0)
+ err(1, GVINUMKLD ": Kernel module not available");
+ }
/* Arguments given on the command line. */
if (argc > 1) {
@@ -1207,9 +1209,10 @@ gvinum_stop(int argc, char **argv)
{
int err, fileid;
- fileid = kldfind(GVINUMMOD);
+ fileid = kldfind(GVINUMKLD);
if (fileid == -1) {
- warn("cannot find " GVINUMMOD);
+ if (modfind(GVINUMMOD) < 0)
+ warn("cannot find " GVINUMKLD);
return;
}
@@ -1219,7 +1222,7 @@ gvinum_stop(int argc, char **argv)
* event thread will be free for the g_wither_geom() call from
* gv_unload(). It's silly, but it works.
*/
- printf("unloading " GVINUMMOD " kernel module... ");
+ printf("unloading " GVINUMKLD " kernel module... ");
fflush(stdout);
if ((err = kldunload(fileid)) != 0 && (errno == EAGAIN)) {
sleep(1);
@@ -1227,7 +1230,7 @@ gvinum_stop(int argc, char **argv)
}
if (err != 0) {
printf(" failed!\n");
- warn("cannot unload " GVINUMMOD);
+ warn("cannot unload " GVINUMKLD);
return;
}
diff --git a/sbin/gvinum/gvinum.h b/sbin/gvinum/gvinum.h
index d1b45a07749b..8b72eea7834f 100644
--- a/sbin/gvinum/gvinum.h
+++ b/sbin/gvinum/gvinum.h
@@ -36,4 +36,5 @@
/* $FreeBSD$ */
-#define GVINUMMOD "geom_vinum"
+#define GVINUMMOD "g_vinum"
+#define GVINUMKLD "geom_vinum"
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index 22a2bb064b01..9d0e51952ad0 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -176,6 +176,7 @@ options GEOM_SHSEC # Shared secret.
options GEOM_STRIPE # Disk striping.
options GEOM_SUNLABEL # Sun/Solaris partitioning
options GEOM_UZIP # Read-only compressed disks
+options GEOM_VINUM # Vinum logical volume manager
options GEOM_VIRSTOR # Virtual storage.
options GEOM_VOL # Volume names from UFS superblock
options GEOM_ZERO # Performance testing helper.
diff --git a/sys/conf/files b/sys/conf/files
index b10d7df6ecd0..804415649e5c 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -2770,6 +2770,21 @@ contrib/xz-embedded/linux/lib/xz/xz_dec_stream.c \
optional xz_embedded | geom_uncompress \
compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/"
geom/uzip/g_uzip.c optional geom_uzip
+geom/vinum/geom_vinum.c optional geom_vinum
+geom/vinum/geom_vinum_create.c optional geom_vinum
+geom/vinum/geom_vinum_drive.c optional geom_vinum
+geom/vinum/geom_vinum_plex.c optional geom_vinum
+geom/vinum/geom_vinum_volume.c optional geom_vinum
+geom/vinum/geom_vinum_subr.c optional geom_vinum
+geom/vinum/geom_vinum_raid5.c optional geom_vinum
+geom/vinum/geom_vinum_share.c optional geom_vinum
+geom/vinum/geom_vinum_list.c optional geom_vinum
+geom/vinum/geom_vinum_rm.c optional geom_vinum
+geom/vinum/geom_vinum_init.c optional geom_vinum
+geom/vinum/geom_vinum_state.c optional geom_vinum
+geom/vinum/geom_vinum_rename.c optional geom_vinum
+geom/vinum/geom_vinum_move.c optional geom_vinum
+geom/vinum/geom_vinum_events.c optional geom_vinum
geom/virstor/binstream.c optional geom_virstor
geom/virstor/g_virstor.c optional geom_virstor
geom/virstor/g_virstor_md.c optional geom_virstor
diff --git a/sys/conf/options b/sys/conf/options
index 99596525cd88..fdc3530ab761 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -125,6 +125,7 @@ GEOM_STRIPE opt_geom.h
GEOM_SUNLABEL opt_geom.h
GEOM_UNCOMPRESS opt_geom.h
GEOM_UZIP opt_geom.h
+GEOM_VINUM opt_geom.h
GEOM_VIRSTOR opt_geom.h
GEOM_VOL opt_geom.h
GEOM_ZERO opt_geom.h