Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 May 2014 23:23:18 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r265248 - in head: sbin/gvinum sys/conf
Message-ID:  <201405022323.s42NNIpT012682@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Fri May  2 23:23:18 2014
New Revision: 265248
URL: http://svnweb.freebsd.org/changeset/base/265248

Log:
  Allow GEOM_VINUM to be statically compiled into the kernel.
  
  Submitted by:	gleb
  MFC after:	3 days

Modified:
  head/sbin/gvinum/gvinum.c
  head/sbin/gvinum/gvinum.h
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/conf/options

Modified: head/sbin/gvinum/gvinum.c
==============================================================================
--- head/sbin/gvinum/gvinum.c	Fri May  2 21:55:09 2014	(r265247)
+++ head/sbin/gvinum/gvinum.c	Fri May  2 23:23:18 2014	(r265248)
@@ -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;
 	}
 

Modified: head/sbin/gvinum/gvinum.h
==============================================================================
--- head/sbin/gvinum/gvinum.h	Fri May  2 21:55:09 2014	(r265247)
+++ head/sbin/gvinum/gvinum.h	Fri May  2 23:23:18 2014	(r265248)
@@ -36,4 +36,5 @@
 
 /* $FreeBSD$ */
 
-#define GVINUMMOD	"geom_vinum"
+#define	GVINUMMOD	"g_vinum"
+#define	GVINUMKLD	"geom_vinum"

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES	Fri May  2 21:55:09 2014	(r265247)
+++ head/sys/conf/NOTES	Fri May  2 23:23:18 2014	(r265248)
@@ -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.

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Fri May  2 21:55:09 2014	(r265247)
+++ head/sys/conf/files	Fri May  2 23:23:18 2014	(r265248)
@@ -2770,6 +2770,21 @@ contrib/xz-embedded/linux/lib/xz/xz_dec_
 	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

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options	Fri May  2 21:55:09 2014	(r265247)
+++ head/sys/conf/options	Fri May  2 23:23:18 2014	(r265248)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201405022323.s42NNIpT012682>