aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm/lockspace.c
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2007-05-18 09:59:31 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2007-07-09 03:22:33 -0400
commit3ae1acf93a21512512f8a78430fcde5992dd208e (patch)
tree878ed3c619530c6acf862ecf663063f66fc47a06 /fs/dlm/lockspace.c
parent85e86edf951a8a39954c0ba1edbe4a58827dcd5c (diff)
[DLM] add lock timeouts and warnings [2/6]
New features: lock timeouts and time warnings. If the DLM_LKF_TIMEOUT flag is set, then the request/conversion will be canceled after waiting the specified number of centiseconds (specified per lock). This feature is only available for locks requested through libdlm (can be enabled for kernel dlm users if there's a use for it.) If the new DLM_LSFL_TIMEWARN flag is set when creating the lockspace, then a warning message will be sent to userspace (using genetlink) after a request/conversion has been waiting for a given number of centiseconds (configurable per node). The time warnings will be used in the future to do deadlock detection in userspace. Signed-off-by: David Teigland <teigland@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/dlm/lockspace.c')
-rw-r--r--fs/dlm/lockspace.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index 414a108df934..339a204d7479 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -237,6 +237,7 @@ static int dlm_scand(void *data)
237 list_for_each_entry(ls, &lslist, ls_list) { 237 list_for_each_entry(ls, &lslist, ls_list) {
238 if (dlm_lock_recovery_try(ls)) { 238 if (dlm_lock_recovery_try(ls)) {
239 dlm_scan_rsbs(ls); 239 dlm_scan_rsbs(ls);
240 dlm_scan_timeout(ls);
240 dlm_unlock_recovery(ls); 241 dlm_unlock_recovery(ls);
241 } 242 }
242 } 243 }
@@ -421,11 +422,16 @@ static int new_lockspace(char *name, int namelen, void **lockspace,
421 goto out; 422 goto out;
422 memcpy(ls->ls_name, name, namelen); 423 memcpy(ls->ls_name, name, namelen);
423 ls->ls_namelen = namelen; 424 ls->ls_namelen = namelen;
424 ls->ls_exflags = flags;
425 ls->ls_lvblen = lvblen; 425 ls->ls_lvblen = lvblen;
426 ls->ls_count = 0; 426 ls->ls_count = 0;
427 ls->ls_flags = 0; 427 ls->ls_flags = 0;
428 428
429 /* ls_exflags are forced to match among nodes, and we don't
430 need to require all nodes to have TIMEWARN active */
431 if (flags & DLM_LSFL_TIMEWARN)
432 set_bit(LSFL_TIMEWARN, &ls->ls_flags);
433 ls->ls_exflags = (flags & ~DLM_LSFL_TIMEWARN);
434
429 size = dlm_config.ci_rsbtbl_size; 435 size = dlm_config.ci_rsbtbl_size;
430 ls->ls_rsbtbl_size = size; 436 ls->ls_rsbtbl_size = size;
431 437
@@ -465,6 +471,8 @@ static int new_lockspace(char *name, int namelen, void **lockspace,
465 mutex_init(&ls->ls_waiters_mutex); 471 mutex_init(&ls->ls_waiters_mutex);
466 INIT_LIST_HEAD(&ls->ls_orphans); 472 INIT_LIST_HEAD(&ls->ls_orphans);
467 mutex_init(&ls->ls_orphans_mutex); 473 mutex_init(&ls->ls_orphans_mutex);
474 INIT_LIST_HEAD(&ls->ls_timeout);
475 mutex_init(&ls->ls_timeout_mutex);
468 476
469 INIT_LIST_HEAD(&ls->ls_nodes); 477 INIT_LIST_HEAD(&ls->ls_nodes);
470 INIT_LIST_HEAD(&ls->ls_nodes_gone); 478 INIT_LIST_HEAD(&ls->ls_nodes_gone);