[Ocfs2-commits] zab commits r1989 -
branches/usysfsify/fs/ocfs2/cluster
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Wed Mar 16 19:06:25 CST 2005
Author: zab
Date: 2005-03-16 19:06:23 -0600 (Wed, 16 Mar 2005)
New Revision: 1989
Modified:
branches/usysfsify/fs/ocfs2/cluster/nodemanager.c
branches/usysfsify/fs/ocfs2/cluster/nodemanager.h
Log:
o tear out unused nm callbacks
o (also, initializing <= ARRAY_SIZE() blows)
Modified: branches/usysfsify/fs/ocfs2/cluster/nodemanager.c
===================================================================
--- branches/usysfsify/fs/ocfs2/cluster/nodemanager.c 2005-03-17 00:57:58 UTC (rev 1988)
+++ branches/usysfsify/fs/ocfs2/cluster/nodemanager.c 2005-03-17 01:06:23 UTC (rev 1989)
@@ -72,9 +72,6 @@
#define __user
#endif
-static DECLARE_MUTEX(nm_cb_sem);
-struct list_head nm_callbacks[NM_NUM_CB];
-
/* for now we operate under the assertion that there can be only one
* cluster active at a time. Changing this will require trickling
* cluster references throughout where nodes are looked up */
@@ -182,63 +179,6 @@
}
EXPORT_SYMBOL(nm_this_node);
-int nm_register_callback(unsigned int type, void (*func)(void *, void *, u8))
-{
- nm_callback_func *f;
-
- if (type >= NM_NUM_CB)
- return -EINVAL;
- f = kmalloc(sizeof(nm_callback_func), GFP_KERNEL);
- if (f == NULL)
- return -ENOMEM;
- memset(f, 0, sizeof(nm_callback_func));
- f->func = func;
- down(&nm_cb_sem);
- list_add_tail(&f->list, &nm_callbacks[type]);
- up(&nm_cb_sem);
- return 0;
-}
-EXPORT_SYMBOL(nm_register_callback);
-
-int nm_unregister_callback(unsigned int type, void (*func)(void *, void *, u8))
-{
- struct list_head *iter, *tmpiter;
- int ret = -EINVAL;
- nm_callback_func *f;
-
- if (type >= NM_NUM_CB)
- return ret;
-
- down(&nm_cb_sem);
- list_for_each_safe(iter, tmpiter, &nm_callbacks[type]) {
- f = list_entry (iter, nm_callback_func, list);
- if (f->func == func) {
- list_del(&f->list);
- kfree(f);
- ret = 0;
- break;
- }
- }
- up(&nm_cb_sem);
- return ret;
-}
-EXPORT_SYMBOL(nm_unregister_callback);
-
-#if 0
-static void nm_do_callbacks(int type, void *ptr1, void *ptr2, u8 idx)
-{
- struct list_head *iter;
- nm_callback_func *f;
-
- down(&nm_cb_sem);
- list_for_each(iter, &nm_callbacks[type]) {
- f = list_entry (iter, nm_callback_func, list);
- (f->func) (ptr1, ptr2, idx);
- }
- up(&nm_cb_sem);
-}
-#endif
-
/* node usysfs bits */
static struct nm_cluster *to_nm_cluster(struct kobject *kobj)
@@ -356,12 +296,6 @@
memcpy(&node->nd_ipv4_address, &u.ipv4_addr, sizeof(u.ipv4_addr));
-#if 0
- /* XXX kick off to a thread? */
- /* XXX bubble inode arg down to callbacks? :/ */
- nm_do_callbacks(NM_NODE_ADD_CB, node);
-#endif
-
return count;
}
static ssize_t nm_node_local_read(struct nm_node *node, char *page)
@@ -719,9 +653,6 @@
if (ret)
goto out;
- for (i = 0; i <= ARRAY_SIZE(nm_callbacks); i++)
- INIT_LIST_HEAD(&nm_callbacks[i]);
-
ukset_init(&nm_cluster_set.cs_ukset);
ret = usysfs_register_subsystem(&nm_cluster_set.cs_ukset.kset);
if (ret) {
Modified: branches/usysfsify/fs/ocfs2/cluster/nodemanager.h
===================================================================
--- branches/usysfsify/fs/ocfs2/cluster/nodemanager.h 2005-03-17 00:57:58 UTC (rev 1988)
+++ branches/usysfsify/fs/ocfs2/cluster/nodemanager.h 2005-03-17 01:06:23 UTC (rev 1989)
@@ -91,26 +91,7 @@
net_inode_private nd_net_inode_private;
};
-/* callback stuff */
-
-enum {
- NM_NODE_ADD_CB = 0,
- NM_NODE_DEL_CB,
- NM_NUM_CB
-};
-
-typedef void (nm_cb_func)(void *, void *, u8);
-
-typedef struct _nm_callback_func
-{
- struct list_head list;
- nm_cb_func *func;
-} nm_callback_func;
-
-
u8 nm_this_node(void);
-int nm_register_callback(unsigned int type, void (*func)(void *, void *, u8));
-int nm_unregister_callback(unsigned int type, void (*func)(void *, void *, u8));
struct nm_node * nm_get_node_by_num(u8 node_num);
struct nm_node * nm_get_node_by_ip(u32 addr);
More information about the Ocfs2-commits
mailing list