aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dlm/dlm_internal.h
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/dlm_internal.h
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/dlm_internal.h')
-rw-r--r--fs/dlm/dlm_internal.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/dlm/dlm_internal.h b/fs/dlm/dlm_internal.h
index 30994d68f6a0..65a5fc076b8a 100644
--- a/fs/dlm/dlm_internal.h
+++ b/fs/dlm/dlm_internal.h
@@ -213,8 +213,10 @@ struct dlm_args {
213#define DLM_IFL_OVERLAP_UNLOCK 0x00080000 213#define DLM_IFL_OVERLAP_UNLOCK 0x00080000
214#define DLM_IFL_OVERLAP_CANCEL 0x00100000 214#define DLM_IFL_OVERLAP_CANCEL 0x00100000
215#define DLM_IFL_ENDOFLIFE 0x00200000 215#define DLM_IFL_ENDOFLIFE 0x00200000
216#define DLM_IFL_WATCH_TIMEWARN 0x00400000
216#define DLM_IFL_USER 0x00000001 217#define DLM_IFL_USER 0x00000001
217#define DLM_IFL_ORPHAN 0x00000002 218#define DLM_IFL_ORPHAN 0x00000002
219#define DLM_IFL_TIMEOUT_CANCEL 0x00000004
218 220
219struct dlm_lkb { 221struct dlm_lkb {
220 struct dlm_rsb *lkb_resource; /* the rsb */ 222 struct dlm_rsb *lkb_resource; /* the rsb */
@@ -243,6 +245,9 @@ struct dlm_lkb {
243 struct list_head lkb_wait_reply; /* waiting for remote reply */ 245 struct list_head lkb_wait_reply; /* waiting for remote reply */
244 struct list_head lkb_astqueue; /* need ast to be sent */ 246 struct list_head lkb_astqueue; /* need ast to be sent */
245 struct list_head lkb_ownqueue; /* list of locks for a process */ 247 struct list_head lkb_ownqueue; /* list of locks for a process */
248 struct list_head lkb_time_list;
249 unsigned long lkb_timestamp;
250 unsigned long lkb_timeout_cs;
246 251
247 char *lkb_lvbptr; 252 char *lkb_lvbptr;
248 struct dlm_lksb *lkb_lksb; /* caller's status block */ 253 struct dlm_lksb *lkb_lksb; /* caller's status block */
@@ -447,6 +452,9 @@ struct dlm_ls {
447 struct mutex ls_orphans_mutex; 452 struct mutex ls_orphans_mutex;
448 struct list_head ls_orphans; 453 struct list_head ls_orphans;
449 454
455 struct mutex ls_timeout_mutex;
456 struct list_head ls_timeout;
457
450 struct list_head ls_nodes; /* current nodes in ls */ 458 struct list_head ls_nodes; /* current nodes in ls */
451 struct list_head ls_nodes_gone; /* dead node list, recovery */ 459 struct list_head ls_nodes_gone; /* dead node list, recovery */
452 int ls_num_nodes; /* number of nodes in ls */ 460 int ls_num_nodes; /* number of nodes in ls */
@@ -472,6 +480,7 @@ struct dlm_ls {
472 struct task_struct *ls_recoverd_task; 480 struct task_struct *ls_recoverd_task;
473 struct mutex ls_recoverd_active; 481 struct mutex ls_recoverd_active;
474 spinlock_t ls_recover_lock; 482 spinlock_t ls_recover_lock;
483 unsigned long ls_recover_begin; /* jiffies timestamp */
475 uint32_t ls_recover_status; /* DLM_RS_ */ 484 uint32_t ls_recover_status; /* DLM_RS_ */
476 uint64_t ls_recover_seq; 485 uint64_t ls_recover_seq;
477 struct dlm_recover *ls_recover_args; 486 struct dlm_recover *ls_recover_args;
@@ -501,6 +510,7 @@ struct dlm_ls {
501#define LSFL_RCOM_READY 3 510#define LSFL_RCOM_READY 3
502#define LSFL_RCOM_WAIT 4 511#define LSFL_RCOM_WAIT 4
503#define LSFL_UEVENT_WAIT 5 512#define LSFL_UEVENT_WAIT 5
513#define LSFL_TIMEWARN 6
504 514
505/* much of this is just saving user space pointers associated with the 515/* much of this is just saving user space pointers associated with the
506 lock that we pass back to the user lib with an ast */ 516 lock that we pass back to the user lib with an ast */