From: Matt Mackall <mpm@selenic.com>
To: Andrew Morton <akpm@osdl.org>, "Theodore Ts'o" <tytso@mit.edu>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 3/12] random pt3: Static sysctl bits
Date: Wed, 19 Jan 2005 00:17:20 -0800 [thread overview]
Message-ID: <4.64403262@selenic.com> (raw)
In-Reply-To: <3.64403262@selenic.com>
Static initialization for sysctl support
Signed-off-by: Matt Mackall <mpm@selenic.com>
Index: rnd/drivers/char/random.c
===================================================================
--- rnd.orig/drivers/char/random.c 2005-01-18 10:36:10.542146558 -0800
+++ rnd/drivers/char/random.c 2005-01-18 10:37:42.989360541 -0800
@@ -380,14 +380,6 @@
static DECLARE_WAIT_QUEUE_HEAD(random_read_wait);
static DECLARE_WAIT_QUEUE_HEAD(random_write_wait);
-/*
- * Forward procedure declarations
- */
-#ifdef CONFIG_SYSCTL
-struct entropy_store;
-static void sysctl_init_random(struct entropy_store *pool);
-#endif
-
static inline __u32 rol32(__u32 word, int shift)
{
return (word << shift) | (word >> (32 - shift));
@@ -1386,16 +1378,12 @@
static int __init rand_initialize(void)
{
if (batch_entropy_init(BATCH_ENTROPY_SIZE, &input_pool))
- goto err;
+ return -1;
+
init_std_data(&input_pool);
init_std_data(&blocking_pool);
init_std_data(&nonblocking_pool);
-#ifdef CONFIG_SYSCTL
- sysctl_init_random(&input_pool);
-#endif
return 0;
-err:
- return -1;
}
module_init(rand_initialize);
@@ -1665,8 +1653,9 @@
#include <linux/sysctl.h>
-static int min_read_thresh, max_read_thresh;
-static int min_write_thresh, max_write_thresh;
+static int min_read_thresh = 8, min_write_thresh;
+static int max_read_thresh = INPUT_POOL_WORDS * 32;
+static int max_write_thresh = INPUT_POOL_WORDS * 32;
static char sysctl_bootid[16];
/*
@@ -1750,6 +1739,7 @@
.maxlen = sizeof(int),
.mode = 0444,
.proc_handler = &proc_dointvec,
+ .data = &input_pool.entropy_count,
},
{
.ctl_name = RANDOM_READ_THRESH,
@@ -1792,14 +1782,6 @@
},
{ .ctl_name = 0 }
};
-
-static void sysctl_init_random(struct entropy_store *pool)
-{
- min_read_thresh = 8;
- min_write_thresh = 0;
- max_read_thresh = max_write_thresh = pool->poolinfo->POOLBITS;
- random_table[1].data = &pool->entropy_count;
-}
#endif /* CONFIG_SYSCTL */
/********************************************************************
next prev parent reply other threads:[~2005-01-19 8:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-19 8:17 [PATCH 0/12] random pt3: More core and accounting cleanups Matt Mackall
2005-01-19 8:17 ` [PATCH 1/12] random pt3: More meaningful pool names Matt Mackall
2005-01-19 8:17 ` [PATCH 2/12] random pt3: Static allocation of pools Matt Mackall
2005-01-19 8:17 ` Matt Mackall [this message]
2005-01-19 8:17 ` [PATCH 4/12] random pt3: Catastrophic reseed checks Matt Mackall
2005-01-19 8:17 ` [PATCH 5/12] random pt3: Entropy reservation accounting Matt Mackall
2005-01-19 8:17 ` [PATCH 6/12] random pt3: Reservation flag in pool struct Matt Mackall
2005-01-19 8:17 ` [PATCH 7/12] random pt3: Reseed pointer " Matt Mackall
2005-01-19 8:17 ` [PATCH 8/12] random pt3: Break up extract_user Matt Mackall
2005-01-19 8:17 ` [PATCH 9/12] random pt3: Remove dead MD5 copy Matt Mackall
2005-01-19 8:17 ` [PATCH 10/12] random pt3: Simplify hash folding Matt Mackall
2005-01-19 8:17 ` [PATCH 11/12] random pt3: Clean up hash buffering Matt Mackall
2005-01-19 8:17 ` [PATCH 12/12] random pt3: Remove entropy batching Matt Mackall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4.64403262@selenic.com \
--to=mpm@selenic.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox