[Ocfs2-commits] mfasheh commits r2611 - trunk/fs/ocfs2/cluster
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Thu Sep 22 17:01:29 CDT 2005
Author: mfasheh
Signed-off-by: jlbec
Signed-off-by: zab
Date: 2005-09-22 17:01:28 -0500 (Thu, 22 Sep 2005)
New Revision: 2611
Removed:
trunk/fs/ocfs2/cluster/net_proc.c
Modified:
trunk/fs/ocfs2/cluster/Makefile
trunk/fs/ocfs2/cluster/nodemanager.c
trunk/fs/ocfs2/cluster/tcp.c
trunk/fs/ocfs2/cluster/tcp.h
trunk/fs/ocfs2/cluster/tcp_internal.h
Log:
* remove the o2net proc code.
Signed-off-by: jlbec
Signed-off-by: zab
Modified: trunk/fs/ocfs2/cluster/Makefile
===================================================================
--- trunk/fs/ocfs2/cluster/Makefile 2005-09-22 21:26:28 UTC (rev 2610)
+++ trunk/fs/ocfs2/cluster/Makefile 2005-09-22 22:01:28 UTC (rev 2611)
@@ -26,7 +26,6 @@
SOURCES = \
heartbeat.c \
masklog.c \
- net_proc.c \
nodemanager.c \
quorum.c \
tcp.c \
Deleted: trunk/fs/ocfs2/cluster/net_proc.c
===================================================================
--- trunk/fs/ocfs2/cluster/net_proc.c 2005-09-22 21:26:28 UTC (rev 2610)
+++ trunk/fs/ocfs2/cluster/net_proc.c 2005-09-22 22:01:28 UTC (rev 2611)
@@ -1,389 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * Copyright (C) 2005 Oracle. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
- */
-
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/slab.h>
-#include <linux/idr.h>
-#include <linux/kref.h>
-#include <linux/seq_file.h>
-
-#include <asm/uaccess.h>
-
-#include "tcp.h"
-#include "nodemanager.h"
-#define MLOG_MASK_PREFIX ML_TCP
-#include "masklog.h"
-
-#include "tcp_internal.h"
-
-static spinlock_t o2net_proc_lock = SPIN_LOCK_UNLOCKED;
-
-static LIST_HEAD(sock_containers);
-static LIST_HEAD(send_tracking);
-
-void o2net_proc_add_nst(struct o2net_send_tracking *nst)
-{
- spin_lock(&o2net_proc_lock);
- list_add(&nst->st_net_proc_item, &send_tracking);
- spin_unlock(&o2net_proc_lock);
-}
-void o2net_proc_del_nst(struct o2net_send_tracking *nst)
-{
- spin_lock(&o2net_proc_lock);
- if (!list_empty(&nst->st_net_proc_item))
- list_del_init(&nst->st_net_proc_item);
- spin_unlock(&o2net_proc_lock);
-}
-
-static struct o2net_send_tracking *next_nst(struct o2net_send_tracking *nst_start)
-{
- struct o2net_send_tracking *nst, *ret = NULL;
-
- assert_spin_locked(&o2net_proc_lock);
-
- list_for_each_entry(nst, &nst_start->st_net_proc_item,
- st_net_proc_item) {
- /* discover the head of the list */
- if (&nst->st_net_proc_item == &send_tracking)
- break;
-
- /* use st_task to detect real nsts in the list */
- if (nst->st_task != NULL) {
- ret = nst;
- break;
- }
- }
-
- return ret;
-}
-
-static void *nst_seq_start(struct seq_file *seq, loff_t *pos)
-{
- struct o2net_send_tracking *nst, *dummy_nst = seq->private;
-
- spin_lock(&o2net_proc_lock);
- nst = next_nst(dummy_nst);
- spin_unlock(&o2net_proc_lock);
-
- return nst;
-}
-
-static void *nst_seq_next(struct seq_file *seq, void *v, loff_t *pos)
-{
- struct o2net_send_tracking *nst, *dummy_nst = seq->private;
-
- spin_lock(&o2net_proc_lock);
- nst = next_nst(dummy_nst);
- list_del_init(&dummy_nst->st_net_proc_item);
- if (nst)
- list_add(&dummy_nst->st_net_proc_item,
- &nst->st_net_proc_item);
- spin_unlock(&o2net_proc_lock);
-
- return nst; /* unused, just needs to be null when done */
-}
-
-static int nst_seq_show(struct seq_file *seq, void *v)
-{
- struct o2net_send_tracking *nst, *dummy_nst = seq->private;
-
- spin_lock(&o2net_proc_lock);
- nst = next_nst(dummy_nst);
-
- if (nst != NULL) {
- /* get_task_comm isn't exported. oh well. */
- seq_printf(seq, "%p:\n"
- " pid: %lu\n"
- " tgid: %lu\n"
- " process name: %s\n"
- " node: %u\n"
- " sc: %p\n"
- " message type: %u\n"
- " message key: 0x%08x\n"
- " sock acquiry: %lu.%lu\n"
- " send start: %lu.%lu\n"
- " wait start: %lu.%lu\n",
- nst, (unsigned long)nst->st_task->pid,
- (unsigned long)nst->st_task->tgid,
- nst->st_task->comm, nst->st_node,
- nst->st_sc, nst->st_msg_type, nst->st_msg_key,
- nst->st_sock_time.tv_sec, nst->st_sock_time.tv_usec,
- nst->st_send_time.tv_sec, nst->st_send_time.tv_usec,
- nst->st_status_time.tv_sec,
- nst->st_status_time.tv_usec);
- }
-
- spin_unlock(&o2net_proc_lock);
-
- return 0;
-}
-
-static void nst_seq_stop(struct seq_file *seq, void *v)
-{
-}
-
-static struct seq_operations nst_seq_ops = {
- .start = nst_seq_start,
- .next = nst_seq_next,
- .stop = nst_seq_stop,
- .show = nst_seq_show,
-};
-
-static int nst_fop_open(struct inode *inode, struct file *file)
-{
- struct o2net_send_tracking *dummy_nst;
- struct seq_file *seq;
- int ret;
-
- dummy_nst = kmalloc(sizeof(struct o2net_send_tracking), GFP_KERNEL);
- if (dummy_nst == NULL) {
- ret = -ENOMEM;
- goto out;
- }
- dummy_nst->st_task = NULL;
-
- ret = seq_open(file, &nst_seq_ops);
- if (ret)
- goto out;
-
- seq = file->private_data;
- seq->private = dummy_nst;
- o2net_proc_add_nst(dummy_nst);
-
- dummy_nst = NULL;
-
-out:
- kfree(dummy_nst);
- return ret;
-}
-
-static int nst_fop_release(struct inode *inode, struct file *file)
-{
- struct seq_file *seq = file->private_data;
- struct o2net_send_tracking *dummy_nst = seq->private;
-
- o2net_proc_del_nst(dummy_nst);
- return seq_release_private(inode, file);
-}
-
-static struct file_operations nst_seq_fops = {
- .owner = THIS_MODULE,
- .open = nst_fop_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = nst_fop_release,
-};
-
-void o2net_proc_add_sc(struct o2net_sock_container *sc)
-{
- spin_lock(&o2net_proc_lock);
- list_add(&sc->sc_net_proc_item, &sock_containers);
- spin_unlock(&o2net_proc_lock);
-}
-
-void o2net_proc_del_sc(struct o2net_sock_container *sc)
-{
- spin_lock(&o2net_proc_lock);
- list_del_init(&sc->sc_net_proc_item);
- spin_unlock(&o2net_proc_lock);
-}
-
-static struct o2net_sock_container *next_sc(struct o2net_sock_container *sc_start)
-{
- struct o2net_sock_container *sc, *ret = NULL;
-
- assert_spin_locked(&o2net_proc_lock);
-
- list_for_each_entry(sc, &sc_start->sc_net_proc_item, sc_net_proc_item) {
- /* discover the head of the list miscast as a sc */
- if (&sc->sc_net_proc_item == &sock_containers)
- break;
-
- /* use sc_page to detect real scs in the list */
- if (sc->sc_page != NULL) {
- ret = sc;
- break;
- }
- }
-
- return ret;
-}
-
-static void *sc_seq_start(struct seq_file *seq, loff_t *pos)
-{
- struct o2net_sock_container *sc, *dummy_sc = seq->private;
-
- spin_lock(&o2net_proc_lock);
- sc = next_sc(dummy_sc);
- spin_unlock(&o2net_proc_lock);
-
- return sc;
-}
-
-static void *sc_seq_next(struct seq_file *seq, void *v, loff_t *pos)
-{
- struct o2net_sock_container *sc, *dummy_sc = seq->private;
-
- spin_lock(&o2net_proc_lock);
- sc = next_sc(dummy_sc);
- list_del_init(&dummy_sc->sc_net_proc_item);
- if (sc)
- list_add(&dummy_sc->sc_net_proc_item, &sc->sc_net_proc_item);
- spin_unlock(&o2net_proc_lock);
-
- return sc; /* unused, just needs to be null when done */
-}
-
-static int sc_seq_show(struct seq_file *seq, void *v)
-{
- struct o2net_sock_container *sc, *dummy_sc = seq->private;
-
- spin_lock(&o2net_proc_lock);
- sc = next_sc(dummy_sc);
-
- if (sc != NULL) {
-/* netdev 1, world 0 */
-#ifdef INET_SK_RETURNS_INET_OPT
- struct inet_opt *inet = NULL;
-#else
- struct inet_sock *inet = NULL;
-#endif
- __be32 saddr = 0, daddr = 0;
- __be16 sport = 0, dport = 0;
-
- if (sc->sc_sock) {
- inet = inet_sk(sc->sc_sock->sk);
- /* the stack's structs aren't sparse endian clean */
- saddr = (__force __be32)inet->saddr;
- daddr = (__force __be32)inet->daddr;
- sport = (__force __be16)inet->sport;
- dport = (__force __be16)inet->dport;
- }
-
- /* XXX sigh, inet-> doesn't have sparse annotation so any
- * use of it here generates a warning with -Wbitwise */
- seq_printf(seq, "%p:\n"
- " krefs: %d\n"
- " sock: %u.%u.%u.%u:%u -> %u.%u.%u.%u:%u\n"
- " remote node: %s\n"
- " page off: %zu\n",
- sc, atomic_read(&sc->sc_kref.refcount),
- NIPQUAD(saddr), inet ? ntohs(sport) : 0,
- NIPQUAD(daddr), inet ? ntohs(dport) : 0,
- sc->sc_node->nd_name, sc->sc_page_off);
- }
-
-
- spin_unlock(&o2net_proc_lock);
-
- return 0;
-}
-
-static void sc_seq_stop(struct seq_file *seq, void *v)
-{
-}
-
-static struct seq_operations sc_seq_ops = {
- .start = sc_seq_start,
- .next = sc_seq_next,
- .stop = sc_seq_stop,
- .show = sc_seq_show,
-};
-
-static int sc_fop_open(struct inode *inode, struct file *file)
-{
- struct o2net_sock_container *dummy_sc;
- struct seq_file *seq;
- int ret;
-
- dummy_sc = kmalloc(sizeof(struct o2net_sock_container), GFP_KERNEL);
- if (dummy_sc == NULL) {
- ret = -ENOMEM;
- goto out;
- }
- dummy_sc->sc_page = NULL;
-
- ret = seq_open(file, &sc_seq_ops);
- if (ret)
- goto out;
-
- seq = file->private_data;
- seq->private = dummy_sc;
- o2net_proc_add_sc(dummy_sc);
-
- dummy_sc = NULL;
-
-out:
- kfree(dummy_sc);
- return ret;
-}
-
-static int sc_fop_release(struct inode *inode, struct file *file)
-{
- struct seq_file *seq = file->private_data;
- struct o2net_sock_container *dummy_sc = seq->private;
-
- o2net_proc_del_sc(dummy_sc);
- return seq_release_private(inode, file);
-}
-
-static struct file_operations sc_seq_fops = {
- .owner = THIS_MODULE,
- .open = sc_fop_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = sc_fop_release,
-};
-
-#define SC_PROC_NAME "sock_containers"
-#define NST_PROC_NAME "send_tracking"
-
-void o2net_proc_exit(struct proc_dir_entry *parent)
-{
- remove_proc_entry(SC_PROC_NAME, parent);
- remove_proc_entry(NST_PROC_NAME, parent);
-}
-EXPORT_SYMBOL_GPL(o2net_proc_exit);
-
-int o2net_proc_init(struct proc_dir_entry *parent)
-{
- struct proc_dir_entry *proc_sc = NULL, *proc_nst = NULL;
- int ret;
-
- proc_sc = create_proc_entry(SC_PROC_NAME, S_IRUGO, parent);
- proc_nst = create_proc_entry(NST_PROC_NAME, S_IRUGO, parent);
-
- if (proc_sc && proc_nst) {
- ret = 0;
- proc_sc->proc_fops = &sc_seq_fops;
- proc_nst->proc_fops = &nst_seq_fops;
- } else {
- ret = -ENOMEM;
- if (proc_sc)
- remove_proc_entry(SC_PROC_NAME, parent);
- if (proc_nst)
- remove_proc_entry(NST_PROC_NAME, parent);
- }
-
- return ret;
-}
-EXPORT_SYMBOL_GPL(o2net_proc_init);
Modified: trunk/fs/ocfs2/cluster/nodemanager.c
===================================================================
--- trunk/fs/ocfs2/cluster/nodemanager.c 2005-09-22 21:26:28 UTC (rev 2610)
+++ trunk/fs/ocfs2/cluster/nodemanager.c 2005-09-22 22:01:28 UTC (rev 2611)
@@ -752,7 +752,6 @@
configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
o2nm_remove_proc(o2nm_proc);
mlog_remove_proc(o2nm_proc);
- o2net_proc_exit(o2nm_proc);
remove_proc_entry(O2NM_PROC_PATH, NULL);
o2net_exit();
@@ -886,15 +885,10 @@
if (ret)
goto out_remove;
- ret = o2net_proc_init(o2nm_proc);
- if (ret)
- goto out_mlog;
-
ret = o2nm_init_proc(o2nm_proc);
if (ret == 0)
goto out;
-out_mlog:
mlog_remove_proc(o2nm_proc);
out_remove:
remove_proc_entry(O2NM_PROC_PATH, NULL);
Modified: trunk/fs/ocfs2/cluster/tcp.c
===================================================================
--- trunk/fs/ocfs2/cluster/tcp.c 2005-09-22 21:26:28 UTC (rev 2610)
+++ trunk/fs/ocfs2/cluster/tcp.c 2005-09-22 22:01:28 UTC (rev 2611)
@@ -290,7 +290,6 @@
o2nm_node_put(sc->sc_node);
sc->sc_node = NULL;
- o2net_proc_del_sc(sc);
kfree(sc);
}
@@ -331,7 +330,6 @@
ret = sc;
sc->sc_page = page;
- o2net_proc_add_sc(sc);
sc = NULL;
page = NULL;
@@ -886,13 +884,6 @@
struct o2net_status_wait nsw = {
.ns_node_item = LIST_HEAD_INIT(nsw.ns_node_item),
};
- struct o2net_send_tracking nst = {
- .st_net_proc_item = LIST_HEAD_INIT(nst.st_net_proc_item),
- .st_task = current,
- .st_msg_type = msg_type,
- .st_msg_key = key,
- .st_node = target_node,
- };
if (o2net_wq == NULL) {
mlog(0, "attempt to tx without o2netd running\n");
@@ -918,9 +909,6 @@
goto out;
}
- o2net_proc_add_nst(&nst);
-
- do_gettimeofday(&nst.st_sock_time);
ret = wait_event_interruptible(nn->nn_sc_wq,
o2net_tx_can_proceed(nn, &sc, &error));
if (!ret && error)
@@ -928,8 +916,6 @@
if (ret)
goto out;
- nst.st_sc = sc;
-
veclen = caller_veclen + 1;
vec = kmalloc(sizeof(struct kvec) * veclen, GFP_ATOMIC);
if (vec == NULL) {
@@ -957,7 +943,6 @@
msg->msg_num = cpu_to_be32(nsw.ns_id);
- do_gettimeofday(&nst.st_send_time);
/* finally, convert the message header to network byte-order
* and send */
ret = o2net_send_tcp_msg(sc->sc_sock, vec, veclen,
@@ -969,7 +954,6 @@
}
/* wait on other node's handler */
- do_gettimeofday(&nst.st_status_time);
wait_event(nsw.ns_wq, o2net_nsw_completed(nn, &nsw));
/* Note that we avoid overwriting the callers status return
@@ -982,7 +966,6 @@
mlog(0, "woken, returning system status %d, user status %d\n",
ret, nsw.ns_status);
out:
- o2net_proc_del_nst(&nst); /* must be before dropping sc and node */
if (sc)
sc_put(sc);
if (vec)
Modified: trunk/fs/ocfs2/cluster/tcp.h
===================================================================
--- trunk/fs/ocfs2/cluster/tcp.h 2005-09-22 21:26:28 UTC (rev 2610)
+++ trunk/fs/ocfs2/cluster/tcp.h 2005-09-22 22:01:28 UTC (rev 2611)
@@ -110,8 +110,4 @@
int o2net_proc_init(struct proc_dir_entry *parent);
void o2net_proc_exit(struct proc_dir_entry *parent);
-struct o2net_send_tracking;
-void o2net_proc_add_nst(struct o2net_send_tracking *nst);
-void o2net_proc_del_nst(struct o2net_send_tracking *nst);
-
#endif /* O2CLUSTER_TCP_H */
Modified: trunk/fs/ocfs2/cluster/tcp_internal.h
===================================================================
--- trunk/fs/ocfs2/cluster/tcp_internal.h 2005-09-22 21:26:28 UTC (rev 2610)
+++ trunk/fs/ocfs2/cluster/tcp_internal.h 2005-09-22 22:01:28 UTC (rev 2611)
@@ -126,8 +126,6 @@
void (*sc_state_change)(struct sock *sk);
void (*sc_data_ready)(struct sock *sk, int bytes);
- struct list_head sc_net_proc_item;
-
struct timeval sc_tv_timer;
struct timeval sc_tv_data_ready;
struct timeval sc_tv_advance_start;
@@ -165,20 +163,4 @@
struct list_head ns_node_item;
};
-/* just for state dumps */
-struct o2net_send_tracking {
- struct list_head st_net_proc_item;
- struct task_struct *st_task;
- struct o2net_sock_container *st_sc;
- u32 st_msg_type;
- u32 st_msg_key;
- u8 st_node;
- struct timeval st_sock_time;
- struct timeval st_send_time;
- struct timeval st_status_time;
-};
-
-void o2net_proc_add_sc(struct o2net_sock_container *sc);
-void o2net_proc_del_sc(struct o2net_sock_container *sc);
-
#endif /* O2CLUSTER_TCP_INTERNAL_H */
More information about the Ocfs2-commits
mailing list