Module Name:    src
Committed By:   ozaki-r
Date:           Wed Jul  6 05:20:48 UTC 2016

Modified Files:
        src/sys/kern: subr_hash.c
        src/sys/sys: systm.h

Log Message:
Add HASH_PSLIST (pslist(9)) type for hashinit()


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/kern/subr_hash.c
cvs rdiff -u -r1.270 -r1.271 src/sys/sys/systm.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/subr_hash.c
diff -u src/sys/kern/subr_hash.c:1.6 src/sys/kern/subr_hash.c:1.7
--- src/sys/kern/subr_hash.c:1.6	Thu May 29 21:15:55 2014
+++ src/sys/kern/subr_hash.c	Wed Jul  6 05:20:48 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_hash.c,v 1.6 2014/05/29 21:15:55 rmind Exp $	*/
+/*	$NetBSD: subr_hash.c,v 1.7 2016/07/06 05:20:48 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1991, 1993
@@ -37,12 +37,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_hash.c,v 1.6 2014/05/29 21:15:55 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_hash.c,v 1.7 2016/07/06 05:20:48 ozaki-r Exp $");
 
 #include <sys/param.h>
 #include <sys/bitops.h>
 #include <sys/kmem.h>
 #include <sys/systm.h>
+#include <sys/pslist.h>
 
 static size_t
 hash_list_size(enum hashtype htype)
@@ -50,12 +51,16 @@ hash_list_size(enum hashtype htype)
 	LIST_HEAD(, generic) *hashtbl_list;
 	SLIST_HEAD(, generic) *hashtbl_slist;
 	TAILQ_HEAD(, generic) *hashtbl_tailq;
+	struct pslist_head *hashtbl_pslist;
 	size_t esize;
 
 	switch (htype) {
 	case HASH_LIST:
 		esize = sizeof(*hashtbl_list);
 		break;
+	case HASH_PSLIST:
+		esize = sizeof(*hashtbl_pslist);
+		break;
 	case HASH_SLIST:
 		esize = sizeof(*hashtbl_slist);
 		break;
@@ -80,6 +85,7 @@ hashinit(u_int elements, enum hashtype h
 	LIST_HEAD(, generic) *hashtbl_list;
 	SLIST_HEAD(, generic) *hashtbl_slist;
 	TAILQ_HEAD(, generic) *hashtbl_tailq;
+	struct pslist_head *hashtbl_pslist;
 	u_long hashsize, i;
 	size_t esize;
 	void *p;
@@ -103,6 +109,11 @@ hashinit(u_int elements, enum hashtype h
 		for (i = 0; i < hashsize; i++)
 			LIST_INIT(&hashtbl_list[i]);
 		break;
+	case HASH_PSLIST:
+		hashtbl_pslist = p;
+		for (i = 0; i < hashsize; i++)
+			PSLIST_INIT(&hashtbl_pslist[i]);
+		break;
 	case HASH_SLIST:
 		hashtbl_slist = p;
 		for (i = 0; i < hashsize; i++)

Index: src/sys/sys/systm.h
diff -u src/sys/sys/systm.h:1.270 src/sys/sys/systm.h:1.271
--- src/sys/sys/systm.h:1.270	Sat Jan 23 20:44:06 2016
+++ src/sys/sys/systm.h	Wed Jul  6 05:20:48 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: systm.h,v 1.270 2016/01/23 20:44:06 christos Exp $	*/
+/*	$NetBSD: systm.h,v 1.271 2016/07/06 05:20:48 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1988, 1991, 1993
@@ -177,7 +177,8 @@ int	eopnotsupp(void);
 enum hashtype {
 	HASH_LIST,
 	HASH_SLIST,
-	HASH_TAILQ
+	HASH_TAILQ,
+	HASH_PSLIST
 };
 
 #ifdef _KERNEL

Reply via email to