[DRBD-cvs] svn commit by phil - r2520 - in trunk: scripts user - Changed the minor-count code to match the world of drbd

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Mon Oct 9 17:02:50 CEST 2006


Author: phil
Date: 2006-10-09 17:02:49 +0200 (Mon, 09 Oct 2006)
New Revision: 2520

Modified:
   trunk/scripts/drbd.conf
   trunk/user/drbdadm_main.c
Log:
Changed the minor-count code to match the world of drbd-8.0


Modified: trunk/scripts/drbd.conf
===================================================================
--- trunk/scripts/drbd.conf	2006-10-06 13:17:50 UTC (rev 2519)
+++ trunk/scripts/drbd.conf	2006-10-09 15:02:49 UTC (rev 2520)
@@ -66,12 +66,15 @@
 # It must precede any resource section.
 #
 global {
-    # use this if you want to define more resources later
-    # without reloading the module.
-    # by default we load the module with exactly as many devices
-    # as configured mentioned in this file.
+    # By default we load the module with a minor-count of 32. In case you
+    # have more devices in your config, the module gets loaded with 
+    # a minor-count that ensures that you have 10 minors spare.
+    # In case 10 spare minors are too little for you, you can set the
+    # minor-count exeplicit here. ( Note, in contrast to DRBD-0.7 an
+    # unused, spare minor has only a very little overhead of allocated
+    # memory (a single pointer to be exact). )
     #
-    # minor-count 5;
+    # minor-count 64;
 
     # The user dialog counts and displays the seconds it waited so
     # far. You might want to disable this if you have the console 

Modified: trunk/user/drbdadm_main.c
===================================================================
--- trunk/user/drbdadm_main.c	2006-10-06 13:17:50 UTC (rev 2519)
+++ trunk/user/drbdadm_main.c	2006-10-09 15:02:49 UTC (rev 2520)
@@ -406,7 +406,9 @@
   int mc=global_options.minor_count;
 
   if(global_options.disable_io_hints) printf("disable_io_hints=1 ");
-  printf("minor_count=%d\n",mc ?: (highest_minor+1) );
+  if( mc == 0) mc = highest_minor+11;
+  if( mc < 32) mc = 32;
+  printf("minor_count=%d\n",mc);
   return 0;
 }
 



More information about the drbd-cvs mailing list