[Ocfs2-commits] khackel commits r1927 -
branches/dlm-reco-mig/fs/ocfs2/dlm
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Tue Mar 1 13:41:25 CST 2005
Author: khackel
Date: 2005-03-01 13:41:23 -0600 (Tue, 01 Mar 2005)
New Revision: 1927
Modified:
branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmaster.c
branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmod.c
branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmod.h
Log:
* remove dead code (master request response)
Modified: branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmaster.c
===================================================================
--- branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmaster.c 2005-03-01 08:24:00 UTC (rev 1926)
+++ branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmaster.c 2005-03-01 19:41:23 UTC (rev 1927)
@@ -62,9 +62,6 @@
char *name, unsigned int namelen);
static int dlm_do_master_request(dlm_master_list_entry *mle, int to);
-static int dlm_do_master_request_resp(dlm_ctxt *dlm, char *name,
- unsigned int namelen,
- int response, int to);
static int dlm_do_assert_master(dlm_master_list_entry *mle);
static dlm_lock_resource *dlm_new_lockres(dlm_ctxt *dlm,
@@ -888,144 +885,7 @@
return response;
}
-
-
/*
- * DLM_MASTER_REQUEST_RESP_MSG
- */
-
-static int dlm_do_master_request_resp(dlm_ctxt *dlm, char *name,
- unsigned int namelen,
- int response, int to)
-{
- struct inode *inode = NULL;
- dlm_master_request_resp resp;
- int ret;
-
- memset(&resp, 0, sizeof(resp));
- resp.node_idx = dlm->group_index;
- resp.response = response;
- resp.namelen = namelen;
- strncpy(resp.name, name, namelen);
-
- ret = -EINVAL;
- inode = nm_get_group_node_by_index(dlm->group, to);
- if (!inode) {
- dlmprintk("nm_get_group_node_by_index failed to find inode "
- "for node %d!\n", to);
- goto leave;
- }
-
- dlm_master_request_resp_to_net(&resp);
- ret = net_send_message(DLM_MASTER_REQUEST_RESP_MSG, dlm->key,
- &resp, sizeof(resp), inode, NULL);
- iput(inode);
- if (ret < 0)
- dlmprintk("net_send_message returned %d!\n", ret);
-leave:
- return ret;
-}
-
-
-
-/* NOTE: when doing node recovery, run the dlm->master_list looking for the
- * dead node in any maybe_map... clear that bit, and if now empty, clear the
- * whole thing */
-
-/*
- * locks that can be taken here:
- * mle->spinlock
- * dlm->master_list
- *
- */
-int dlm_master_request_resp_handler(net_msg *msg, u32 len, void *data)
-{
- dlm_ctxt *dlm = data;
- dlm_master_list_entry *mle = NULL;
- dlm_master_request_resp *resp = (dlm_master_request_resp *) msg->buf;
- int wake = 0;
-
- if (!dlm_grab(dlm))
- return 0;
-
- dlm_master_request_resp_to_host(resp);
-
- if (resp->namelen > DLM_LOCKID_NAME_MAX) {
- printk("Invalid name length in master request response!\n");
- goto done;
- }
-
- spin_lock(&dlm->master_lock);
- if (!dlm_find_mle(dlm, &mle, resp->name, resp->namelen))
- goto leave;
-
- if (mle->type == DLM_MLE_BLOCK) {
- dlmprintk0("eek! cannot get a response for a block!\n");
- goto leave;
- }
-
- wake = 0;
- spin_lock(&mle->spinlock);
- switch (resp->response) {
- case DLM_MASTER_RESP_YES:
- set_bit(resp->node_idx, mle->response_map);
- // dlmprintk("woot! node %u is the master!\n",
- // resp->node_idx);
- mle->master = resp->node_idx;
- wake = 1;
- break;
- case DLM_MASTER_RESP_NO:
- // dlmprintk("node %u is not the master, not "
- // "in-progress\n", resp->node_idx);
- set_bit(resp->node_idx, mle->response_map);
- if (memcmp(mle->response_map, mle->vote_map,
- sizeof(mle->vote_map))==0)
- wake = 1;
- break;
- case DLM_MASTER_RESP_MAYBE:
- //dlmprintk("node %u is not the master, but IS"
- //" in-progress\n", resp->node_idx);
- set_bit(resp->node_idx, mle->response_map);
- set_bit(resp->node_idx, mle->maybe_map);
- if (memcmp(mle->response_map, mle->vote_map,
- sizeof(mle->vote_map))==0)
- wake = 1;
- break;
- case DLM_MASTER_RESP_ERROR:
- dlmprintk("node %u hit an -ENOMEM! try this "
- "whole thing again\n",
- resp->node_idx);
- mle->error = 1;
- wake = 1;
- break;
- default:
- dlmprintk("bad response! %u\n", resp->response);
- break;
- }
- spin_unlock(&mle->spinlock);
-
-leave:
- spin_unlock(&dlm->master_lock);
-
- if (wake) {
- atomic_set(&mle->woken, 1);
- wake_up(&mle->wq);
- }
-
- if (mle) {
- /* keep the mle attached to heartbeat events */
- dlm_put_mle(mle);
- } else
- dlmprintk0("hrrm... got a master resp but found no matching "
- "request\n");
-
-done:
- dlm_put(dlm);
- return 0;
-}
-
-
-/*
* DLM_ASSERT_MASTER_MSG
*/
Modified: branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmod.c
===================================================================
--- branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmod.c 2005-03-01 08:24:00 UTC (rev 1926)
+++ branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmod.c 2005-03-01 19:41:23 UTC (rev 1927)
@@ -718,13 +718,6 @@
if (status)
goto bail;
- status = net_register_handler(DLM_MASTER_REQUEST_RESP_MSG, dlm->key, 0,
- sizeof(dlm_master_request_resp),
- dlm_master_request_resp_handler,
- dlm);
- if (status)
- goto bail;
-
status = net_register_handler(DLM_MASTER_REQUEST_MSG, dlm->key, 0,
sizeof(dlm_master_request),
dlm_master_request_handler,
Modified: branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmod.h
===================================================================
--- branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmod.h 2005-03-01 08:24:00 UTC (rev 1926)
+++ branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmod.h 2005-03-01 19:41:23 UTC (rev 1927)
@@ -356,7 +356,7 @@
#define DLM_MASTER_REQUEST_MSG 500
-#define DLM_MASTER_REQUEST_RESP_MSG 501
+#define DLM_UNUSED_MSG1 501
#define DLM_ASSERT_MASTER_MSG 502
#define DLM_CREATE_LOCK_MSG 503
#define DLM_CONVERT_LOCK_MSG 504
More information about the Ocfs2-commits
mailing list