[Ocfs2-commits] zab commits r2005 -
branches/usysfsify/fs/ocfs2/cluster
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Thu Mar 17 22:25:46 CST 2005
Author: zab
Date: 2005-03-17 22:25:45 -0600 (Thu, 17 Mar 2005)
New Revision: 2005
Removed:
branches/usysfsify/fs/ocfs2/cluster/gsd.c
branches/usysfsify/fs/ocfs2/cluster/gsd.h
branches/usysfsify/fs/ocfs2/cluster/ocfs2_tcp.h
Modified:
branches/usysfsify/fs/ocfs2/cluster/Makefile
branches/usysfsify/fs/ocfs2/cluster/tcp.c
branches/usysfsify/fs/ocfs2/cluster/tcp.h
Log:
o remove unused gsd stuff
Modified: branches/usysfsify/fs/ocfs2/cluster/Makefile
===================================================================
--- branches/usysfsify/fs/ocfs2/cluster/Makefile 2005-03-18 02:27:52 UTC (rev 2004)
+++ branches/usysfsify/fs/ocfs2/cluster/Makefile 2005-03-18 04:25:45 UTC (rev 2005)
@@ -40,7 +40,6 @@
SOURCES = \
compat_libfs.c \
- gsd.c \
heartbeat.c \
nodemanager.c \
tcp.c \
@@ -49,7 +48,6 @@
HEADERS = \
cl_compat.h \
compat_libfs.h \
- gsd.h \
heartbeat.h \
nodemanager.h \
ocfs2_heartbeat.h \
Deleted: branches/usysfsify/fs/ocfs2/cluster/gsd.c
===================================================================
--- branches/usysfsify/fs/ocfs2/cluster/gsd.c 2005-03-18 02:27:52 UTC (rev 2004)
+++ branches/usysfsify/fs/ocfs2/cluster/gsd.c 2005-03-18 04:25:45 UTC (rev 2005)
@@ -1,244 +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/config.h>
-#include <linux/module.h>
-#include <linux/fs.h>
-#include <linux/sched.h>
-#include <asm/uaccess.h>
-#include <linux/file.h>
-
-#include "cl_compat.h"
-#include "util.h"
-#include "nodemanager.h"
-#include "tcp.h"
-#include "gsd.h"
-
-static char *gsd_handler_buf = NULL;
-/* sigh. these will be claned up, I'm just sure of it. */
-static u8 gsd_node_num;
-static struct inode *gsd_inode;
-
-static int gsd_message_action(gsd_message *g)
-{
- int ret;
- nm_op op;
- int namelen = g->namelen;
- struct inode *node=NULL, *group=NULL;
- char name[NM_MAX_NAME_LEN+1];
-
- if (namelen > NM_MAX_NAME_LEN)
- return -EINVAL;
- strncpy(name, g->name, namelen);
- name[namelen] = '\0';
-
- memset(&op, 0, sizeof(op));
- switch (g->action) {
- case GSD_ACTION_ADD_GROUP:
- group = nm_get_group_by_name(name);
- if (group) {
- ret = 0;
- break;
- }
- op.arg_u.gc.group_num = NM_INVALID_SLOT_NUM;
- memcpy(op.arg_u.gc.name, name, namelen);
- memcpy(op.arg_u.gc.disk_uuid, name, namelen);
-
- ret = nm_create_group(gsd_handler_buf, &op);
- if (ret >= 0)
- ret = 0;
- break;
-
- case GSD_ACTION_ADD_GROUP_NODE:
- group = nm_get_group_by_name(name);
- if (!group) {
- ret = -EINVAL;
- break;
- }
- node = nm_get_group_node_by_index(group, g->from);
- if (node) {
- ret = 0;
- if (nm_get_node_global_index(node) != g->from)
- ret = -EINVAL;
- break;
- }
- op.arg_u.gc.group_num = nm_get_group_global_index(group);
- op.arg_u.gc.node_num = g->from;
- op.arg_u.gc.slot_num = g->from;
- ret = nm_add_node_to_group(gsd_handler_buf, &op);
- if (ret >= 0)
- ret = 0;
- break;
- default:
- ret = -EINVAL;
- break;
- }
-
- if (node)
- iput(node);
- if (group)
- iput(group);
- return ret;
-}
-
-static int gsd_message_handler(net_msg *msg, u32 len, void *data)
-{
- gsd_message *g = (gsd_message *)msg->buf;
- gsd_message_to_host(g);
- return gsd_message_action(g);
-}
-
-int gsd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg)
-{
- gsd_ioc gsd_data;
- int ret = 0;
- gsd_message g;
- int response = 0;
- struct inode *to = NULL;
- struct file *file = NULL;
-
- switch (cmd) {
- case GSD_IOC_CREATE_GROUP:
- memset(&gsd_data, 0, sizeof(gsd_ioc));
- ret = copy_from_user(&gsd_data, (gsd_ioc *)arg,
- sizeof(gsd_ioc));
-
- file = fget(gsd_data.fd);
- if (!file || !file->f_dentry || !file->f_dentry->d_inode) {
- ret = -EINVAL;
- break;
- }
- to = file->f_dentry->d_inode;
-
- g.action = GSD_ACTION_ADD_GROUP;
- g.from = gsd_node_num;
- g.namelen = gsd_data.namelen;
- memcpy(g.name, gsd_data.name, gsd_data.namelen);
-
- if (to == gsd_inode) {
- /* create the group locally */
- ret = gsd_message_action(&g);
- } else {
- /* create the group on remote node */
- gsd_message_to_net(&g);
- ret = net_send_message(GSD_MESSAGE, 0, &g,
- sizeof(g), to, &response);
- if (ret == 0)
- ret = response;
- }
-
- memset(&gsd_data, 0, sizeof(gsd_ioc));
- gsd_data.status = ret;
- ret = copy_to_user((gsd_ioc *)arg, &gsd_data,
- sizeof(gsd_ioc));
- break;
-
- case GSD_IOC_ADD_GROUP_NODE:
- memset(&gsd_data, 0, sizeof(gsd_ioc));
- ret = copy_from_user(&gsd_data, (gsd_ioc *)arg,
- sizeof(gsd_ioc));
-
- file = fget(gsd_data.fd);
- if (!file || !file->f_dentry || !file->f_dentry->d_inode) {
- ret = -EINVAL;
- break;
- }
- to = file->f_dentry->d_inode;
-
- g.action = GSD_ACTION_ADD_GROUP_NODE;
- g.from = gsd_node_num;
- g.namelen = gsd_data.namelen;
- memcpy(g.name, gsd_data.name, gsd_data.namelen);
-
- if (to == gsd_inode) {
- /* create the group locally */
- ret = gsd_message_action(&g);
- } else {
- /* create the group on remote node */
- gsd_message_to_net(&g);
- ret = net_send_message(GSD_MESSAGE, 0, &g,
- sizeof(g), to, &response);
- if (ret == 0)
- ret = response;
- }
- memset(&gsd_data, 0, sizeof(gsd_ioc));
- gsd_data.status = ret;
- ret = copy_to_user((gsd_ioc *)arg, &gsd_data,
- sizeof(gsd_ioc));
- break;
- default:
- BUG();
- break;
- }
-
- if (file)
- fput(file);
-
- return ret;
-} /* net_ioctl */
-
-int gsd_setup(void)
-{
- int ret;
-
- gsd_node_num = nm_this_node(NULL);
- if (gsd_node_num >= NM_MAX_NODES) {
- printk("local nm node number not initialized!\n");
- ret = -EINVAL;
- goto out;
- }
-
- gsd_inode = nm_get_node_by_num(gsd_node_num);
- if (!gsd_inode) {
- printk("local nm node inode not initialized!\n");
- return -1;
- }
-
- /* need this stupidity until I can divorce the actual nm actions
- * from the output they send to their user buffer */
- gsd_handler_buf = (char *) __get_free_page(GFP_KERNEL);
- if (!gsd_handler_buf) {
- ret = -ENOMEM;
- goto out;
- }
-
- ret = net_register_handler(GSD_MESSAGE, 0, 0, sizeof(gsd_message),
- gsd_message_handler, NULL);
-out:
- if (ret)
- if (gsd_inode) {
- iput(gsd_inode);
- gsd_inode = NULL;
- }
-
- return ret;
-}
-
-void gsd_teardown(void)
-{
- free_page((unsigned long)gsd_handler_buf);
- if (gsd_inode) {
- iput(gsd_inode);
- gsd_inode = NULL;
- }
-}
-
Deleted: branches/usysfsify/fs/ocfs2/cluster/gsd.h
===================================================================
--- branches/usysfsify/fs/ocfs2/cluster/gsd.h 2005-03-18 02:27:52 UTC (rev 2004)
+++ branches/usysfsify/fs/ocfs2/cluster/gsd.h 2005-03-18 04:25:45 UTC (rev 2005)
@@ -1,31 +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.
- */
-
-#ifndef CLUSTER_GSD_H
-#define CLUSTER_GSD_H
-
-int gsd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
- unsigned long arg);
-
-int gsd_setup(void);
-void gsd_teardown(void);
-
-#endif
Deleted: branches/usysfsify/fs/ocfs2/cluster/ocfs2_tcp.h
===================================================================
--- branches/usysfsify/fs/ocfs2/cluster/ocfs2_tcp.h 2005-03-18 02:27:52 UTC (rev 2004)
+++ branches/usysfsify/fs/ocfs2/cluster/ocfs2_tcp.h 2005-03-18 04:25:45 UTC (rev 2005)
@@ -1,46 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * ocfs2_tcp.h
- *
- * 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_TCP_H
-#define _OCFS2_TCP_H
-
-typedef struct _gsd_ioc
-{
- int fd;
- int namelen;
- char name[NM_MAX_NAME_LEN+1];
- int status;
-} gsd_ioc;
-
-typedef struct _net_ioc
-{
- __u32 status;
-} net_ioc;
-
-#define NET_IOC_MAGIC 'O'
-#define NET_IOC_ACTIVATE _IOR(NET_IOC_MAGIC, 1, net_ioc)
-#define NET_IOC_GETSTATE _IOR(NET_IOC_MAGIC, 2, net_ioc)
-#define GSD_IOC_CREATE_GROUP _IOR(NET_IOC_MAGIC, 3, gsd_ioc)
-#define GSD_IOC_ADD_GROUP_NODE _IOR(NET_IOC_MAGIC, 4, gsd_ioc)
-
-#endif /* _OCFS2_TCP_H */
Modified: branches/usysfsify/fs/ocfs2/cluster/tcp.c
===================================================================
--- branches/usysfsify/fs/ocfs2/cluster/tcp.c 2005-03-18 02:27:52 UTC (rev 2004)
+++ branches/usysfsify/fs/ocfs2/cluster/tcp.c 2005-03-18 04:25:45 UTC (rev 2005)
@@ -106,7 +106,6 @@
#include "util.h"
-#include "gsd.h"
#include "heartbeat.h"
#include "tcp.h"
#include "nodemanager.h"
Modified: branches/usysfsify/fs/ocfs2/cluster/tcp.h
===================================================================
--- branches/usysfsify/fs/ocfs2/cluster/tcp.h 2005-03-18 02:27:52 UTC (rev 2004)
+++ branches/usysfsify/fs/ocfs2/cluster/tcp.h 2005-03-18 04:25:45 UTC (rev 2005)
@@ -45,9 +45,7 @@
* NM_MAX_NAME_LEN...shouldn't that be something or somewhere else?
*/
#include "nodemanager.h"
-#include "ocfs2_tcp.h"
-
enum net_system_error {
NET_ERR_NONE = 0,
NET_ERR_NO_HNDLR,
@@ -203,27 +201,4 @@
int net_start_rx_thread(struct nm_node *node);
void net_stop_rx_thread(struct nm_node *node);
-#define GSD_MESSAGE 130
-#define GSD_ACTION_ADD_GROUP (0x01)
-#define GSD_ACTION_ADD_GROUP_NODE (0x02)
-
-typedef struct _gsd_message
-{
- u8 from;
- u8 action;
- u8 namelen;
- u8 pad1;
- u32 pad2;
- u8 name[NM_MAX_NAME_LEN];
-} gsd_message;
-
-static inline void gsd_message_to_net(gsd_message *g)
-{
- /* do nothing */
-}
-static inline void gsd_message_to_host(gsd_message *g)
-{
- /* do nothing */
-}
-
#endif /* CLUSTER_TCP_H */
More information about the Ocfs2-commits
mailing list