svn commit: r253030 - user/pho/stress2/testcases/link

Peter Holm pho at FreeBSD.org
Mon Jul 8 11:30:00 UTC 2013


Author: pho
Date: Mon Jul  8 11:29:59 2013
New Revision: 253030
URL: http://svnweb.freebsd.org/changeset/base/253030

Log:
  Change max number of files per dir from 20.000 to 32.000.
  Fine tune the resource reservation.
  
  Sponsored by:	 EMC / Isilon storage division

Modified:
  user/pho/stress2/testcases/link/link.c

Modified: user/pho/stress2/testcases/link/link.c
==============================================================================
--- user/pho/stress2/testcases/link/link.c	Mon Jul  8 11:18:47 2013	(r253029)
+++ user/pho/stress2/testcases/link/link.c	Mon Jul  8 11:29:59 2013	(r253030)
@@ -64,18 +64,15 @@ setup(int nb)
 			pct = random_int(1, 90);
 		size = size / 100 * pct + 1;
 
-		if (size > 20000 && op->hog == 0)
-			size = 20000;	/* arbitrary limit number of files pr. dir */
+		if (size > 32000 && op->hog == 0)
+			size = 32000;	/* arbitrary limit number of files pr. dir */
 		if (size > LINK_MAX)
 			size = LINK_MAX;
 
-
 		/* Resource requirements: */
-		reserve_in =  2 * op->incarnations + 1;
+		reserve_in =  2 * op->incarnations + 7;
 		reserve_bl = 26 * size * op->incarnations;
-		if (reserve_bl > bl)
-			size = bl / 26 * op->incarnations;
-		if (reserve_in > in)
+		if (reserve_in > in || reserve_bl > bl)
 			size = reserve_in = reserve_bl = 0;
 
 		if (op->verbose > 1)
@@ -102,6 +99,8 @@ setup(int nb)
 void
 cleanup(void)
 {
+	if (size == 0)
+		return;
 	(void)chdir("..");
 	if (path[0] != 0 && rmdir(path) == -1)
 		warn("rmdir(%s), %s:%d", path, __FILE__, __LINE__);
@@ -116,7 +115,7 @@ test(void)
 	char lfile[128];
 
 	pid = getpid();
-	for (j = 0; j < size && done_testing == 0; j++) {
+	for (j = 0; j < (int)size && done_testing == 0; j++) {
 		sprintf(file,"p%05d.%05d", pid, j);
 		if (j == 0) {
 			if ((fd = creat(file, 0660)) == -1) {


More information about the svn-src-user mailing list