Blame view

fs/dlm/lock.h 2.58 KB
e7fd41792   David Teigland   [DLM] The core of...
1
2
3
  /******************************************************************************
  *******************************************************************************
  **
3ae1acf93   David Teigland   [DLM] add lock ti...
4
  **  Copyright (C) 2005-2007 Red Hat, Inc.  All rights reserved.
e7fd41792   David Teigland   [DLM] The core of...
5
6
7
8
9
10
11
12
13
14
  **
  **  This copyrighted material is made available to anyone wishing to use,
  **  modify, copy, or redistribute it subject to the terms and conditions
  **  of the GNU General Public License v.2.
  **
  *******************************************************************************
  ******************************************************************************/
  
  #ifndef __LOCK_DOT_H__
  #define __LOCK_DOT_H__
a345da3e8   David Teigland   [DLM] dump rsb an...
15
  void dlm_dump_rsb(struct dlm_rsb *r);
597d0cae0   David Teigland   [DLM] dlm: user l...
16
  void dlm_print_lkb(struct dlm_lkb *lkb);
c36258b59   David Teigland   [DLM] block dlm_r...
17
  void dlm_receive_message_saved(struct dlm_ls *ls, struct dlm_message *ms);
eef7d739c   Al Viro   dlm: dlm_process_...
18
  void dlm_receive_buffer(union dlm_packet *p, int nodeid);
e7fd41792   David Teigland   [DLM] The core of...
19
  int dlm_modes_compat(int mode1, int mode2);
e7fd41792   David Teigland   [DLM] The core of...
20
21
22
23
  void dlm_put_rsb(struct dlm_rsb *r);
  void dlm_hold_rsb(struct dlm_rsb *r);
  int dlm_put_lkb(struct dlm_lkb *lkb);
  void dlm_scan_rsbs(struct dlm_ls *ls);
85e86edf9   David Teigland   [DLM] block scand...
24
25
  int dlm_lock_recovery_try(struct dlm_ls *ls);
  void dlm_unlock_recovery(struct dlm_ls *ls);
c6ff669ba   David Teigland   dlm: delayed repl...
26
  void dlm_scan_waiters(struct dlm_ls *ls);
3ae1acf93   David Teigland   [DLM] add lock ti...
27
28
  void dlm_scan_timeout(struct dlm_ls *ls);
  void dlm_adjust_timeouts(struct dlm_ls *ls);
e7fd41792   David Teigland   [DLM] The core of...
29
30
31
  
  int dlm_purge_locks(struct dlm_ls *ls);
  void dlm_purge_mstcpy_locks(struct dlm_rsb *r);
97a35d1e5   David Teigland   [DLM] fix grant_a...
32
  void dlm_grant_after_purge(struct dlm_ls *ls);
e7fd41792   David Teigland   [DLM] The core of...
33
34
35
36
  int dlm_recover_waiters_post(struct dlm_ls *ls);
  void dlm_recover_waiters_pre(struct dlm_ls *ls);
  int dlm_recover_master_copy(struct dlm_ls *ls, struct dlm_rcom *rc);
  int dlm_recover_process_copy(struct dlm_ls *ls, struct dlm_rcom *rc);
597d0cae0   David Teigland   [DLM] dlm: user l...
37
  int dlm_user_request(struct dlm_ls *ls, struct dlm_user_args *ua, int mode,
d7db923ea   David Teigland   [DLM] dlm_device ...
38
39
  	uint32_t flags, void *name, unsigned int namelen,
  	unsigned long timeout_cs);
597d0cae0   David Teigland   [DLM] dlm: user l...
40
  int dlm_user_convert(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
d7db923ea   David Teigland   [DLM] dlm_device ...
41
42
  	int mode, uint32_t flags, uint32_t lkid, char *lvb_in,
  	unsigned long timeout_cs);
597d0cae0   David Teigland   [DLM] dlm: user l...
43
44
45
46
  int dlm_user_unlock(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
  	uint32_t flags, uint32_t lkid, char *lvb_in);
  int dlm_user_cancel(struct dlm_ls *ls,  struct dlm_user_args *ua_tmp,
  	uint32_t flags, uint32_t lkid);
72c2be776   David Teigland   [DLM] interface f...
47
48
  int dlm_user_purge(struct dlm_ls *ls, struct dlm_user_proc *proc,
  	int nodeid, int pid);
8b4021fa4   David Teigland   [DLM] canceling d...
49
  int dlm_user_deadlock(struct dlm_ls *ls, uint32_t flags, uint32_t lkid);
597d0cae0   David Teigland   [DLM] dlm: user l...
50
  void dlm_clear_proc_locks(struct dlm_ls *ls, struct dlm_user_proc *proc);
e7fd41792   David Teigland   [DLM] The core of...
51
52
53
54
55
56
57
  static inline int is_master(struct dlm_rsb *r)
  {
  	return !r->res_nodeid;
  }
  
  static inline void lock_rsb(struct dlm_rsb *r)
  {
901359256   David Teigland   [DLM] Update DLM ...
58
  	mutex_lock(&r->res_mutex);
e7fd41792   David Teigland   [DLM] The core of...
59
60
61
62
  }
  
  static inline void unlock_rsb(struct dlm_rsb *r)
  {
901359256   David Teigland   [DLM] Update DLM ...
63
  	mutex_unlock(&r->res_mutex);
e7fd41792   David Teigland   [DLM] The core of...
64
65
66
  }
  
  #endif