[Ocfs2-commits] khackel commits r1784 - trunk/cluster
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Mon Jan 17 19:47:50 CST 2005
Author: khackel
Date: 2005-01-17 19:47:49 -0600 (Mon, 17 Jan 2005)
New Revision: 1784
Modified:
trunk/cluster/dlmast.c
trunk/cluster/dlmconvert.c
trunk/cluster/dlmlock.c
trunk/cluster/dlmmaster.c
trunk/cluster/dlmmod.c
trunk/cluster/dlmmod.h
trunk/cluster/dlmthread.c
Log:
* more prettying up
Modified: trunk/cluster/dlmast.c
===================================================================
--- trunk/cluster/dlmast.c 2005-01-18 01:38:52 UTC (rev 1783)
+++ trunk/cluster/dlmast.c 2005-01-18 01:47:49 UTC (rev 1784)
@@ -55,6 +55,8 @@
#include "tcp.h"
#include "dlmmod.h"
+static int dlm_send_proxy_ast(dlm_ctxt *dlm, dlm_lock_resource *res,
+ dlm_lock *lock, int type, int blocked_type);
int dlm_do_ast(dlm_ctxt *dlm, dlm_lock_resource *res, dlm_lock *lock)
{
@@ -103,70 +105,36 @@
}
-int dlm_do_bast(dlm_ctxt *dlm, dlm_lock_resource *res, dlm_lock *lock, int blocked_type)
+int dlm_do_bast(dlm_ctxt *dlm, dlm_lock_resource *res,
+ dlm_lock *lock, int blocked_type)
{
+ int ret;
dlm_bastlockfunc_t *fn = lock->bast;
dlmprintk0("\n");
if (lock->node != dlm->group_index) {
- return dlm_send_proxy_ast(dlm, res, lock, DLM_BAST, blocked_type);
+ ret = dlm_send_proxy_ast(dlm, res, lock,
+ DLM_BAST, blocked_type);
+ goto leave;
}
if (!fn) {
dlmprintk("eek! lock has no bast %*s! cookie=%llu\n",
res->lockname.len, res->lockname.name, lock->cookie);
- return -EINVAL;
+ ret = -EINVAL;
+ goto leave;
}
(*fn)(lock->astdata, blocked_type);
- return 0;
+ ret = 0;
+leave:
+ return ret;
}
-int dlm_send_proxy_ast(dlm_ctxt *dlm, dlm_lock_resource *res, dlm_lock *lock, int type, int blocked_type)
-{
- int ret = 0;
- dlm_proxy_ast past;
- struct inode *inode = NULL;
- struct iovec iov[2];
- size_t iovlen = 1;
-
- dlmprintk("res %*s, to=%u, type=%d, blocked_type=%d\n",res->lockname.len, res->lockname.name, lock->node, type, blocked_type);
-
-
- memset(&past, 0, sizeof(dlm_proxy_ast));
- past.node_idx = dlm->group_index;
- past.type = type;
- past.blocked_type = blocked_type;
- past.namelen = res->lockname.len;
- strncpy(past.name, res->lockname.name, past.namelen);
- past.cookie = lock->cookie;
-
- iov[0].iov_len = sizeof(dlm_proxy_ast);
- iov[0].iov_base = &past;
- if (lock->lksb->flags & DLM_LKSB_GET_LVB) {
- past.flags |= LKM_GET_LVB;
- iov[1].iov_len = DLM_LVB_LEN;
- iov[1].iov_base = lock->lksb->lvb;
- iovlen++;
- }
-
- ret = -EINVAL;
- inode = nm_get_group_node_by_index(dlm->group, lock->node);
- if (inode) {
- dlm_proxy_ast_to_net(&past);
- ret = net_send_message_iov(DLM_PROXY_AST_MSG, dlm->key,
- iov, iovlen, inode, NULL);
- iput(inode);
- }
- if (ret < 0) {
- dlmprintk("(%d) dlm_send_proxy_ast: returning %d\n", current->pid, ret);
- }
- return ret;
-}
-
int dlm_proxy_ast_handler(net_msg *msg, u32 len, void *data)
{
+ int ret;
int status;
dlm_ctxt *dlm = data;
dlm_lock_resource *res;
@@ -186,7 +154,8 @@
if ((flags & (LKM_PUT_LVB|LKM_GET_LVB)) ==
(LKM_PUT_LVB|LKM_GET_LVB)) {
dlmprintk("both PUT and GET lvb specified\n");
- return DLM_BADARGS;
+ ret = DLM_BADARGS;
+ goto leave;
}
dlmprintk("lvb: %s\n", flags & LKM_PUT_LVB ? "put lvb" :
@@ -198,16 +167,21 @@
if (past->type != DLM_AST &&
past->type != DLM_BAST) {
- dlmprintk("Eeeek unknown ast type! %d, cookie=%llu, name=%*s\n",
+ dlmprintk("Eeeek unknown ast type! %d, cookie=%llu, "
+ "name=%*s\n",
past->type, cookie, lockname.len, lockname.name);
- return 0;
+ ret = DLM_IVLOCKID;
+ goto leave;
}
res = dlm_lookup_lock(dlm, &lockname);
if (!res) {
- dlmprintk("eek! got %sast for unknown lockres! cookie=%llu, name=%*s, namelen=%d\n",
- past->type == DLM_AST ? "" : "b", cookie, lockname.len, lockname.name, lockname.len);
- return 0;
+ dlmprintk("eek! got %sast for unknown lockres! cookie=%llu, "
+ "name=%*s, namelen=%d\n",
+ past->type == DLM_AST ? "" : "b",
+ cookie, lockname.len, lockname.name, lockname.len);
+ ret = DLM_IVLOCKID;
+ goto leave;
}
dlmprintk("lockres %*s\n", res->lockname.len, res->lockname.name);
@@ -236,19 +210,23 @@
goto do_ast;
}
- dlmprintk("eek! got %sast for unknown lock! cookie=%llu, name=%*s, namelen=%d\n",
- past->type == DLM_AST ? "" : "b", cookie, lockname.len, lockname.name, lockname.len);
+ dlmprintk("eek! got %sast for unknown lock! cookie=%llu, "
+ "name=%*s, namelen=%d\n",
+ past->type == DLM_AST ? "" : "b",
+ cookie, lockname.len, lockname.name, lockname.len);
spin_unlock(&res->spinlock);
if (!dlm_is_recovery_lock(past->name, past->namelen))
up_read(&dlm->recovery_sem);
- return 0;
+ ret = DLM_NORMAL;
+ goto leave;
do_ast:
+ ret = DLM_NORMAL;
if (past->type == DLM_AST) {
list_del(&lock->list);
list_add_tail(&lock->list, &res->granted);
- dlmprintk("ast: adding to granted list... type=%d, convert_type=%d\n",
- lock->type, lock->convert_type);
+ dlmprintk("ast: adding to granted list... type=%d, "
+ "convert_type=%d\n", lock->type, lock->convert_type);
if (lock->convert_type != LKM_IVMODE) {
lock->type = lock->convert_type;
lock->convert_type = LKM_IVMODE;
@@ -280,7 +258,54 @@
spin_unlock(&res->spinlock);
if (!dlm_is_recovery_lock(past->name, past->namelen))
up_read(&dlm->recovery_sem);
- return 0;
+
+leave:
+ return ret;
}
+static int dlm_send_proxy_ast(dlm_ctxt *dlm, dlm_lock_resource *res,
+ dlm_lock *lock, int type, int blocked_type)
+{
+ int ret = 0;
+ dlm_proxy_ast past;
+ struct inode *inode = NULL;
+ struct iovec iov[2];
+ size_t iovlen = 1;
+ dlmprintk("res %*s, to=%u, type=%d, blocked_type=%d\n",
+ res->lockname.len, res->lockname.name, lock->node,
+ type, blocked_type);
+
+
+ memset(&past, 0, sizeof(dlm_proxy_ast));
+ past.node_idx = dlm->group_index;
+ past.type = type;
+ past.blocked_type = blocked_type;
+ past.namelen = res->lockname.len;
+ strncpy(past.name, res->lockname.name, past.namelen);
+ past.cookie = lock->cookie;
+
+ iov[0].iov_len = sizeof(dlm_proxy_ast);
+ iov[0].iov_base = &past;
+ if (lock->lksb->flags & DLM_LKSB_GET_LVB) {
+ past.flags |= LKM_GET_LVB;
+ iov[1].iov_len = DLM_LVB_LEN;
+ iov[1].iov_base = lock->lksb->lvb;
+ iovlen++;
+ }
+
+ ret = -EINVAL;
+ inode = nm_get_group_node_by_index(dlm->group, lock->node);
+ if (inode) {
+ dlm_proxy_ast_to_net(&past);
+ ret = net_send_message_iov(DLM_PROXY_AST_MSG, dlm->key,
+ iov, iovlen, inode, NULL);
+ iput(inode);
+ }
+ if (ret < 0)
+ dlmprintk("(%d) dlm_send_proxy_ast: returning %d\n",
+ current->pid, ret);
+ return ret;
+}
+
+
Modified: trunk/cluster/dlmconvert.c
===================================================================
--- trunk/cluster/dlmconvert.c 2005-01-18 01:38:52 UTC (rev 1783)
+++ trunk/cluster/dlmconvert.c 2005-01-18 01:47:49 UTC (rev 1784)
@@ -55,6 +55,7 @@
#include "tcp.h"
#include "dlmmod.h"
+
/* NOTE: __dlmconvert_master is the only function in here that
* needs a spinlock held on entry (res->spinlock) and it is the
* only one that holds a lock on exit (res->spinlock).
@@ -63,6 +64,9 @@
static dlm_status __dlmconvert_master(dlm_ctxt *dlm, dlm_lock_resource *res,
dlm_lock *lock, int flags, int type,
int *call_ast, int *kick_thread);
+static dlm_status dlm_send_remote_convert_request(dlm_ctxt *dlm,
+ dlm_lock_resource *res,
+ dlm_lock *lock, int flags, int type);
/*
* locking:
@@ -305,7 +309,7 @@
* held on exit: none
* returns: DLM_NOLOCKMGR, status from remote node
*/
-dlm_status dlm_send_remote_convert_request(dlm_ctxt *dlm,
+static dlm_status dlm_send_remote_convert_request(dlm_ctxt *dlm,
dlm_lock_resource *res,
dlm_lock *lock, int flags, int type)
{
Modified: trunk/cluster/dlmlock.c
===================================================================
--- trunk/cluster/dlmlock.c 2005-01-18 01:38:52 UTC (rev 1783)
+++ trunk/cluster/dlmlock.c 2005-01-18 01:47:49 UTC (rev 1784)
@@ -55,6 +55,10 @@
#include "tcp.h"
#include "dlmmod.h"
+static dlm_status dlm_send_remote_lock_request(dlm_ctxt *dlm,
+ dlm_lock_resource *res,
+ dlm_lock *lock, int flags);
+
/* performs lock creation at the lockres master site
* locking:
* caller needs: none
@@ -62,7 +66,8 @@
* held on exit: none
* returns: DLM_NORMAL, DLM_NOTQUEUED
*/
-dlm_status dlmlock_master(dlm_ctxt *dlm, dlm_lock_resource *res, dlm_lock *lock, int flags)
+dlm_status dlmlock_master(dlm_ctxt *dlm, dlm_lock_resource *res,
+ dlm_lock *lock, int flags)
{
struct list_head *iter;
dlm_lock *tmplock;
@@ -174,7 +179,9 @@
* held on exit: none
* returns: DLM_NOLOCKMGR, or net status
*/
-dlm_status dlm_send_remote_lock_request(dlm_ctxt *dlm, dlm_lock_resource *res, dlm_lock *lock, int flags)
+static dlm_status dlm_send_remote_lock_request(dlm_ctxt *dlm,
+ dlm_lock_resource *res,
+ dlm_lock *lock, int flags)
{
struct inode *inode = NULL;
dlm_create_lock create;
@@ -195,12 +202,15 @@
inode = nm_get_group_node_by_index(dlm->group, res->owner);
if (inode) {
dlm_create_lock_to_net(&create);
- tmpret = net_send_message(DLM_CREATE_LOCK_MSG, dlm->key, &create, sizeof(create), inode, &status);
+ tmpret = net_send_message(DLM_CREATE_LOCK_MSG, dlm->key,
+ &create, sizeof(create),
+ inode, &status);
if (tmpret >= 0) {
// successfully sent and received
ret = status; // this is already a dlm_status
} else {
- dlmprintk("error occurred in net_send_message: %d\n", tmpret);
+ dlmprintk("error occurred in net_send_message: %d\n",
+ tmpret);
ret = dlm_err_to_dlm_status(tmpret);
}
iput(inode);
Modified: trunk/cluster/dlmmaster.c
===================================================================
--- trunk/cluster/dlmmaster.c 2005-01-18 01:38:52 UTC (rev 1783)
+++ trunk/cluster/dlmmaster.c 2005-01-18 01:47:49 UTC (rev 1784)
@@ -64,7 +64,38 @@
static int dlm_init_mle(dlm_master_list_entry *mle, int type, dlm_ctxt *dlm,
dlm_lock_resource *res, struct qstr *name, int locked);
+static void dlm_put_mle(dlm_master_list_entry *mle);
+static int dlm_do_master_request_resp(dlm_ctxt *dlm, struct qstr *name,
+ int response, int to);
+static int dlm_do_master_request(dlm_master_list_entry *mle, int to);
+static int dlm_do_assert_master(dlm_master_list_entry *mle);
+static void dlm_mle_node_up(struct inode *group, struct inode *node,
+ int idx, void *data);
+static void dlm_mle_node_down(struct inode *group, struct inode *node,
+ int idx, void *data);
+
+
+
+/* remove from list and free */
+static void dlm_put_mle(dlm_master_list_entry *mle)
+{
+ if (atomic_dec_and_lock(&mle->refcnt, &dlm_master_lock)) {
+ list_del(&mle->list);
+ spin_unlock(&dlm_master_lock);
+ hb_unregister_callback(HB_NODE_DOWN_CB, dlm_mle_node_down, mle);
+ hb_unregister_callback(HB_NODE_UP_CB, dlm_mle_node_up, mle);
+ kfree(mle);
+ }
+}
+
+static inline void dlm_get_mle(dlm_master_list_entry *mle)
+{
+ atomic_inc(&mle->refcnt);
+}
+
+
+
static int dlm_init_mle(dlm_master_list_entry *mle, int type, dlm_ctxt *dlm,
dlm_lock_resource *res, struct qstr *name, int locked)
{
@@ -152,21 +183,8 @@
/////////////////////////////////////////////////
-/* remove from list and free */
-void dlm_put_mle(dlm_master_list_entry *mle)
-{
- if (atomic_dec_and_lock(&mle->refcnt, &dlm_master_lock)) {
- list_del(&mle->list);
- spin_unlock(&dlm_master_lock);
- hb_unregister_callback(HB_NODE_DOWN_CB, dlm_mle_node_down, mle);
- hb_unregister_callback(HB_NODE_UP_CB, dlm_mle_node_up, mle);
- kfree(mle);
- }
-}
-
-
/*
* lookup a lock resource by name.
* may already exist in the hashtable.
@@ -822,7 +840,7 @@
}
-int dlm_do_master_request(dlm_master_list_entry *mle, int to)
+static int dlm_do_master_request(dlm_master_list_entry *mle, int to)
{
struct inode *inode = NULL;
dlm_ctxt *dlm = mle->dlm;
@@ -890,7 +908,7 @@
return ret;
}
-int dlm_do_master_request_resp(dlm_ctxt *dlm, struct qstr *name,
+static int dlm_do_master_request_resp(dlm_ctxt *dlm, struct qstr *name,
int response, int to)
{
struct inode *inode = NULL;
@@ -919,7 +937,7 @@
* can periodically run all locks owned by this node
* and re-assert across the cluster...
*/
-int dlm_do_assert_master(dlm_master_list_entry *mle)
+static int dlm_do_assert_master(dlm_master_list_entry *mle)
{
struct inode *inode = NULL;
dlm_ctxt *dlm = mle->dlm;
@@ -976,7 +994,7 @@
-void dlm_mle_node_down(struct inode *group, struct inode *node,
+static void dlm_mle_node_down(struct inode *group, struct inode *node,
int idx, void *data)
{
//int ret;
@@ -1014,7 +1032,7 @@
spin_unlock(&mle->spinlock);
}
-void dlm_mle_node_up(struct inode *group, struct inode *node,
+static void dlm_mle_node_up(struct inode *group, struct inode *node,
int idx, void *data)
{
//struct inode *node = ptr2;
Modified: trunk/cluster/dlmmod.c
===================================================================
--- trunk/cluster/dlmmod.c 2005-01-18 01:38:52 UTC (rev 1783)
+++ trunk/cluster/dlmmod.c 2005-01-18 01:47:49 UTC (rev 1784)
@@ -62,7 +62,7 @@
/*
*
- * spinlock lock ordering: if multiple locks are needed, always obey this ordering:
+ * spinlock lock ordering: if multiple locks are needed, obey this ordering:
* dlm_domain_lock -> dlm_ctxt -> dlm_lock_resource -> dlm_lock
*
*/
@@ -157,8 +157,9 @@
}
-dlm_status dlmlock(dlm_ctxt *dlm, int mode, dlm_lockstatus *lksb, int flags, char *name,
- dlm_astlockfunc_t *ast, void *data, dlm_bastlockfunc_t *bast)
+dlm_status dlmlock(dlm_ctxt *dlm, int mode, dlm_lockstatus *lksb, int flags,
+ char *name, dlm_astlockfunc_t *ast, void *data,
+ dlm_bastlockfunc_t *bast)
{
dlm_status status;
dlm_lock_resource *res;
@@ -407,7 +408,8 @@
list_for_each(iter, bucket) {
tmpres = list_entry(iter, dlm_lock_resource, list);
if (tmpres->lockname.len == lockname->len &&
- strncmp(tmpres->lockname.name, lockname->name, lockname->len) == 0)
+ strncmp(tmpres->lockname.name, lockname->name,
+ lockname->len) == 0)
break;
tmpres = NULL;
}
@@ -441,7 +443,8 @@
group = nm_get_group_by_name(group_name);
if (!group) {
- dlmprintk("no nm group %s for domain %s!\n", group_name, domain);
+ dlmprintk("no nm group %s for domain %s!\n",
+ group_name, domain);
goto leave;
}
@@ -518,10 +521,12 @@
list_add_tail(&dlm->list, &dlm_domains);
spin_unlock(&dlm_domain_lock);
- tmpret = hb_register_callback(HB_NODE_DOWN_CB, dlm_hb_node_down_cb, dlm, DLM_HB_NODE_DOWN_PRI);
+ tmpret = hb_register_callback(HB_NODE_DOWN_CB, dlm_hb_node_down_cb, dlm,
+ DLM_HB_NODE_DOWN_PRI);
if (tmpret)
goto error;
- tmpret = hb_register_callback(HB_NODE_UP_CB, dlm_hb_node_up_cb, dlm, DLM_HB_NODE_UP_PRI);
+ tmpret = hb_register_callback(HB_NODE_UP_CB, dlm_hb_node_up_cb, dlm,
+ DLM_HB_NODE_UP_PRI);
if (tmpret)
goto error;
@@ -533,13 +538,15 @@
* that they are not a member I can put together the REAL node map
* for this dlm in dlm->node_map */
/* TODO: I guess we can fill this here as a superset of possible nodes
- * so that the hb_callbacks above have something to work on in the meantime
- * then trim out the nodes that are not part of this dlm once we know */
+ * so that the hb_callbacks above have something to work on in the
+ * meantime, then trim out the nodes that are not part of this dlm
+ * once we know */
/* TODO: I may need to register a special net handler on insmod of dlm.o
* with a key of 0 so that I can respond to requests even if I am not
- * part of a dlm group. this would still leave a gap in time between the
- * start of heartbeating and the insmod dlm.o, unless I change the module
- * loading stuff in clusterbo to include dlm.o (which would work fine) */
+ * part of a dlm group. this would still leave a gap in time between
+ * the start of heartbeating and the insmod dlm.o, unless I change the
+ * module loading stuff in clusterbo to include dlm.o (which would work
+ * fine) */
#warning WRONG WRONG WRONG
tmpret = hb_fill_node_map(group, dlm->node_map, NM_MAX_NODES);
if (tmpret)
@@ -720,7 +727,8 @@
dlm_ctxt *dlm;
struct list_head *iter;
- dlmprintk("dumping ALL dlm state for node %s\n", system_utsname.nodename);
+ dlmprintk("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, dlm_ctxt, list);
@@ -737,7 +745,8 @@
struct list_head *bucket;
int i;
- dlmprintk("dlm_ctxt: %s, group=%u, key=%u\n", dlm->name, dlm->group_index, dlm->key);
+ dlmprintk("dlm_ctxt: %s, group=%u, key=%u\n",
+ dlm->name, dlm->group_index, dlm->key);
dlmprintk0("some bug here... should not have to check for this...\n");
if (!dlm || !dlm->name) {
dlmprintk("wtf... dlm=%p\n", dlm);
@@ -749,31 +758,38 @@
bucket = &(dlm->resources[i]);
list_for_each(iter, bucket) {
res = list_entry(iter, dlm_lock_resource, list);
- dlmprintk("lockres: %*s, owner=%u, state=%u\n", res->lockname.len, res->lockname.name,
+ dlmprintk("lockres: %*s, owner=%u, state=%u\n",
+ res->lockname.len, res->lockname.name,
res->owner, res->state);
spin_lock(&res->spinlock);
dlmprintk0(" granted queue: \n");
list_for_each(iter2, &res->granted) {
lock = list_entry(iter2, dlm_lock, list);
spin_lock(&lock->spinlock);
- dlmprintk(" type=%d, conv=%d, node=%u, cookie=%llu\n",
- lock->type, lock->convert_type, lock->node, lock->cookie);
+ dlmprintk(" type=%d, conv=%d, node=%u, "
+ "cookie=%llu\n", lock->type,
+ lock->convert_type, lock->node,
+ lock->cookie);
spin_unlock(&lock->spinlock);
}
dlmprintk0(" converting queue: \n");
list_for_each(iter2, &res->converting) {
lock = list_entry(iter2, dlm_lock, list);
spin_lock(&lock->spinlock);
- dlmprintk(" type=%d, conv=%d, node=%u, cookie=%llu\n",
- lock->type, lock->convert_type, lock->node, lock->cookie);
+ dlmprintk(" type=%d, conv=%d, node=%u, "
+ "cookie=%llu\n", lock->type,
+ lock->convert_type, lock->node,
+ lock->cookie);
spin_unlock(&lock->spinlock);
}
dlmprintk0(" blocked queue: \n");
list_for_each(iter2, &res->blocked) {
lock = list_entry(iter2, dlm_lock, list);
spin_lock(&lock->spinlock);
- dlmprintk(" type=%d, conv=%d, node=%u, cookie=%llu\n",
- lock->type, lock->convert_type, lock->node, lock->cookie);
+ dlmprintk(" type=%d, conv=%d, node=%u, "
+ "cookie=%llu\n", lock->type,
+ lock->convert_type, lock->node,
+ lock->cookie);
spin_unlock(&lock->spinlock);
}
spin_unlock(&res->spinlock);
Modified: trunk/cluster/dlmmod.h
===================================================================
--- trunk/cluster/dlmmod.h 2005-01-18 01:38:52 UTC (rev 1783)
+++ trunk/cluster/dlmmod.h 2005-01-18 01:47:49 UTC (rev 1784)
@@ -306,11 +306,6 @@
} u;
} dlm_master_list_entry;
-void dlm_put_mle(dlm_master_list_entry *mle);
-static inline void dlm_get_mle(dlm_master_list_entry *mle)
-{
- atomic_inc(&mle->refcnt);
-}
#define DLM_MASTER_REQUEST_MSG 500
@@ -519,7 +514,6 @@
void dlm_shuffle_lists(dlm_ctxt *dlm, dlm_lock_resource *res);
void dlm_thread_run_lock_resources(dlm_ctxt *dlm);
-int dlm_thread(void *data);
int dlm_launch_thread(dlm_ctxt *dlm);
void dlm_complete_thread(dlm_ctxt *dlm);
@@ -581,9 +575,6 @@
int dlm_master_request_handler(net_msg *msg, u32 len, void *data);
int dlm_master_request_resp_handler(net_msg *msg, u32 len, void *data);
int dlm_assert_master_handler(net_msg *msg, u32 len, void *data);
-int dlm_do_master_request(dlm_master_list_entry *mle, int to);
-int dlm_do_master_request_resp(dlm_ctxt *dlm, struct qstr *name, int response, int to);
-int dlm_do_assert_master(dlm_master_list_entry *mle);
void dlm_mle_node_down(struct inode *group, struct inode *node, int idx, void *data);
void dlm_mle_node_up(struct inode *group, struct inode *node, int idx, void *data);
dlm_lock_resource * __dlm_lookup_lock(dlm_ctxt *dlm, struct qstr *lockname);
@@ -592,11 +583,8 @@
void dlm_dump_everything(void);
void dlm_dump_dlm(dlm_ctxt *dlm);
-dlm_status dlm_send_remote_convert_request(dlm_ctxt *dlm, dlm_lock_resource *res, dlm_lock *lock, int flags, int type);
-dlm_status dlm_send_remote_lock_request(dlm_ctxt *dlm, dlm_lock_resource *res, dlm_lock *lock, int flags);
int dlm_lock_owner_broadcast(dlm_ctxt *dlm, dlm_lock_resource *res);
int dlm_lock_owner_broadcast(dlm_ctxt *dlm, dlm_lock_resource *res);
-int dlm_send_proxy_ast(dlm_ctxt *dlm, dlm_lock_resource *res, dlm_lock *lock, int type, int blocked_type);
void dlm_wait_on_lockres(dlm_lock_resource *res);
void __dlm_wait_on_lockres(dlm_lock_resource *res);
Modified: trunk/cluster/dlmthread.c
===================================================================
--- trunk/cluster/dlmthread.c 2005-01-18 01:38:52 UTC (rev 1783)
+++ trunk/cluster/dlmthread.c 2005-01-18 01:47:49 UTC (rev 1784)
@@ -58,6 +58,8 @@
extern struct list_head dlm_domains;
extern u16 dlm_global_index;
+static int dlm_thread(void *data);
+
#define dlm_lock_is_remote(dlm, lock) ((lock)->node != (dlm)->group_index)
/*
@@ -88,7 +90,8 @@
list_for_each(iter, &res->blocked) {
b++;
}
- dlmprintk("(%d) granted: %d, converting: %d, blocked: %d\n", current->pid, g, c, b);
+ dlmprintk("(%d) granted: %d, converting: %d, blocked: %d\n",
+ current->pid, g, c, b);
}
#endif
@@ -100,7 +103,8 @@
target = list_entry(res->converting.next, dlm_lock, list);
if (target->convert_type == LKM_IVMODE) {
- dlmprintk0("eeek!!! converting a lock with no convert_type!!!!\n");
+ dlmprintk0("eeek!!! converting a lock with no "
+ "convert_type!!!!\n");
BUG();
}
head = &res->granted;
@@ -133,8 +137,10 @@
spin_lock(&target->spinlock);
DLM_ASSERT(target->highest_blocked == LKM_IVMODE);
- dlmprintk("calling ast for converting lock: %*s, have: %d, granting: %d, node: %u\n",
- res->lockname.len, res->lockname.name, target->type, target->convert_type, target->node);
+ dlmprintk("calling ast for converting lock: %*s, have: %d, "
+ "granting: %d, node: %u\n", res->lockname.len,
+ res->lockname.name, target->type,
+ target->convert_type, target->node);
target->type = target->convert_type;
target->convert_type = LKM_IVMODE;
@@ -190,8 +196,9 @@
spin_lock(&target->spinlock);
DLM_ASSERT(target->highest_blocked == LKM_IVMODE);
- dlmprintk("calling ast for blocked lock: %*s, granting: %d, node: %u\n",
- res->lockname.len, res->lockname.name, target->type, target->node);
+ dlmprintk("calling ast for blocked lock: %*s, granting: %d, "
+ "node: %u\n", res->lockname.len, res->lockname.name,
+ target->type, target->node);
// target->type is already correct
list_del(&target->list);
@@ -250,9 +257,12 @@
int dlm_launch_thread(dlm_ctxt *dlm)
{
dlmprintk0("starting dlm thread...\n");
- dlm->thread.pid = kernel_thread (dlm_thread, dlm, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+ dlm->thread.pid = kernel_thread (dlm_thread, dlm,
+ CLONE_FS | CLONE_FILES |
+ CLONE_SIGHAND);
if (dlm->thread.pid < 0) {
- dlmprintk("unable to launch dlm thread, error=%d", dlm->thread.pid);
+ dlmprintk("unable to launch dlm thread, error=%d",
+ dlm->thread.pid);
return -EINVAL;
}
dlmprintk("dlm thread running for %s...\n", dlm->name);
@@ -271,7 +281,7 @@
-int dlm_thread(void *data)
+static int dlm_thread(void *data)
{
struct list_head *iter, *tmpiter;
dlm_lock_resource *res;
More information about the Ocfs2-commits
mailing list