Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netsmb Convert POOL_INITs to proper cons/destructors.
details: https://anonhg.NetBSD.org/src/rev/d4312c565c58
branches: trunk
changeset: 747365:d4312c565c58
user: pooka <pooka%NetBSD.org@localhost>
date: Sat Sep 12 12:52:21 2009 +0000
description:
Convert POOL_INITs to proper cons/destructors.
diffstat:
sys/netsmb/smb_dev.c | 6 ++++--
sys/netsmb/smb_rq.c | 37 +++++++++++++++++++------------------
sys/netsmb/smb_rq.h | 5 ++++-
3 files changed, 27 insertions(+), 21 deletions(-)
diffs (120 lines):
diff -r 396869ce1c92 -r d4312c565c58 sys/netsmb/smb_dev.c
--- a/sys/netsmb/smb_dev.c Sat Sep 12 11:35:46 2009 +0000
+++ b/sys/netsmb/smb_dev.c Sat Sep 12 12:52:21 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: smb_dev.c,v 1.31 2009/09/01 12:23:36 pooka Exp $ */
+/* $NetBSD: smb_dev.c,v 1.32 2009/09/12 12:52:21 pooka Exp $ */
/*
* Copyright (c) 2000-2001 Boris Popov
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smb_dev.c,v 1.31 2009/09/01 12:23:36 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smb_dev.c,v 1.32 2009/09/12 12:52:21 pooka Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -176,6 +176,7 @@
smb_sm_done();
return;
}
+ smb_rqpool_init();
}
#endif /* __NetBSD__ */
@@ -256,6 +257,7 @@
#ifndef __NetBSD__
destroy_dev(dev);
#endif
+ smb_rqpool_fini();
splx(s);
return 0;
}
diff -r 396869ce1c92 -r d4312c565c58 sys/netsmb/smb_rq.c
--- a/sys/netsmb/smb_rq.c Sat Sep 12 11:35:46 2009 +0000
+++ b/sys/netsmb/smb_rq.c Sat Sep 12 12:52:21 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: smb_rq.c,v 1.32 2009/07/06 11:46:49 njoly Exp $ */
+/* $NetBSD: smb_rq.c,v 1.33 2009/09/12 12:52:21 pooka Exp $ */
/*
* Copyright (c) 2000-2001, Boris Popov
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smb_rq.c,v 1.32 2009/07/06 11:46:49 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smb_rq.c,v 1.33 2009/09/12 12:52:21 pooka Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -57,13 +57,6 @@
MODULE_DEPEND(netsmb, libmchain, 1, 1, 1);
#endif
-#ifdef __NetBSD__
-POOL_INIT(smbrq_pool, sizeof(struct smb_rq), 0, 0, 0, "smbrqpl",
- &pool_allocator_nointr, IPL_NONE);
-POOL_INIT(smbt2rq_pool, sizeof(struct smb_t2rq), 0, 0, 0, "smbt2pl",
- &pool_allocator_nointr, IPL_NONE);
-#endif
-
static int smb_rq_init(struct smb_rq *, struct smb_connobj *, u_char,
struct smb_cred *);
static int smb_rq_getenv(struct smb_connobj *layer,
@@ -73,17 +66,25 @@
struct smb_cred *);
static int smb_t2_reply(struct smb_t2rq *t2p);
-#ifndef __NetBSD__
-int
-smb_rqinit(void)
+static struct pool smbrq_pool, smbt2rq_pool;
+
+void
+smb_rqpool_init(void)
{
- pool_init(&smbrq_pool, sizeof(struct smb_rq), 0, 0, 0,
- "smbrqpl", &pool_allocator_nointr, IPL_NONE);
- pool_init(&smbt2rq_pool, sizeof(struct smb_t2rq), 0, 0, 0,
- "smbt2pl", &pool_allocator_nointr, IPL_NONE);
- return (0);
+
+ pool_init(&smbrq_pool, sizeof(struct smb_rq), 0, 0, 0, "smbrqpl",
+ &pool_allocator_nointr, IPL_NONE);
+ pool_init(&smbt2rq_pool, sizeof(struct smb_t2rq), 0, 0, 0, "smbt2pl",
+ &pool_allocator_nointr, IPL_NONE);
}
-#endif
+
+void
+smb_rqpool_fini(void)
+{
+
+ pool_destroy(&smbrq_pool);
+ pool_destroy(&smbt2rq_pool);
+}
int
smb_rq_alloc(struct smb_connobj *layer, u_char cmd, struct smb_cred *scred,
diff -r 396869ce1c92 -r d4312c565c58 sys/netsmb/smb_rq.h
--- a/sys/netsmb/smb_rq.h Sat Sep 12 11:35:46 2009 +0000
+++ b/sys/netsmb/smb_rq.h Sat Sep 12 12:52:21 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: smb_rq.h,v 1.12 2005/12/11 00:06:21 elad Exp $ */
+/* $NetBSD: smb_rq.h,v 1.13 2009/09/12 12:52:21 pooka Exp $ */
/*
* Copyright (c) 2000-2001, Boris Popov
@@ -131,6 +131,9 @@
struct smb_vc * t2_vc;
};
+void smb_rqpool_init(void);
+void smb_rqpool_fini(void);
+
int smb_rq_alloc(struct smb_connobj *layer, u_char cmd,
struct smb_cred *scred, struct smb_rq **rqpp);
void smb_rq_done(struct smb_rq *rqp);
Home |
Main Index |
Thread Index |
Old Index