[Ocfs2-commits] mfasheh commits r2636 - in
branches/locking-changes/fs/ocfs2: . cluster dlm
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Tue Oct 4 18:12:01 CDT 2005
Author: mfasheh
Date: 2005-10-04 18:11:58 -0500 (Tue, 04 Oct 2005)
New Revision: 2636
Added:
branches/locking-changes/fs/ocfs2/cluster/sys.c
branches/locking-changes/fs/ocfs2/cluster/sys.h
Removed:
branches/locking-changes/fs/ocfs2/cluster/net_proc.c
branches/locking-changes/fs/ocfs2/proc.c
branches/locking-changes/fs/ocfs2/proc.h
Modified:
branches/locking-changes/fs/ocfs2/Makefile
branches/locking-changes/fs/ocfs2/cluster/Makefile
branches/locking-changes/fs/ocfs2/cluster/heartbeat.c
branches/locking-changes/fs/ocfs2/cluster/heartbeat.h
branches/locking-changes/fs/ocfs2/cluster/masklog.c
branches/locking-changes/fs/ocfs2/cluster/masklog.h
branches/locking-changes/fs/ocfs2/cluster/nodemanager.c
branches/locking-changes/fs/ocfs2/cluster/tcp.c
branches/locking-changes/fs/ocfs2/cluster/tcp.h
branches/locking-changes/fs/ocfs2/cluster/tcp_internal.h
branches/locking-changes/fs/ocfs2/dlm/dlmdebug.c
branches/locking-changes/fs/ocfs2/dlm/dlmdebug.h
branches/locking-changes/fs/ocfs2/dlm/dlmdomain.c
branches/locking-changes/fs/ocfs2/super.c
Log:
* merge svn 2609:2615 from trunk
-move from procfs to sysfs
Modified: branches/locking-changes/fs/ocfs2/Makefile
===================================================================
--- branches/locking-changes/fs/ocfs2/Makefile 2005-10-04 22:49:12 UTC (rev 2635)
+++ branches/locking-changes/fs/ocfs2/Makefile 2005-10-04 23:11:58 UTC (rev 2636)
@@ -55,7 +55,6 @@
localalloc.c \
mmap.c \
namei.c \
- proc.c \
slot_map.c \
suballoc.c \
super.c \
@@ -86,7 +85,6 @@
localalloc.h \
mmap.h \
namei.h \
- proc.h \
slot_map.h \
suballoc.h \
super.h \
Modified: branches/locking-changes/fs/ocfs2/cluster/Makefile
===================================================================
--- branches/locking-changes/fs/ocfs2/cluster/Makefile 2005-10-04 22:49:12 UTC (rev 2635)
+++ branches/locking-changes/fs/ocfs2/cluster/Makefile 2005-10-04 23:11:58 UTC (rev 2636)
@@ -26,9 +26,9 @@
SOURCES = \
heartbeat.c \
masklog.c \
- net_proc.c \
nodemanager.c \
quorum.c \
+ sys.c \
tcp.c \
ver.c
@@ -40,6 +40,7 @@
ocfs2_heartbeat.h \
ocfs2_nodemanager.h \
quorum.h \
+ sys.h \
tcp.h \
tcp_internal.h \
ver.h
Modified: branches/locking-changes/fs/ocfs2/cluster/heartbeat.c
===================================================================
--- branches/locking-changes/fs/ocfs2/cluster/heartbeat.c 2005-10-04 22:49:12 UTC (rev 2635)
+++ branches/locking-changes/fs/ocfs2/cluster/heartbeat.c 2005-10-04 23:11:58 UTC (rev 2636)
@@ -77,7 +77,7 @@
* No locking or otherwise interesting code is required for reading
* o2hb_dead_threshold as it can't change once regions are active and
* it's not interesting to anyone until then anyway. */
-void o2hb_dead_threshold_set(unsigned int threshold)
+static void o2hb_dead_threshold_set(unsigned int threshold)
{
if (threshold > O2HB_MIN_DEAD_THRESHOLD) {
spin_lock(&o2hb_live_lock);
@@ -1533,6 +1533,81 @@
config_item_put(item);
}
+struct o2hb_heartbeat_group_attribute {
+ struct configfs_attribute attr;
+ ssize_t (*show)(struct o2hb_heartbeat_group *, char *);
+ ssize_t (*store)(struct o2hb_heartbeat_group *, const char *, size_t);
+};
+
+static ssize_t o2hb_heartbeat_group_show(struct config_item *item,
+ struct configfs_attribute *attr,
+ char *page)
+{
+ struct o2hb_heartbeat_group *reg = to_o2hb_heartbeat_group(to_config_group(item));
+ struct o2hb_heartbeat_group_attribute *o2hb_heartbeat_group_attr =
+ container_of(attr, struct o2hb_heartbeat_group_attribute, attr);
+ ssize_t ret = 0;
+
+ if (o2hb_heartbeat_group_attr->show)
+ ret = o2hb_heartbeat_group_attr->show(reg, page);
+ return ret;
+}
+
+static ssize_t o2hb_heartbeat_group_store(struct config_item *item,
+ struct configfs_attribute *attr,
+ const char *page, size_t count)
+{
+ struct o2hb_heartbeat_group *reg = to_o2hb_heartbeat_group(to_config_group(item));
+ struct o2hb_heartbeat_group_attribute *o2hb_heartbeat_group_attr =
+ container_of(attr, struct o2hb_heartbeat_group_attribute, attr);
+ ssize_t ret = -EINVAL;
+
+ if (o2hb_heartbeat_group_attr->store)
+ ret = o2hb_heartbeat_group_attr->store(reg, page, count);
+ return ret;
+}
+
+static ssize_t o2hb_heartbeat_group_threshold_show(struct o2hb_heartbeat_group *group,
+ char *page)
+{
+ return sprintf(page, "%u\n", o2hb_dead_threshold);
+}
+
+static ssize_t o2hb_heartbeat_group_threshold_store(struct o2hb_heartbeat_group *group,
+ const char *page,
+ size_t count)
+{
+ unsigned long tmp;
+ char *p = (char *)page;
+
+ tmp = simple_strtoul(p, &p, 10);
+ if (!p || (*p && (*p != '\n')))
+ return -EINVAL;
+
+ /* this will validate ranges for us. */
+ o2hb_dead_threshold_set((unsigned int) tmp);
+
+ return count;
+}
+
+static struct o2hb_heartbeat_group_attribute o2hb_heartbeat_group_attr_threshold = {
+ .attr = { .ca_owner = THIS_MODULE,
+ .ca_name = "dead_threshold",
+ .ca_mode = S_IRUGO | S_IWUSR },
+ .show = o2hb_heartbeat_group_threshold_show,
+ .store = o2hb_heartbeat_group_threshold_store,
+};
+
+static struct configfs_attribute *o2hb_heartbeat_group_attrs[] = {
+ &o2hb_heartbeat_group_attr_threshold.attr,
+ NULL,
+};
+
+static struct configfs_item_operations o2hb_hearbeat_group_item_ops = {
+ .show_attribute = o2hb_heartbeat_group_show,
+ .store_attribute = o2hb_heartbeat_group_store,
+};
+
static struct configfs_group_operations o2hb_heartbeat_group_group_ops = {
.make_item = o2hb_heartbeat_group_make_item,
.drop_item = o2hb_heartbeat_group_drop_item,
@@ -1540,6 +1615,8 @@
static struct config_item_type o2hb_heartbeat_group_type = {
.ct_group_ops = &o2hb_heartbeat_group_group_ops,
+ .ct_item_ops = &o2hb_hearbeat_group_item_ops,
+ .ct_attrs = o2hb_heartbeat_group_attrs,
.ct_owner = THIS_MODULE,
};
Modified: branches/locking-changes/fs/ocfs2/cluster/heartbeat.h
===================================================================
--- branches/locking-changes/fs/ocfs2/cluster/heartbeat.h 2005-10-04 22:49:12 UTC (rev 2635)
+++ branches/locking-changes/fs/ocfs2/cluster/heartbeat.h 2005-10-04 23:11:58 UTC (rev 2636)
@@ -40,9 +40,6 @@
#define O2HB_MIN_DEAD_THRESHOLD 2
#define O2HB_MAX_WRITE_TIMEOUT_MS (O2HB_REGION_TIMEOUT_MS * (o2hb_dead_threshold - 1))
-/* Always use this to set o2hb_dead_threshold */
-void o2hb_dead_threshold_set(unsigned int threshold);
-
#define O2HB_CB_MAGIC 0x51d1e4ec
/* callback stuff */
Modified: branches/locking-changes/fs/ocfs2/cluster/masklog.c
===================================================================
--- branches/locking-changes/fs/ocfs2/cluster/masklog.c 2005-10-04 22:49:12 UTC (rev 2635)
+++ branches/locking-changes/fs/ocfs2/cluster/masklog.c 2005-10-04 23:11:58 UTC (rev 2636)
@@ -33,195 +33,134 @@
struct mlog_bits mlog_not_bits = MLOG_BITS_RHS(MLOG_INITIAL_NOT_MASK);
EXPORT_SYMBOL_GPL(mlog_not_bits);
-static char *mlog_bit_names[MLOG_MAX_BITS];
-
-static void *mlog_name_from_pos(loff_t *caller_pos)
+static ssize_t mlog_mask_show(u64 mask, char *buf)
{
- loff_t pos = *caller_pos;
- while (pos < ARRAY_SIZE(mlog_bit_names) && mlog_bit_names[pos] == NULL)
- pos++;
-
- if (pos >= ARRAY_SIZE(mlog_bit_names))
- return NULL;
-
- *caller_pos = pos;
- return &mlog_bit_names[pos];
-}
-
-static void *mlog_seq_start(struct seq_file *seq, loff_t *pos)
-{
- return mlog_name_from_pos(pos);
-}
-
-static void *mlog_seq_next(struct seq_file *seq, void *v, loff_t *pos)
-{
- (*pos)++;
- return mlog_name_from_pos(pos);
-}
-
-static int mlog_seq_show(struct seq_file *seq, void *v)
-{
- char **name = v;
- int bit = name - mlog_bit_names;
char *state;
- if (__mlog_test_u64((u64)1 << bit, mlog_and_bits))
+ if (__mlog_test_u64(mask, mlog_and_bits))
state = "allow";
- else if (__mlog_test_u64((u64)1 << bit, mlog_not_bits))
+ else if (__mlog_test_u64(mask, mlog_not_bits))
state = "deny";
else
state = "off";
- seq_printf(seq, "%s %s\n", *name, state);
- return 0;
+ return snprintf(buf, PAGE_SIZE, "%s\n", state);
}
-static void mlog_seq_stop(struct seq_file *p, void *v)
+static ssize_t mlog_mask_store(u64 mask, const char *buf, size_t count)
{
+ if (!strnicmp(buf, "allow", 5)) {
+ __mlog_set_u64(mask, mlog_and_bits);
+ __mlog_clear_u64(mask, mlog_not_bits);
+ } else if (!strnicmp(buf, "deny", 4)) {
+ __mlog_set_u64(mask, mlog_not_bits);
+ __mlog_clear_u64(mask, mlog_and_bits);
+ } else if (!strnicmp(buf, "off", 3)) {
+ __mlog_clear_u64(mask, mlog_not_bits);
+ __mlog_clear_u64(mask, mlog_and_bits);
+ } else
+ return -EINVAL;
+
+ return count;
}
-static struct seq_operations mlog_seq_ops = {
- .start = mlog_seq_start,
- .next = mlog_seq_next,
- .stop = mlog_seq_stop,
- .show = mlog_seq_show,
+struct mlog_attribute {
+ struct attribute attr;
+ u64 mask;
};
-static int mlog_fop_open(struct inode *inode, struct file *file)
-{
- return seq_open(file, &mlog_seq_ops);
+#define to_mlog_attr(_attr) container_of(_attr, struct mlog_attribute, attr)
+
+#define define_mask(_name) { \
+ .attr = { \
+ .name = #_name, \
+ .mode = S_IRUGO | S_IWUSR, \
+ }, \
+ .mask = ML_##_name, \
}
-static ssize_t mlog_fop_write(struct file *filp, const char __user *buf,
- size_t count, loff_t *pos)
-{
- char *name;
- char str[32], *mask, *val;
- unsigned i, masklen, namelen;
+static struct mlog_attribute mlog_attrs[MLOG_MAX_BITS] = {
+ define_mask(ENTRY),
+ define_mask(EXIT),
+ define_mask(TCP),
+ define_mask(MSG),
+ define_mask(SOCKET),
+ define_mask(HEARTBEAT),
+ define_mask(HB_BIO),
+ define_mask(DLMFS),
+ define_mask(DLM),
+ define_mask(DLM_DOMAIN),
+ define_mask(DLM_THREAD),
+ define_mask(DLM_MASTER),
+ define_mask(DLM_RECOVERY),
+ define_mask(AIO),
+ define_mask(JOURNAL),
+ define_mask(DISK_ALLOC),
+ define_mask(SUPER),
+ define_mask(FILE_IO),
+ define_mask(EXTENT_MAP),
+ define_mask(DLM_GLUE),
+ define_mask(BH_IO),
+ define_mask(UPTODATE),
+ define_mask(NAMEI),
+ define_mask(INODE),
+ define_mask(VOTE),
+ define_mask(DCACHE),
+ define_mask(CONN),
+ define_mask(QUORUM),
+ define_mask(EXPORT),
+ define_mask(ERROR),
+ define_mask(NOTICE),
+ define_mask(KTHREAD),
+};
- if (count == 0)
- return 0;
+static struct attribute *mlog_attr_ptrs[MLOG_MAX_BITS] = {NULL, };
- /* count at least mask + space + 3 for "off" */
- if (*pos != 0 || count < 5 || count >= sizeof(str))
- return -EINVAL;
+static ssize_t mlog_show(struct kobject *obj, struct attribute *attr,
+ char *buf)
+{
+ struct mlog_attribute *mlog_attr = to_mlog_attr(attr);
- if (copy_from_user(str, buf, count))
- return -EFAULT;
+ return mlog_mask_show(mlog_attr->mask, buf);
+}
- str[count] = '\0';
+static ssize_t mlog_store(struct kobject *obj, struct attribute *attr,
+ const char *buf, size_t count)
+{
+ struct mlog_attribute *mlog_attr = to_mlog_attr(attr);
- mask = str;
- val = strchr(str, ' ');
- if (val == NULL)
- return -EINVAL;
- *val = '\0';
- val++;
+ return mlog_mask_store(mlog_attr->mask, buf, count);
+}
- if (strlen(val) == 0)
- return -EINVAL;
+static struct sysfs_ops mlog_attr_ops = {
+ .show = mlog_show,
+ .store = mlog_store,
+};
- masklen = strlen(mask);
+static struct kobj_type mlog_ktype = {
+ .default_attrs = mlog_attr_ptrs,
+ .sysfs_ops = &mlog_attr_ops,
+};
- for (i = 0; i < ARRAY_SIZE(mlog_bit_names); i++) {
- name = mlog_bit_names[i];
+static struct kset mlog_kset = {
+ .kobj = {.name = "logmask", .ktype = &mlog_ktype},
+};
- if (name == NULL)
- continue;
+int mlog_sys_init(struct subsystem *o2cb_subsys)
+{
+ int i = 0;
- namelen = strlen(name);
-
- if (namelen != masklen
- || strnicmp(mask, name, namelen))
- continue;
- break;
+ while (mlog_attrs[i].attr.mode) {
+ mlog_attr_ptrs[i] = &mlog_attrs[i].attr;
+ i++;
}
- if (i == ARRAY_SIZE(mlog_bit_names))
- return -EINVAL;
+ mlog_attr_ptrs[i] = NULL;
- if (!strnicmp(val, "allow", 5)) {
- __mlog_set_u64((u64)1 << i, mlog_and_bits);
- __mlog_clear_u64((u64)1 << i, mlog_not_bits);
- } else if (!strnicmp(val, "deny", 4)) {
- __mlog_set_u64((u64)1 << i, mlog_not_bits);
- __mlog_clear_u64((u64)1 << i, mlog_and_bits);
- } else if (!strnicmp(val, "off", 3)) {
- __mlog_clear_u64((u64)1 << i, mlog_not_bits);
- __mlog_clear_u64((u64)1 << i, mlog_and_bits);
- } else
- return -EINVAL;
-
- *pos += count;
- return count;
+ mlog_kset.subsys = o2cb_subsys;
+ return kset_register(&mlog_kset);
}
-static struct file_operations mlog_seq_fops = {
- .owner = THIS_MODULE,
- .open = mlog_fop_open,
- .read = seq_read,
- .write = mlog_fop_write,
- .llseek = seq_lseek,
- .release = seq_release,
-};
-
-#define set_a_string(which) do { \
- struct mlog_bits _bits = {{0,}, }; \
- int _bit; \
- __mlog_set_u64(ML_##which, _bits); \
- _bit = find_first_bit(_bits.words, MLOG_MAX_BITS); \
- mlog_bit_names[_bit] = #which; \
-} while (0)
-
-#define LOGMASK_PROC_NAME "log_mask"
-
-void mlog_remove_proc(struct proc_dir_entry *parent)
+void mlog_sys_shutdown(void)
{
- remove_proc_entry(LOGMASK_PROC_NAME, parent);
+ kset_unregister(&mlog_kset);
}
-
-int mlog_init_proc(struct proc_dir_entry *parent)
-{
- struct proc_dir_entry *p;
-
- set_a_string(ENTRY);
- set_a_string(EXIT);
- set_a_string(TCP);
- set_a_string(MSG);
- set_a_string(SOCKET);
- set_a_string(HEARTBEAT);
- set_a_string(HB_BIO);
- set_a_string(DLMFS);
- set_a_string(DLM);
- set_a_string(DLM_DOMAIN);
- set_a_string(DLM_THREAD);
- set_a_string(DLM_MASTER);
- set_a_string(DLM_RECOVERY);
- set_a_string(AIO);
- set_a_string(JOURNAL);
- set_a_string(DISK_ALLOC);
- set_a_string(SUPER);
- set_a_string(FILE_IO);
- set_a_string(EXTENT_MAP);
- set_a_string(DLM_GLUE);
- set_a_string(BH_IO);
- set_a_string(UPTODATE);
- set_a_string(NAMEI);
- set_a_string(INODE);
- set_a_string(VOTE);
- set_a_string(DCACHE);
- set_a_string(CONN);
- set_a_string(QUORUM);
- set_a_string(EXPORT);
- set_a_string(ERROR);
- set_a_string(NOTICE);
- set_a_string(KTHREAD);
-
- p = create_proc_entry(LOGMASK_PROC_NAME, S_IRUGO, parent);
- if (p == NULL)
- return -ENOMEM;
-
- p->proc_fops = &mlog_seq_fops;
-
- return 0;
-}
-EXPORT_SYMBOL_GPL(mlog_init_proc);
Modified: branches/locking-changes/fs/ocfs2/cluster/masklog.h
===================================================================
--- branches/locking-changes/fs/ocfs2/cluster/masklog.h 2005-10-04 22:49:12 UTC (rev 2635)
+++ branches/locking-changes/fs/ocfs2/cluster/masklog.h 2005-10-04 23:11:58 UTC (rev 2636)
@@ -265,8 +265,9 @@
#define MLFx64 "lx"
#endif
-#include <linux/proc_fs.h>
-int mlog_init_proc(struct proc_dir_entry *parent);
-void mlog_remove_proc(struct proc_dir_entry *parent);
+#include <linux/kobject.h>
+#include <linux/sysfs.h>
+int mlog_sys_init(struct subsystem *o2cb_subsys);
+void mlog_sys_shutdown(void);
#endif /* O2CLUSTER_MASKLOG_H */
Deleted: branches/locking-changes/fs/ocfs2/cluster/net_proc.c
===================================================================
--- branches/locking-changes/fs/ocfs2/cluster/net_proc.c 2005-10-04 22:49:12 UTC (rev 2635)
+++ branches/locking-changes/fs/ocfs2/cluster/net_proc.c 2005-10-04 23:11:58 UTC (rev 2636)
@@ -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: branches/locking-changes/fs/ocfs2/cluster/nodemanager.c
===================================================================
--- branches/locking-changes/fs/ocfs2/cluster/nodemanager.c 2005-10-04 22:49:12 UTC (rev 2635)
+++ branches/locking-changes/fs/ocfs2/cluster/nodemanager.c 2005-10-04 23:11:58 UTC (rev 2636)
@@ -22,7 +22,6 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/sysctl.h>
-#include <linux/proc_fs.h>
#include <linux/configfs.h>
#include "endian.h"
@@ -30,6 +29,7 @@
#include "nodemanager.h"
#include "heartbeat.h"
#include "masklog.h"
+#include "sys.h"
#include "ver.h"
/* for now we operate under the assertion that there can be only one
@@ -730,18 +730,6 @@
},
};
-#define O2NM_PROC_PATH "fs/ocfs2_nodemanager"
-static struct proc_dir_entry *o2nm_proc;
-
-#define O2NM_VERSION_PROC_NAME "interface_revision"
-#define O2NM_HB_DEAD_THRESHOLD_NAME "hb_dead_threshold"
-
-static void o2nm_remove_proc(struct proc_dir_entry *parent)
-{
- remove_proc_entry(O2NM_VERSION_PROC_NAME, parent);
- remove_proc_entry(O2NM_HB_DEAD_THRESHOLD_NAME, parent);
-}
-
static void __exit exit_o2nm(void)
{
if (ocfs2_table_header)
@@ -750,104 +738,11 @@
/* XXX sync with hb callbacks and shut down hb? */
o2net_unregister_hb_callbacks();
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);
+ o2cb_sys_shutdown();
o2net_exit();
}
-static int o2nm_proc_read_uint(char *page, char **start, off_t off,
- int count, int *eof, unsigned int data)
-{
- int len;
-
- len = sprintf(page, "%u\n", data);
- if (len < 0)
- return len;
-
- if (len <= off + count)
- *eof = 1;
-
- *start = page + off;
-
- len -= off;
-
- if (len > count)
- len = count;
-
- if (len < 0)
- len = 0;
-
- return len;
-}
-
-static int o2nm_proc_version(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- return o2nm_proc_read_uint(page, start, off, count, eof,
- O2NM_API_VERSION);
-}
-
-static int o2nm_proc_threshold(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- return o2nm_proc_read_uint(page, start, off, count, eof,
- o2hb_dead_threshold);
-}
-
-static int o2nm_proc_write_threshold(struct file *file,
- const char __user *buffer,
- unsigned long count, void *data)
-{
- char buf[32];
- char *p = buf;
- unsigned long tmp;
-
- if (count > ARRAY_SIZE(buf) - 1)
- count = ARRAY_SIZE(buf) - 1;
-
- if (copy_from_user(buf, buffer, count))
- return -EFAULT;
-
- buf[ARRAY_SIZE(buf) - 1] = '\0';
-
- tmp = simple_strtoul(p, &p, 10);
- if (!p || (*p && (*p != '\n')))
- return -EINVAL;
-
- /* this will validate ranges for us. */
- o2hb_dead_threshold_set((unsigned int) tmp);
-
- return count;
-}
-
-static int o2nm_init_proc(struct proc_dir_entry *parent)
-{
- struct proc_dir_entry *p;
-
- p = create_proc_read_entry(O2NM_VERSION_PROC_NAME,
- S_IFREG | S_IRUGO,
- parent,
- o2nm_proc_version,
- NULL);
- if (!p)
- return -ENOMEM;
-
- p = create_proc_read_entry(O2NM_HB_DEAD_THRESHOLD_NAME,
- S_IFREG | S_IRUGO | S_IWUSR, parent,
- o2nm_proc_threshold,
- NULL);
- if (!p) {
- remove_proc_entry(O2NM_VERSION_PROC_NAME, parent);
- return -ENOMEM;
- }
- p->write_proc = o2nm_proc_write_threshold;
-
- return 0;
-}
-
static int __init init_o2nm(void)
{
int ret = -1;
@@ -876,29 +771,10 @@
goto out_callbacks;
}
- o2nm_proc = proc_mkdir(O2NM_PROC_PATH, NULL);
- if (o2nm_proc == NULL) {
- ret = -ENOMEM; /* shrug */
- goto out_subsys;
- }
-
- ret = mlog_init_proc(o2nm_proc);
- 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)
+ ret = o2cb_sys_init();
+ if (!ret)
goto out;
-out_mlog:
- mlog_remove_proc(o2nm_proc);
-out_remove:
- remove_proc_entry(O2NM_PROC_PATH, NULL);
-out_subsys:
configfs_unregister_subsystem(&o2nm_cluster_group.cs_subsys);
out_callbacks:
o2net_unregister_hb_callbacks();
Added: branches/locking-changes/fs/ocfs2/cluster/sys.c
===================================================================
--- branches/locking-changes/fs/ocfs2/cluster/sys.c 2005-10-04 22:49:12 UTC (rev 2635)
+++ branches/locking-changes/fs/ocfs2/cluster/sys.c 2005-10-04 23:11:58 UTC (rev 2636)
@@ -0,0 +1,123 @@
+/* -*- mode: c; c-basic-offset: 8; -*-
+ * vim: noexpandtab sw=8 ts=8 sts=0:
+ *
+ * sys.c
+ *
+ * OCFS2 cluster sysfs interface
+ *
+ * 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,
+ * version 2 of the License.
+ *
+ * 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/kernel.h>
+#include <linux/module.h>
+#include <linux/kobject.h>
+#include <linux/sysfs.h>
+
+#include "ocfs2_nodemanager.h"
+#include "masklog.h"
+
+struct o2cb_attribute {
+ struct attribute attr;
+ ssize_t (*show)(char *buf);
+ ssize_t (*store)(const char *buf, size_t count);
+};
+
+#define O2CB_ATTR(_name, _mode, _show, _store) \
+struct o2cb_attribute o2cb_attr_##_name = __ATTR(_name, _mode, _show, _store)
+
+#define to_o2cb_subsys(k) container_of(to_kset(k), struct subsystem, kset)
+#define to_o2cb_attr(_attr) container_of(_attr, struct o2cb_attribute, attr)
+
+static ssize_t o2cb_interface_revision_show(char *buf)
+{
+ return snprintf(buf, PAGE_SIZE, "%u\n", O2NM_API_VERSION);
+}
+
+O2CB_ATTR(interface_revision, S_IFREG | S_IRUGO, o2cb_interface_revision_show, NULL);
+
+static struct attribute *o2cb_attrs[] = {
+ &o2cb_attr_interface_revision.attr,
+ NULL,
+};
+
+static ssize_t
+o2cb_show(struct kobject * kobj, struct attribute * attr, char * buffer);
+static ssize_t
+o2cb_store(struct kobject * kobj, struct attribute * attr,
+ const char * buffer, size_t count);
+static struct sysfs_ops o2cb_sysfs_ops = {
+ .show = o2cb_show,
+ .store = o2cb_store,
+};
+
+struct kobj_type o2cb_subsys_type = {
+ .default_attrs = o2cb_attrs,
+ .sysfs_ops = &o2cb_sysfs_ops,
+};
+
+/* gives us o2cb_subsys */
+decl_subsys(o2cb, NULL, NULL);
+
+static ssize_t
+o2cb_show(struct kobject * kobj, struct attribute * attr, char * buffer)
+{
+ struct o2cb_attribute *o2cb_attr = to_o2cb_attr(attr);
+ struct subsystem *sbs = to_o2cb_subsys(kobj);
+
+ BUG_ON(sbs != &o2cb_subsys);
+
+ if (o2cb_attr->show)
+ return o2cb_attr->show(buffer);
+ return -EIO;
+}
+
+static ssize_t
+o2cb_store(struct kobject * kobj, struct attribute * attr,
+ const char * buffer, size_t count)
+{
+ struct o2cb_attribute *o2cb_attr = to_o2cb_attr(attr);
+ struct subsystem *sbs = to_o2cb_subsys(kobj);
+
+ BUG_ON(sbs != &o2cb_subsys);
+
+ if (o2cb_attr->store)
+ return o2cb_attr->store(buffer, count);
+ return -EIO;
+}
+
+void o2cb_sys_shutdown(void)
+{
+ mlog_sys_shutdown();
+ subsystem_unregister(&o2cb_subsys);
+}
+
+int o2cb_sys_init(void)
+{
+ int ret;
+
+ o2cb_subsys.kset.kobj.ktype = &o2cb_subsys_type;
+ ret = subsystem_register(&o2cb_subsys);
+ if (ret)
+ return ret;
+
+ ret = mlog_sys_init(&o2cb_subsys);
+ if (ret)
+ subsystem_unregister(&o2cb_subsys);
+ return ret;
+}
Added: branches/locking-changes/fs/ocfs2/cluster/sys.h
===================================================================
--- branches/locking-changes/fs/ocfs2/cluster/sys.h 2005-10-04 22:49:12 UTC (rev 2635)
+++ branches/locking-changes/fs/ocfs2/cluster/sys.h 2005-10-04 23:11:58 UTC (rev 2636)
@@ -0,0 +1,33 @@
+/* -*- mode: c; c-basic-offset: 8; -*-
+ * vim: noexpandtab sw=8 ts=8 sts=0:
+ *
+ * sys.h
+ *
+ * Function prototypes for o2cb sysfs interface
+ *
+ * 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,
+ * version 2 of the License.
+ *
+ * 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.
+ *
+ */
+
+#ifndef O2CLUSTER_SYS_H
+#define O2CLUSTER_SYS_H
+
+void o2cb_sys_shutdown(void);
+int o2cb_sys_init(void);
+
+#endif /* O2CLUSTER_SYS_H */
Modified: branches/locking-changes/fs/ocfs2/cluster/tcp.c
===================================================================
--- branches/locking-changes/fs/ocfs2/cluster/tcp.c 2005-10-04 22:49:12 UTC (rev 2635)
+++ branches/locking-changes/fs/ocfs2/cluster/tcp.c 2005-10-04 23:11:58 UTC (rev 2636)
@@ -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: branches/locking-changes/fs/ocfs2/cluster/tcp.h
===================================================================
--- branches/locking-changes/fs/ocfs2/cluster/tcp.h 2005-10-04 22:49:12 UTC (rev 2635)
+++ branches/locking-changes/fs/ocfs2/cluster/tcp.h 2005-10-04 23:11:58 UTC (rev 2636)
@@ -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: branches/locking-changes/fs/ocfs2/cluster/tcp_internal.h
===================================================================
--- branches/locking-changes/fs/ocfs2/cluster/tcp_internal.h 2005-10-04 22:49:12 UTC (rev 2635)
+++ branches/locking-changes/fs/ocfs2/cluster/tcp_internal.h 2005-10-04 23:11:58 UTC (rev 2636)
@@ -136,8 +136,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;
@@ -175,20 +173,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 */
Modified: branches/locking-changes/fs/ocfs2/dlm/dlmdebug.c
===================================================================
--- branches/locking-changes/fs/ocfs2/dlm/dlmdebug.c 2005-10-04 22:49:12 UTC (rev 2635)
+++ branches/locking-changes/fs/ocfs2/dlm/dlmdebug.c 2005-10-04 23:11:58 UTC (rev 2636)
@@ -30,7 +30,6 @@
#include <linux/utsname.h>
#include <linux/sysctl.h>
#include <linux/spinlock.h>
-#include <linux/proc_fs.h>
#include "cluster/heartbeat.h"
#include "cluster/nodemanager.h"
@@ -46,176 +45,6 @@
#define MLOG_MASK_PREFIX ML_DLM
#include "cluster/masklog.h"
-static int dlm_dump_all_lock_resources(const char __user *data,
- unsigned int len);
-static void dlm_dump_purge_list(struct dlm_ctxt *dlm);
-static int dlm_dump_all_purge_lists(const char __user *data, unsigned int len);
-static int dlm_trigger_migration(const char __user *data, unsigned int len);
-static int dlm_dump_one_lock_resource(const char __user *data,
- unsigned int len);
-
-static int dlm_parse_domain_and_lockres(char *buf, unsigned int len,
- struct dlm_ctxt **dlm,
- struct dlm_lock_resource **res);
-
-typedef int (dlm_debug_func_t)(const char __user *data, unsigned int len);
-
-struct dlm_debug_funcs
-{
- char key;
- dlm_debug_func_t *func;
-};
-
-static struct dlm_debug_funcs dlm_debug_map[] = {
- { 'r', dlm_dump_all_lock_resources },
- { 'R', dlm_dump_one_lock_resource },
- { 'm', dlm_dump_all_mles },
- { 'p', dlm_dump_all_purge_lists },
- { 'M', dlm_trigger_migration },
-};
-static int dlm_debug_map_sz = (sizeof(dlm_debug_map) /
- sizeof(struct dlm_debug_funcs));
-
-static ssize_t write_dlm_debug(struct file *file, const char __user *buf,
- size_t count, loff_t *ppos)
-{
- int i;
- char c;
- dlm_debug_func_t *fn;
- int ret;
-
- mlog(0, "(%p, %p, %u, %lld)\n",
- file, buf, (unsigned int)count, (long long)*ppos);
- ret = 0;
- if (count<=0)
- goto done;
-
- ret = -EFAULT;
- if (get_user(c, buf))
- goto done;
-
- ret = count;
- for (i=0; i < dlm_debug_map_sz; i++) {
- struct dlm_debug_funcs *d = &dlm_debug_map[i];
- if (c == d->key) {
- fn = d->func;
- if (fn)
- ret = (fn)(buf, count);
- goto done;
- }
- }
-done:
- return ret;
-}
-
-static struct file_operations dlm_debug_operations = {
- .write = write_dlm_debug,
-};
-
-#define OCFS2_DLM_PROC_PATH "fs/ocfs2_dlm"
-#define DLM_DEBUG_PROC_NAME "debug"
-static struct proc_dir_entry *ocfs2_dlm_proc;
-
-void dlm_remove_proc(void)
-{
- if (ocfs2_dlm_proc) {
- remove_proc_entry(DLM_DEBUG_PROC_NAME, ocfs2_dlm_proc);
- remove_proc_entry(OCFS2_DLM_PROC_PATH, NULL);
- }
-}
-
-void dlm_init_proc(void)
-{
- struct proc_dir_entry *entry;
-
- ocfs2_dlm_proc = proc_mkdir(OCFS2_DLM_PROC_PATH, NULL);
- if (!ocfs2_dlm_proc) {
- mlog_errno(-ENOMEM);
- return;
- }
-
- entry = create_proc_entry(DLM_DEBUG_PROC_NAME, S_IWUSR,
- ocfs2_dlm_proc);
- if (entry)
- entry->proc_fops = &dlm_debug_operations;
-}
-
-/* lock resource printing is usually very important (printed
- * right before a BUG in some cases), but we'd like to be
- * able to shut it off if needed, hence the KERN_NOTICE level */
-static int dlm_dump_all_lock_resources(const char __user *data,
- unsigned int len)
-{
- struct dlm_ctxt *dlm;
- struct list_head *iter;
-
- mlog(ML_NOTICE, "dumping ALL dlm state for node %s\n",
- system_utsname.nodename);
- spin_lock(&dlm_domain_lock);
- list_for_each(iter, &dlm_domains) {
- dlm = list_entry (iter, struct dlm_ctxt, list);
- dlm_dump_lock_resources(dlm);
- }
- spin_unlock(&dlm_domain_lock);
- return len;
-}
-
-static int dlm_dump_one_lock_resource(const char __user *data,
- unsigned int len)
-{
- struct dlm_ctxt *dlm;
- struct dlm_lock_resource *res;
- char *buf = NULL;
- int ret = -EINVAL;
- int tmpret;
-
- if (len >= PAGE_SIZE-1) {
- mlog(ML_ERROR, "user passed too much data: %d bytes\n", len);
- goto leave;
- }
- if (len < 5) {
- mlog(ML_ERROR, "user passed too little data: %d bytes\n", len);
- goto leave;
- }
- buf = kmalloc(len+1, GFP_KERNEL);
- if (!buf) {
- mlog(ML_ERROR, "could not alloc %d bytes\n", len+1);
- ret = -ENOMEM;
- goto leave;
- }
- if (strncpy_from_user(buf, data, len) < len) {
- mlog(ML_ERROR, "failed to get all user data. done.\n");
- goto leave;
- }
- buf[len]='\0';
- mlog(0, "got this data from user: %s\n", buf);
-
- if (*buf != 'R') {
- mlog(0, "bad data\n");
- goto leave;
- }
-
- tmpret = dlm_parse_domain_and_lockres(buf, len, &dlm, &res);
- if (tmpret < 0) {
- mlog(0, "bad data\n");
- goto leave;
- }
-
- mlog(ML_NOTICE, "struct dlm_ctxt: %s, node=%u, key=%u\n",
- dlm->name, dlm->node_num, dlm->key);
-
- dlm_print_one_lock_resource(res);
- dlm_lockres_put(res);
- dlm_put(dlm);
- ret = len;
-
-leave:
- if (buf)
- kfree(buf);
- return ret;
-}
-
-
void dlm_print_one_lock_resource(struct dlm_lock_resource *res)
{
mlog(ML_NOTICE, "lockres: %.*s, owner=%u, state=%u\n",
@@ -279,7 +108,6 @@
}
}
-
void dlm_print_one_lock(struct dlm_lock *lockid)
{
dlm_print_one_lock_resource(lockid->lockres);
@@ -311,165 +139,6 @@
spin_unlock(&dlm->spinlock);
}
-static void dlm_dump_purge_list(struct dlm_ctxt *dlm)
-{
- struct list_head *iter;
- struct dlm_lock_resource *lockres;
-
- mlog(ML_NOTICE, "Purge list for DLM Domain \"%s\"\n", dlm->name);
- mlog(ML_NOTICE, "Last_used\tName\n");
-
- spin_lock(&dlm->spinlock);
- list_for_each(iter, &dlm->purge_list) {
- lockres = list_entry(iter, struct dlm_lock_resource, purge);
-
- spin_lock(&lockres->spinlock);
- mlog(ML_NOTICE, "%lu\t%.*s\n", lockres->last_used,
- lockres->lockname.len, lockres->lockname.name);
- spin_unlock(&lockres->spinlock);
- }
- spin_unlock(&dlm->spinlock);
-}
-
-static int dlm_dump_all_purge_lists(const char __user *data, unsigned int len)
-{
- struct dlm_ctxt *dlm;
- struct list_head *iter;
-
- spin_lock(&dlm_domain_lock);
- list_for_each(iter, &dlm_domains) {
- dlm = list_entry (iter, struct dlm_ctxt, list);
- dlm_dump_purge_list(dlm);
- }
- spin_unlock(&dlm_domain_lock);
- return len;
-}
-
-static int dlm_parse_domain_and_lockres(char *buf, unsigned int len,
- struct dlm_ctxt **dlm,
- struct dlm_lock_resource **res)
-{
- char *resname;
- char *domainname;
- char *tmp;
- int ret = -EINVAL;
-
- *dlm = NULL;
- *res = NULL;
-
- tmp = buf;
- tmp++;
- if (*tmp != ' ') {
- mlog(0, "bad data\n");
- goto leave;
- }
- tmp++;
- domainname = tmp;
-
- while (*tmp) {
- if (*tmp == ' ')
- break;
- tmp++;
- }
- if (!*tmp || !*(tmp+1)) {
- mlog(0, "bad data\n");
- goto leave;
- }
-
- *tmp = '\0'; // null term the domainname
- tmp++;
- resname = tmp;
- while (*tmp) {
- if (*tmp == '\n' ||
- *tmp == ' ' ||
- *tmp == '\r') {
- *tmp = '\0';
- break;
- }
- tmp++;
- }
-
- mlog(0, "now looking up domain %s, lockres %s\n",
- domainname, resname);
- spin_lock(&dlm_domain_lock);
- *dlm = __dlm_lookup_domain(domainname);
- spin_unlock(&dlm_domain_lock);
-
- if (!dlm_grab(*dlm)) {
- mlog(ML_ERROR, "bad dlm!\n");
- *dlm = NULL;
- goto leave;
- }
-
- *res = dlm_lookup_lockres(*dlm, resname, strlen(resname));
- if (!*res) {
- mlog(ML_ERROR, "bad lockres!\n");
- dlm_put(*dlm);
- *dlm = NULL;
- goto leave;
- }
-
- mlog(0, "found dlm=%p, lockres=%p\n", *dlm, *res);
- ret = 0;
-
-leave:
- return ret;
-}
-
-static int dlm_trigger_migration(const char __user *data, unsigned int len)
-{
- struct dlm_lock_resource *res;
- struct dlm_ctxt *dlm;
- char *buf = NULL;
- int ret = -EINVAL;
- int tmpret;
-
- if (len >= PAGE_SIZE-1) {
- mlog(ML_ERROR, "user passed too much data: %d bytes\n", len);
- goto leave;
- }
- if (len < 5) {
- mlog(ML_ERROR, "user passed too little data: %d bytes\n", len);
- goto leave;
- }
- buf = kmalloc(len+1, GFP_KERNEL);
- if (!buf) {
- mlog(ML_ERROR, "could not alloc %d bytes\n", len+1);
- ret = -ENOMEM;
- goto leave;
- }
- if (strncpy_from_user(buf, data, len) < len) {
- mlog(ML_ERROR, "failed to get all user data. done.\n");
- goto leave;
- }
- buf[len]='\0';
- mlog(0, "got this data from user: %s\n", buf);
-
- if (*buf != 'M') {
- mlog(0, "bad data\n");
- goto leave;
- }
-
- tmpret = dlm_parse_domain_and_lockres(buf, len, &dlm, &res);
- if (tmpret < 0) {
- mlog(0, "bad data\n");
- goto leave;
- }
- tmpret = dlm_migrate_lockres(dlm, res, O2NM_MAX_NODES);
- mlog(0, "dlm_migrate_lockres returned %d\n", tmpret);
- if (tmpret < 0)
- mlog(ML_ERROR, "failed to migrate %.*s: %d\n",
- res->lockname.len, res->lockname.name, tmpret);
- dlm_lockres_put(res);
- dlm_put(dlm);
- ret = len;
-
-leave:
- if (buf)
- kfree(buf);
- return ret;
-}
-
static const char *dlm_errnames[] = {
[DLM_NORMAL] = "DLM_NORMAL",
[DLM_GRANTED] = "DLM_GRANTED",
@@ -560,7 +229,6 @@
[DLM_MAXSTATS] = "invalid error number",
};
-
const char *dlm_errmsg(enum dlm_status err)
{
if (err >= DLM_MAXSTATS || err < 0)
@@ -576,4 +244,3 @@
return dlm_errnames[err];
}
EXPORT_SYMBOL_GPL(dlm_errname);
-
Modified: branches/locking-changes/fs/ocfs2/dlm/dlmdebug.h
===================================================================
--- branches/locking-changes/fs/ocfs2/dlm/dlmdebug.h 2005-10-04 22:49:12 UTC (rev 2635)
+++ branches/locking-changes/fs/ocfs2/dlm/dlmdebug.h 2005-10-04 23:11:58 UTC (rev 2636)
@@ -25,8 +25,6 @@
#ifndef DLMDEBUG_H
#define DLMDEBUG_H
-void dlm_remove_proc(void);
-void dlm_init_proc(void);
void dlm_dump_lock_resources(struct dlm_ctxt *dlm);
#endif
Modified: branches/locking-changes/fs/ocfs2/dlm/dlmdomain.c
===================================================================
--- branches/locking-changes/fs/ocfs2/dlm/dlmdomain.c 2005-10-04 22:49:12 UTC (rev 2635)
+++ branches/locking-changes/fs/ocfs2/dlm/dlmdomain.c 2005-10-04 23:11:58 UTC (rev 2636)
@@ -1456,14 +1456,11 @@
return -1;
}
- dlm_init_proc();
-
return 0;
}
static void __exit dlm_exit (void)
{
- dlm_remove_proc();
dlm_unregister_net_handlers();
dlm_destroy_mle_cache();
}
Deleted: branches/locking-changes/fs/ocfs2/proc.c
===================================================================
--- branches/locking-changes/fs/ocfs2/proc.c 2005-10-04 22:49:12 UTC (rev 2635)
+++ branches/locking-changes/fs/ocfs2/proc.c 2005-10-04 23:11:58 UTC (rev 2636)
@@ -1,461 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * proc.c
- *
- * proc interface
- *
- * Copyright (C) 2002, 2004 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/fs.h>
-#include <linux/types.h>
-#include <linux/slab.h>
-#include <linux/proc_fs.h>
-#include <linux/socket.h>
-
-#define MLOG_MASK_PREFIX ML_SUPER
-#include <cluster/masklog.h>
-
-#include "ocfs2.h"
-
-#include "proc.h"
-#include "alloc.h"
-#include "heartbeat.h"
-#include "inode.h"
-#include "journal.h"
-#include "ver.h"
-
-#define OCFS2_PROC_BASENAME "fs/ocfs2"
-
-static struct proc_dir_entry *ocfs2_proc_root_dir = NULL; /* points to /proc/fs/ocfs2 */
-
-static int ocfs2_proc_version(char *page,
- char **start,
- off_t off,
- int count,
- int *eof,
- void *data);
-static int ocfs2_proc_nodenum(char *page,
- char **start,
- off_t off,
- int count,
- int *eof,
- void *data);
-static int ocfs2_proc_slotnum(char *page,
- char **start,
- off_t off,
- int count,
- int *eof,
- void *data);
-static int ocfs2_proc_nodename(char *page,
- char **start,
- off_t off,
- int count,
- int *eof,
- void *data);
-static int ocfs2_proc_uuid(char *page,
- char **start,
- off_t off,
- int count,
- int *eof,
- void *data);
-static int ocfs2_proc_statistics(char *page,
- char **start,
- off_t off,
- int count,
- int *eof,
- void *data);
-static int ocfs2_proc_device(char *page,
- char **start,
- off_t off,
- int count,
- int *eof,
- void *data);
-static int ocfs2_proc_nodes(char *page,
- char **start,
- off_t off,
- int count,
- int *eof,
- void *data);
-static int ocfs2_proc_alloc_stat(char *page,
- char **start,
- off_t off,
- int count,
- int *eof,
- void *data);
-static int ocfs2_proc_label(char *page,
- char **start,
- off_t off,
- int count,
- int *eof,
- void *data);
-
-typedef struct _ocfs2_proc_list
-{
- char *name;
- char *data;
- int (*read_proc) (char *, char **, off_t, int, int *, void *);
- write_proc_t *write_proc;
- mode_t mode;
-} ocfs2_proc_list;
-
-static ocfs2_proc_list top_dir[] = {
- { "version", NULL, ocfs2_proc_version, NULL, S_IFREG | S_IRUGO, },
- { "nodename", NULL, ocfs2_proc_nodename, NULL, S_IFREG | S_IRUGO, },
- { NULL }
-};
-
-static ocfs2_proc_list sub_dir[] = {
- { "nodenum", NULL, ocfs2_proc_nodenum, NULL, S_IFREG | S_IRUGO, },
- { "uuid", NULL, ocfs2_proc_uuid, NULL, S_IFREG | S_IRUGO, },
- { "slotnum", NULL, ocfs2_proc_slotnum, NULL, S_IFREG | S_IRUGO, },
- { "statistics", NULL, ocfs2_proc_statistics, NULL, S_IFREG | S_IRUGO, },
- { "device", NULL, ocfs2_proc_device, NULL, S_IFREG | S_IRUGO, },
- { "nodes", NULL, ocfs2_proc_nodes, NULL, S_IFREG | S_IRUGO, },
- { "allocstat", NULL, ocfs2_proc_alloc_stat, NULL, S_IFREG | S_IRUGO, },
- { "label", NULL, ocfs2_proc_label, NULL, S_IFREG | S_IRUGO, },
- { NULL }
-};
-
-int ocfs2_proc_init(void)
-{
- struct proc_dir_entry *parent = NULL;
- ocfs2_proc_list *p;
- struct proc_dir_entry* entry;
-
- mlog_entry_void();
-
- parent = proc_mkdir(OCFS2_PROC_BASENAME, NULL);
- if (parent) {
- ocfs2_proc_root_dir = parent;
- for (p = top_dir; p->name; p++) {
- entry = create_proc_read_entry(p->name, p->mode,
- parent, p->read_proc,
- p->data);
- if (!entry)
- return -EINVAL;
- if (p->write_proc)
- entry->write_proc = p->write_proc;
-
- entry->owner = THIS_MODULE;
- }
- }
-
- mlog_exit_void();
- return 0;
-}
-
-void ocfs2_proc_deinit(void)
-{
- struct proc_dir_entry *parent = ocfs2_proc_root_dir;
- ocfs2_proc_list *p;
-
- mlog_entry_void();
-
- if (parent) {
- for (p = top_dir; p->name; p++)
- remove_proc_entry(p->name, parent);
- remove_proc_entry(OCFS2_PROC_BASENAME, NULL);
- }
-
- mlog_exit_void();
-}
-
-static int ocfs2_proc_calc_metrics(char *page, char **start, off_t off,
- int count, int *eof, int len)
-{
- mlog_entry_void();
-
- if (len <= off + count)
- *eof = 1;
-
- *start = page + off;
-
- len -= off;
-
- if (len > count)
- len = count;
-
- if (len < 0)
- len = 0;
-
- mlog_exit_void();
- return len;
-}
-
-static int ocfs2_proc_alloc_stat(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- int len, ret;
- char *la_state;
- ocfs2_super *osb = data;
-
- mlog_entry_void();
-
-#define ALLOC_STATS_HDR "%-25s %10u\n"
-
- len = sprintf(page, "%s\n", "*** Disk Allocation Stats ***");
-
- if (osb->local_alloc_state == OCFS2_LA_ENABLED)
- la_state = "enabled";
- else if (osb->local_alloc_state == OCFS2_LA_DISABLED)
- la_state = "disabled";
- else
- la_state = "unused";
-
- len += sprintf(page + len, "%-25s %10s\n", "Local Alloc", la_state);
- len += sprintf(page + len, ALLOC_STATS_HDR, "Window Moves",
- atomic_read(&osb->alloc_stats.moves));
- len += sprintf(page + len, ALLOC_STATS_HDR, "Local Allocs",
- atomic_read(&osb->alloc_stats.local_data));
- len += sprintf(page + len, ALLOC_STATS_HDR, "Bitmap Allocs",
- atomic_read(&osb->alloc_stats.bitmap_data));
- len += sprintf(page + len, ALLOC_STATS_HDR, "Block Group Allocs",
- atomic_read(&osb->alloc_stats.bg_allocs));
- len += sprintf(page + len, ALLOC_STATS_HDR, "Block Group Adds",
- atomic_read(&osb->alloc_stats.bg_extends));
-
- ret = ocfs2_proc_calc_metrics(page, start, off, count, eof, len);
-
- mlog_exit(ret);
-
- return ret;
-}
-
-static int ocfs2_proc_version(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- int len;
- int ret;
-
- mlog_entry_void();
-
- len = ocfs2_str_version(page);
- ret = ocfs2_proc_calc_metrics(page, start, off, count, eof, len);
-
- mlog_exit(ret);
- return ret;
-}
-
-static int ocfs2_proc_nodenum(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- int len;
- int ret;
- ocfs2_super *osb = data;
-
- mlog_entry_void();
-
- len = sprintf(page, "%d\n", osb->node_num);
- ret = ocfs2_proc_calc_metrics(page, start, off, count, eof, len);
-
- mlog_exit(ret);
- return ret;
-}
-
-static int ocfs2_proc_slotnum(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- int len;
- int ret;
- ocfs2_super *osb = data;
-
- mlog_entry_void();
-
- len = sprintf(page, "%d\n", osb->slot_num);
- ret = ocfs2_proc_calc_metrics(page, start, off, count, eof, len);
-
- mlog_exit(ret);
- return ret;
-}
-
-static int ocfs2_proc_nodename(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- int len;
- int ret;
- struct o2nm_node *node;
-
- mlog_entry_void();
-
- node = o2nm_get_node_by_num(o2nm_this_node());
-
- if (node) {
- len = sprintf(page, "%s\n", node->nd_name);
- o2nm_node_put(node);
- } else
- len = sprintf(page, "(unknown)\n");
-
- ret = ocfs2_proc_calc_metrics(page, start, off, count, eof, len);
-
- mlog_exit(ret);
- return ret;
-}
-
-void ocfs2_proc_add_volume(ocfs2_super * osb)
-{
- char newdir[20];
- struct proc_dir_entry *parent = NULL;
- struct proc_dir_entry* entry;
- ocfs2_proc_list *p;
-
- mlog_entry_void();
-
- snprintf(newdir, sizeof(newdir), "%u_%u",
- MAJOR(osb->sb->s_dev), MINOR(osb->sb->s_dev));
- parent = proc_mkdir(newdir, ocfs2_proc_root_dir);
- osb->proc_sub_dir = parent;
-
- if (!parent) {
- mlog_exit_void();
- return;
- }
-
- for (p = sub_dir; p->name; p++) {
- /* XXX: What do we do if
- * create_proc_read_entry fails?! */
- entry = create_proc_read_entry(p->name, p->mode,
- parent, p->read_proc,
- (char *)osb);
- if (entry) {
- if (p->write_proc)
- entry->write_proc = p->write_proc;
-
- entry->owner = THIS_MODULE;
- }
- }
-
- mlog_exit_void();
-}
-
-void ocfs2_proc_remove_volume(ocfs2_super * osb)
-{
- ocfs2_proc_list *p;
- char dir[20];
-
- mlog_entry_void();
-
- if (osb->proc_sub_dir) {
- for (p = sub_dir; p->name; p++)
- remove_proc_entry(p->name, osb->proc_sub_dir);
-
- snprintf(dir, sizeof(dir), "%u_%u",
- MAJOR(osb->sb->s_dev), MINOR(osb->sb->s_dev));
- remove_proc_entry(dir, ocfs2_proc_root_dir);
- }
-
- mlog_exit_void();
-}
-
-static int ocfs2_proc_uuid(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- int len, ret;
- ocfs2_super *osb = data;
-
- mlog_entry_void();
-
- len = sprintf(page, "%s\n", osb->uuid_str);
- ret = ocfs2_proc_calc_metrics(page, start, off, count, eof, len);
-
- mlog_exit(ret);
- return ret;
-}
-
-static int ocfs2_proc_statistics(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- int len;
- int ret = 0;
- ocfs2_super *osb = data;
-
- mlog_entry_void();
-
-#define PROC_STATS \
- "Number of nodes : %u\n" \
- "Cluster size : %d\n" \
- "Volume size : %"MLFu64"\n" \
- "Open Transactions: : %u\n"
-
- len = sprintf(page, PROC_STATS, osb->num_nodes, osb->s_clustersize,
- ocfs2_clusters_to_bytes(osb->sb, osb->num_clusters),
- atomic_read(&osb->journal->j_num_trans));
-
- ret = ocfs2_proc_calc_metrics(page, start, off, count, eof, len);
-
- mlog_exit(ret);
- return ret;
-}
-
-static int ocfs2_proc_device(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- int len;
- int ret;
- ocfs2_super *osb = data;
-
- mlog_entry_void();
-
- len = snprintf(page, sizeof(osb->dev_str), "%s\n", osb->dev_str);
- ret = ocfs2_proc_calc_metrics(page, start, off, count, eof, len);
-
- mlog_exit(ret);
- return ret;
-}
-
-static int ocfs2_proc_nodes(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- int len = 0;
- int i;
- int ret;
- ocfs2_super *osb = data;
- char mount;
-
- mlog_entry_void();
-
- if (osb) {
- for (i = 0; i < OCFS2_NODE_MAP_MAX_NODES; i++) {
- mount = ocfs2_node_map_test_bit(osb, &osb->mounted_map, i) ? 'M' : ' ';
- len += sprintf(page + len, "%2d %c\n", i, mount);
- }
- }
-
- ret = ocfs2_proc_calc_metrics(page, start, off, count, eof, len);
-
- mlog_exit(ret);
- return ret;
-}
-
-static int ocfs2_proc_label(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- int len;
- int ret;
- ocfs2_super *osb = data;
-
- mlog_entry_void();
-
- len = sprintf(page, "%s\n", osb->vol_label);
- ret = ocfs2_proc_calc_metrics(page, start, off, count, eof, len);
-
- mlog_exit(ret);
- return ret;
-}
-
Deleted: branches/locking-changes/fs/ocfs2/proc.h
===================================================================
--- branches/locking-changes/fs/ocfs2/proc.h 2005-10-04 22:49:12 UTC (rev 2635)
+++ branches/locking-changes/fs/ocfs2/proc.h 2005-10-04 23:11:58 UTC (rev 2636)
@@ -1,34 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * proc.h
- *
- * Function prototypes
- *
- * Copyright (C) 2002, 2004 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.
- */
-
-#ifndef OCFS2_PROC_H
-#define OCFS2_PROC_H
-
-void ocfs2_proc_add_volume(ocfs2_super *osb);
-void ocfs2_proc_deinit(void);
-int ocfs2_proc_init(void);
-void ocfs2_proc_remove_volume(ocfs2_super *osb);
-
-#endif /* OCFS2_PROC_H */
Modified: branches/locking-changes/fs/ocfs2/super.c
===================================================================
--- branches/locking-changes/fs/ocfs2/super.c 2005-10-04 22:49:12 UTC (rev 2635)
+++ branches/locking-changes/fs/ocfs2/super.c 2005-10-04 23:11:58 UTC (rev 2636)
@@ -58,7 +58,6 @@
#include "journal.h"
#include "localalloc.h"
#include "namei.h"
-#include "proc.h"
#include "slot_map.h"
#include "super.h"
#include "sysfile.h"
@@ -818,9 +817,6 @@
osb_id = 0;
spin_unlock(&ocfs2_globals_lock);
- /* Initialize the proc interface */
- ocfs2_proc_init();
-
leave:
if (status < 0) {
ocfs2_free_mem_caches();
@@ -847,9 +843,6 @@
ocfs2_free_mem_caches();
- /* Deinit the proc interface */
- ocfs2_proc_deinit();
-
unregister_filesystem(&ocfs2_fs_type);
exit_ocfs2_extent_maps();
@@ -1050,7 +1043,7 @@
mlog_entry_void();
if (ocfs2_is_hard_readonly(osb))
- goto out_add_proc;
+ goto leave;
status = ocfs2_fill_local_node_info(osb);
if (status < 0) {
@@ -1121,10 +1114,6 @@
if (status < 0)
mlog_errno(status);
-out_add_proc:
- /* Add proc entry for this volume */
- ocfs2_proc_add_volume(osb);
-
leave:
if (unlock_super)
ocfs2_super_unlock(osb, 1);
@@ -1173,9 +1162,6 @@
ocfs2_sync_blockdev(sb);
- /* Remove the proc element for this volume */
- ocfs2_proc_remove_volume(osb);
-
/* No dlm means we've failed during mount, so skip all the
* steps which depended on that to complete. */
if (osb->dlm) {
More information about the Ocfs2-commits
mailing list