aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-12 13:01:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-12 13:01:59 -0400
commit26df0766a73a859bb93dc58e747c5028557a23fd (patch)
tree4776de567425a7fb66ca9a87228309f9c84de633 /net
parent580287628cdd99366b10c9050c4479b387283be8 (diff)
parenta6de51b2787012ba3ab62c7d50df1b749b83d5f0 (diff)
Merge branch 'params' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus
* 'params' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: (22 commits) param: don't deref arg in __same_type() checks param: update drivers/acpi/debug.c to new scheme param: use module_param in drivers/message/fusion/mptbase.c ide: use module_param_named rather than module_param_call param: update drivers/char/ipmi/ipmi_watchdog.c to new scheme param: lock if_sdio's lbs_helper_name and lbs_fw_name against sysfs changes. param: lock myri10ge_fw_name against sysfs changes. param: simple locking for sysfs-writable charp parameters param: remove unnecessary writable charp param: add kerneldoc to moduleparam.h param: locking for kernel parameters param: make param sections const. param: use free hook for charp (fix leak of charp parameters) param: add a free hook to kernel_param_ops. param: silence .init.text references from param ops Add param ops struct for hvc_iucv driver. nfs: update for module_param_named API change AppArmor: update for module_param_named API change param: use ops in struct kernel_param, rather than get and set fns directly param: move the EXPORT_SYMBOL to after the definitions. ...
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/rate.c2
-rw-r--r--net/sunrpc/auth.c9
-rw-r--r--net/sunrpc/xprtsock.c26
3 files changed, 24 insertions, 13 deletions
diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c
index 6d0bd198af19..be04d46110fe 100644
--- a/net/mac80211/rate.c
+++ b/net/mac80211/rate.c
@@ -103,6 +103,7 @@ ieee80211_rate_control_ops_get(const char *name)
103 struct rate_control_ops *ops; 103 struct rate_control_ops *ops;
104 const char *alg_name; 104 const char *alg_name;
105 105
106 kparam_block_sysfs_write(ieee80211_default_rc_algo);
106 if (!name) 107 if (!name)
107 alg_name = ieee80211_default_rc_algo; 108 alg_name = ieee80211_default_rc_algo;
108 else 109 else
@@ -120,6 +121,7 @@ ieee80211_rate_control_ops_get(const char *name)
120 /* try built-in one if specific alg requested but not found */ 121 /* try built-in one if specific alg requested but not found */
121 if (!ops && strlen(CONFIG_MAC80211_RC_DEFAULT)) 122 if (!ops && strlen(CONFIG_MAC80211_RC_DEFAULT))
122 ops = ieee80211_try_rate_control_ops_get(CONFIG_MAC80211_RC_DEFAULT); 123 ops = ieee80211_try_rate_control_ops_get(CONFIG_MAC80211_RC_DEFAULT);
124 kparam_unblock_sysfs_write(ieee80211_default_rc_algo);
123 125
124 return ops; 126 return ops;
125} 127}
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index 880d0de3f50f..36cb66022a27 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -39,7 +39,7 @@ static LIST_HEAD(cred_unused);
39static unsigned long number_cred_unused; 39static unsigned long number_cred_unused;
40 40
41#define MAX_HASHTABLE_BITS (10) 41#define MAX_HASHTABLE_BITS (10)
42static int param_set_hashtbl_sz(const char *val, struct kernel_param *kp) 42static int param_set_hashtbl_sz(const char *val, const struct kernel_param *kp)
43{ 43{
44 unsigned long num; 44 unsigned long num;
45 unsigned int nbits; 45 unsigned int nbits;
@@ -61,7 +61,7 @@ out_inval:
61 return -EINVAL; 61 return -EINVAL;
62} 62}
63 63
64static int param_get_hashtbl_sz(char *buffer, struct kernel_param *kp) 64static int param_get_hashtbl_sz(char *buffer, const struct kernel_param *kp)
65{ 65{
66 unsigned int nbits; 66 unsigned int nbits;
67 67
@@ -71,6 +71,11 @@ static int param_get_hashtbl_sz(char *buffer, struct kernel_param *kp)
71 71
72#define param_check_hashtbl_sz(name, p) __param_check(name, p, unsigned int); 72#define param_check_hashtbl_sz(name, p) __param_check(name, p, unsigned int);
73 73
74static struct kernel_param_ops param_ops_hashtbl_sz = {
75 .set = param_set_hashtbl_sz,
76 .get = param_get_hashtbl_sz,
77};
78
74module_param_named(auth_hashtable_size, auth_hashbits, hashtbl_sz, 0644); 79module_param_named(auth_hashtable_size, auth_hashbits, hashtbl_sz, 0644);
75MODULE_PARM_DESC(auth_hashtable_size, "RPC credential cache hashtable size"); 80MODULE_PARM_DESC(auth_hashtable_size, "RPC credential cache hashtable size");
76 81
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 7ca65c7005ea..49a62f0c4b87 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -2577,7 +2577,8 @@ void cleanup_socket_xprt(void)
2577 xprt_unregister_transport(&xs_bc_tcp_transport); 2577 xprt_unregister_transport(&xs_bc_tcp_transport);
2578} 2578}
2579 2579
2580static int param_set_uint_minmax(const char *val, struct kernel_param *kp, 2580static int param_set_uint_minmax(const char *val,
2581 const struct kernel_param *kp,
2581 unsigned int min, unsigned int max) 2582 unsigned int min, unsigned int max)
2582{ 2583{
2583 unsigned long num; 2584 unsigned long num;
@@ -2592,34 +2593,37 @@ static int param_set_uint_minmax(const char *val, struct kernel_param *kp,
2592 return 0; 2593 return 0;
2593} 2594}
2594 2595
2595static int param_set_portnr(const char *val, struct kernel_param *kp) 2596static int param_set_portnr(const char *val, const struct kernel_param *kp)
2596{ 2597{
2597 return param_set_uint_minmax(val, kp, 2598 return param_set_uint_minmax(val, kp,
2598 RPC_MIN_RESVPORT, 2599 RPC_MIN_RESVPORT,
2599 RPC_MAX_RESVPORT); 2600 RPC_MAX_RESVPORT);
2600} 2601}
2601 2602
2602static int param_get_portnr(char *buffer, struct kernel_param *kp) 2603static struct kernel_param_ops param_ops_portnr = {
2603{ 2604 .set = param_set_portnr,
2604 return param_get_uint(buffer, kp); 2605 .get = param_get_uint,
2605} 2606};
2607
2606#define param_check_portnr(name, p) \ 2608#define param_check_portnr(name, p) \
2607 __param_check(name, p, unsigned int); 2609 __param_check(name, p, unsigned int);
2608 2610
2609module_param_named(min_resvport, xprt_min_resvport, portnr, 0644); 2611module_param_named(min_resvport, xprt_min_resvport, portnr, 0644);
2610module_param_named(max_resvport, xprt_max_resvport, portnr, 0644); 2612module_param_named(max_resvport, xprt_max_resvport, portnr, 0644);
2611 2613
2612static int param_set_slot_table_size(const char *val, struct kernel_param *kp) 2614static int param_set_slot_table_size(const char *val,
2615 const struct kernel_param *kp)
2613{ 2616{
2614 return param_set_uint_minmax(val, kp, 2617 return param_set_uint_minmax(val, kp,
2615 RPC_MIN_SLOT_TABLE, 2618 RPC_MIN_SLOT_TABLE,
2616 RPC_MAX_SLOT_TABLE); 2619 RPC_MAX_SLOT_TABLE);
2617} 2620}
2618 2621
2619static int param_get_slot_table_size(char *buffer, struct kernel_param *kp) 2622static struct kernel_param_ops param_ops_slot_table_size = {
2620{ 2623 .set = param_set_slot_table_size,
2621 return param_get_uint(buffer, kp); 2624 .get = param_get_uint,
2622} 2625};
2626
2623#define param_check_slot_table_size(name, p) \ 2627#define param_check_slot_table_size(name, p) \
2624 __param_check(name, p, unsigned int); 2628 __param_check(name, p, unsigned int);
2625 2629