This patch adds new notifier function tunable_notifier_chain. Its base is
atomic_notifier_chain.
Thanks,
---
Signed-off-by: Takenori Nagano <t-nagano@ah.jp.nec.com>
---
diff -uprN linux-2.6.25-rc8-mm1.orig/include/linux/notifier.h linux-2.6.25-rc8-mm1/include/linux/notifier.h
--- linux-2.6.25-rc8-mm1.orig/include/linux/notifier.h 2008-04-08 16:37:43.700000000 +0900
+++ linux-2.6.25-rc8-mm1/include/linux/notifier.h 2008-04-09 20:01:10.328000000 +0900
@@ -13,6 +13,7 @@
#include <linux/mutex.h>
#include <linux/rwsem.h>
#include <linux/srcu.h>
+#include <linux/kobject.h>
/*
* Notifier chains are of four types:
@@ -53,6 +54,13 @@ struct notifier_block {
int priority;
};
+struct tunable_atomic_notifier_block {
+ struct notifier_block *nb;
+ struct tunable_atomic_notifier_head *head;
+ struct kobject kobj;
+ char *desc;
+};
+
struct atomic_notifier_head {
spinlock_t lock;
struct notifier_block *head;
@@ -63,6 +71,13 @@ struct blocking_notifier_head {
struct notifier_block *head;
};
+struct tunable_atomic_notifier_head {
+ spinlock_t lock;
+ struct notifier_block *head;
+ char *name;
+ struct kset *notifier_sub_kset;
+};
+
struct raw_notifier_head {
struct notifier_block *head;
};
@@ -73,6 +88,13 @@ struct srcu_notifier_head {
struct notifier_block *head;
};
+struct control_file_info {
+ struct tunable_atomic_notifier_head *nh;
+ struct tunable_atomic_notifier_block *n;
+ char *name;
+ struct control_file_info *next;
+};
+
#define ATOMIC_INIT_NOTIFIER_HEAD(name) do { \
spin_lock_init(&(name)->lock); \
(name)->head = NULL; \
@@ -81,6 +103,12 @@ struct srcu_notifier_head {
init_rwsem(&(name)->rwsem); \
(name)->head = NULL; \
} while (0)
+#define TUNABLE_ATOMIC_INIT_NOTIFIER(val1, val2) do { \
+ spin_lock_init(&(val1)->lock); \
+ (val1)->head = NULL; \
+ (val1)->name = val2; \
+ (val1)->notifier_sub_kset = NULL; \
+ } whil...