/fs/dlm/ |
D | lockspace.c | 35 static ssize_t dlm_control_store(struct dlm_ls *ls, const char *buf, size_t len) in dlm_control_store() argument 40 ls = dlm_find_lockspace_local(ls->ls_local_handle); in dlm_control_store() 41 if (!ls) in dlm_control_store() 46 dlm_ls_stop(ls); in dlm_control_store() 49 dlm_ls_start(ls); in dlm_control_store() 54 dlm_put_lockspace(ls); in dlm_control_store() 58 static ssize_t dlm_event_store(struct dlm_ls *ls, const char *buf, size_t len) in dlm_event_store() argument 60 ls->ls_uevent_result = simple_strtol(buf, NULL, 0); in dlm_event_store() 61 set_bit(LSFL_UEVENT_WAIT, &ls->ls_flags); in dlm_event_store() 62 wake_up(&ls->ls_uevent_wait); in dlm_event_store() [all …]
|
D | recoverd.c | 33 static int enable_locking(struct dlm_ls *ls, uint64_t seq) in enable_locking() argument 37 down_write(&ls->ls_recv_active); in enable_locking() 39 spin_lock(&ls->ls_recover_lock); in enable_locking() 40 if (ls->ls_recover_seq == seq) { in enable_locking() 41 set_bit(LSFL_RUNNING, &ls->ls_flags); in enable_locking() 43 up_write(&ls->ls_in_recovery); in enable_locking() 46 spin_unlock(&ls->ls_recover_lock); in enable_locking() 48 up_write(&ls->ls_recv_active); in enable_locking() 52 static int ls_recover(struct dlm_ls *ls, struct dlm_recover *rv) in ls_recover() argument 57 log_debug(ls, "recover %llx", (unsigned long long)rv->seq); in ls_recover() [all …]
|
D | recover.c | 46 struct dlm_ls *ls = (struct dlm_ls *) data; in dlm_wait_timer_fn() local 47 mod_timer(&ls->ls_timer, jiffies + (dlm_config.ci_recover_timer * HZ)); in dlm_wait_timer_fn() 48 wake_up(&ls->ls_wait_general); in dlm_wait_timer_fn() 51 int dlm_wait_function(struct dlm_ls *ls, int (*testfn) (struct dlm_ls *ls)) in dlm_wait_function() argument 55 init_timer(&ls->ls_timer); in dlm_wait_function() 56 ls->ls_timer.function = dlm_wait_timer_fn; in dlm_wait_function() 57 ls->ls_timer.data = (long) ls; in dlm_wait_function() 58 ls->ls_timer.expires = jiffies + (dlm_config.ci_recover_timer * HZ); in dlm_wait_function() 59 add_timer(&ls->ls_timer); in dlm_wait_function() 61 wait_event(ls->ls_wait_general, testfn(ls) || dlm_recovery_stopped(ls)); in dlm_wait_function() [all …]
|
D | member.c | 21 static void add_ordered_member(struct dlm_ls *ls, struct dlm_member *new) in add_ordered_member() argument 26 struct list_head *head = &ls->ls_nodes; in add_ordered_member() 45 static int dlm_add_member(struct dlm_ls *ls, int nodeid) in dlm_add_member() argument 54 w = dlm_node_weight(ls->ls_name, nodeid); in dlm_add_member() 62 add_ordered_member(ls, memb); in dlm_add_member() 63 ls->ls_num_nodes++; in dlm_add_member() 67 static void dlm_remove_member(struct dlm_ls *ls, struct dlm_member *memb) in dlm_remove_member() argument 69 list_move(&memb->list, &ls->ls_nodes_gone); in dlm_remove_member() 70 ls->ls_num_nodes--; in dlm_remove_member() 73 int dlm_is_member(struct dlm_ls *ls, int nodeid) in dlm_is_member() argument [all …]
|
D | rcom.c | 28 static int rcom_response(struct dlm_ls *ls) in rcom_response() argument 30 return test_bit(LSFL_RCOM_READY, &ls->ls_flags); in rcom_response() 33 static int create_rcom(struct dlm_ls *ls, int to_nodeid, int type, int len, in create_rcom() argument 41 mh = dlm_lowcomms_get_buffer(to_nodeid, mb_len, ls->ls_allocation, &mb); in create_rcom() 52 rc->rc_header.h_lockspace = ls->ls_global_id; in create_rcom() 59 spin_lock(&ls->ls_recover_lock); in create_rcom() 60 rc->rc_seq = ls->ls_recover_seq; in create_rcom() 61 spin_unlock(&ls->ls_recover_lock); in create_rcom() 68 static void send_rcom(struct dlm_ls *ls, struct dlm_mhandle *mh, in send_rcom() argument 79 static void make_config(struct dlm_ls *ls, struct rcom_config *rf) in make_config() argument [all …]
|
D | dir.c | 27 static void put_free_de(struct dlm_ls *ls, struct dlm_direntry *de) in put_free_de() argument 29 spin_lock(&ls->ls_recover_list_lock); in put_free_de() 30 list_add(&de->list, &ls->ls_recover_list); in put_free_de() 31 spin_unlock(&ls->ls_recover_list_lock); in put_free_de() 34 static struct dlm_direntry *get_free_de(struct dlm_ls *ls, int len) in get_free_de() argument 39 spin_lock(&ls->ls_recover_list_lock); in get_free_de() 40 list_for_each_entry(de, &ls->ls_recover_list, list) { in get_free_de() 49 spin_unlock(&ls->ls_recover_list_lock); in get_free_de() 56 void dlm_clear_free_entries(struct dlm_ls *ls) in dlm_clear_free_entries() argument 60 spin_lock(&ls->ls_recover_list_lock); in dlm_clear_free_entries() [all …]
|
D | requestqueue.c | 33 void dlm_add_requestqueue(struct dlm_ls *ls, int nodeid, struct dlm_message *ms) in dlm_add_requestqueue() argument 47 mutex_lock(&ls->ls_requestqueue_mutex); in dlm_add_requestqueue() 48 list_add_tail(&e->list, &ls->ls_requestqueue); in dlm_add_requestqueue() 49 mutex_unlock(&ls->ls_requestqueue_mutex); in dlm_add_requestqueue() 63 int dlm_process_requestqueue(struct dlm_ls *ls) in dlm_process_requestqueue() argument 68 mutex_lock(&ls->ls_requestqueue_mutex); in dlm_process_requestqueue() 71 if (list_empty(&ls->ls_requestqueue)) { in dlm_process_requestqueue() 72 mutex_unlock(&ls->ls_requestqueue_mutex); in dlm_process_requestqueue() 76 e = list_entry(ls->ls_requestqueue.next, struct rq_entry, list); in dlm_process_requestqueue() 77 mutex_unlock(&ls->ls_requestqueue_mutex); in dlm_process_requestqueue() [all …]
|
D | lock.c | 89 static void do_purge(struct dlm_ls *ls, int nodeid, int pid); 199 static inline void dlm_lock_recovery(struct dlm_ls *ls) in dlm_lock_recovery() argument 201 down_read(&ls->ls_in_recovery); in dlm_lock_recovery() 204 void dlm_unlock_recovery(struct dlm_ls *ls) in dlm_unlock_recovery() argument 206 up_read(&ls->ls_in_recovery); in dlm_unlock_recovery() 209 int dlm_lock_recovery_try(struct dlm_ls *ls) in dlm_lock_recovery_try() argument 211 return down_read_trylock(&ls->ls_in_recovery); in dlm_lock_recovery_try() 333 static struct dlm_rsb *create_rsb(struct dlm_ls *ls, char *name, int len) in create_rsb() argument 337 r = dlm_allocate_rsb(ls, len); in create_rsb() 341 r->res_ls = ls; in create_rsb() [all …]
|
D | recover.h | 17 int dlm_wait_function(struct dlm_ls *ls, int (*testfn) (struct dlm_ls *ls)); 18 uint32_t dlm_recover_status(struct dlm_ls *ls); 19 void dlm_set_recover_status(struct dlm_ls *ls, uint32_t status); 20 int dlm_recover_members_wait(struct dlm_ls *ls); 21 int dlm_recover_directory_wait(struct dlm_ls *ls); 22 int dlm_recover_locks_wait(struct dlm_ls *ls); 23 int dlm_recover_done_wait(struct dlm_ls *ls); 24 int dlm_recover_masters(struct dlm_ls *ls); 25 int dlm_recover_master_reply(struct dlm_ls *ls, struct dlm_rcom *rc); 26 int dlm_recover_locks(struct dlm_ls *ls); [all …]
|
D | lock.h | 18 void dlm_receive_message_saved(struct dlm_ls *ls, struct dlm_message *ms); 24 void dlm_scan_rsbs(struct dlm_ls *ls); 25 int dlm_lock_recovery_try(struct dlm_ls *ls); 26 void dlm_unlock_recovery(struct dlm_ls *ls); 27 void dlm_scan_timeout(struct dlm_ls *ls); 28 void dlm_adjust_timeouts(struct dlm_ls *ls); 30 int dlm_purge_locks(struct dlm_ls *ls); 32 void dlm_grant_after_purge(struct dlm_ls *ls); 33 int dlm_recover_waiters_post(struct dlm_ls *ls); 34 void dlm_recover_waiters_pre(struct dlm_ls *ls); [all …]
|
D | debug_fs.c | 395 struct dlm_ls *ls = seq->private; in table_seq_start() local 404 if (bucket >= ls->ls_rsbtbl_size) in table_seq_start() 419 spin_lock(&ls->ls_rsbtbl[bucket].lock); in table_seq_start() 420 if (!list_empty(&ls->ls_rsbtbl[bucket].list)) { in table_seq_start() 421 list_for_each_entry(r, &ls->ls_rsbtbl[bucket].list, in table_seq_start() 427 spin_unlock(&ls->ls_rsbtbl[bucket].lock); in table_seq_start() 432 spin_unlock(&ls->ls_rsbtbl[bucket].lock); in table_seq_start() 445 if (bucket >= ls->ls_rsbtbl_size) { in table_seq_start() 450 spin_lock(&ls->ls_rsbtbl[bucket].lock); in table_seq_start() 451 if (!list_empty(&ls->ls_rsbtbl[bucket].list)) { in table_seq_start() [all …]
|
D | user.c | 180 struct dlm_ls *ls; in dlm_user_add_ast() local 188 ls = lkb->lkb_resource->res_ls; in dlm_user_add_ast() 189 mutex_lock(&ls->ls_clear_proc_locks); in dlm_user_add_ast() 220 log_debug(ls, "ast overlap %x status %x %x", in dlm_user_add_ast() 253 mutex_unlock(&ls->ls_clear_proc_locks); in dlm_user_add_ast() 259 struct dlm_ls *ls; in device_user_lock() local 263 ls = dlm_find_lockspace_local(proc->lockspace); in device_user_lock() 264 if (!ls) in device_user_lock() 284 error = dlm_user_convert(ls, ua, in device_user_lock() 289 error = dlm_user_request(ls, ua, in device_user_lock() [all …]
|
D | member.h | 16 int dlm_ls_stop(struct dlm_ls *ls); 17 int dlm_ls_start(struct dlm_ls *ls); 18 void dlm_clear_members(struct dlm_ls *ls); 19 void dlm_clear_members_gone(struct dlm_ls *ls); 20 int dlm_recover_members(struct dlm_ls *ls, struct dlm_recover *rv,int *neg_out); 21 int dlm_is_removed(struct dlm_ls *ls, int nodeid); 22 int dlm_is_member(struct dlm_ls *ls, int nodeid);
|
D | dir.h | 19 int dlm_hash2nodeid(struct dlm_ls *ls, uint32_t hash); 20 void dlm_dir_remove_entry(struct dlm_ls *ls, int nodeid, char *name, int len); 21 void dlm_dir_clear(struct dlm_ls *ls); 22 void dlm_clear_free_entries(struct dlm_ls *ls); 23 int dlm_recover_directory(struct dlm_ls *ls); 24 int dlm_dir_lookup(struct dlm_ls *ls, int nodeid, char *name, int namelen, 26 void dlm_copy_master_names(struct dlm_ls *ls, char *inbuf, int inlen,
|
D | plock.c | 76 struct dlm_ls *ls; in dlm_posix_lock() local 81 ls = dlm_find_lockspace_local(lockspace); in dlm_posix_lock() 82 if (!ls) in dlm_posix_lock() 96 op->info.fsid = ls->ls_global_id; in dlm_posix_lock() 125 log_error(ls, "dlm_posix_lock: op on list %llx", in dlm_posix_lock() 135 log_error(ls, "dlm_posix_lock: vfs lock error %llx", in dlm_posix_lock() 141 dlm_put_lockspace(ls); in dlm_posix_lock() 206 struct dlm_ls *ls; in dlm_posix_unlock() local 210 ls = dlm_find_lockspace_local(lockspace); in dlm_posix_unlock() 211 if (!ls) in dlm_posix_unlock() [all …]
|
D | memory.c | 38 char *dlm_allocate_lvb(struct dlm_ls *ls) in dlm_allocate_lvb() argument 42 p = kzalloc(ls->ls_lvblen, ls->ls_allocation); in dlm_allocate_lvb() 54 struct dlm_rsb *dlm_allocate_rsb(struct dlm_ls *ls, int namelen) in dlm_allocate_rsb() argument 60 r = kzalloc(sizeof(*r) + namelen, ls->ls_allocation); in dlm_allocate_rsb() 71 struct dlm_lkb *dlm_allocate_lkb(struct dlm_ls *ls) in dlm_allocate_lkb() argument 75 lkb = kmem_cache_zalloc(lkb_cache, ls->ls_allocation); in dlm_allocate_lkb()
|
D | recoverd.h | 17 void dlm_recoverd_kick(struct dlm_ls *ls); 18 void dlm_recoverd_stop(struct dlm_ls *ls); 19 int dlm_recoverd_start(struct dlm_ls *ls); 20 void dlm_recoverd_suspend(struct dlm_ls *ls); 21 void dlm_recoverd_resume(struct dlm_ls *ls);
|
D | dlm_internal.h | 67 #define log_error(ls, fmt, args...) \ argument 68 printk(KERN_ERR "dlm: %s: " fmt "\n", (ls)->ls_name , ##args) 70 #define log_debug(ls, fmt, args...) \ argument 74 (ls)->ls_name , ##args); \ 569 static inline int dlm_locking_stopped(struct dlm_ls *ls) in dlm_locking_stopped() argument 571 return !test_bit(LSFL_RUNNING, &ls->ls_flags); in dlm_locking_stopped() 574 static inline int dlm_recovery_stopped(struct dlm_ls *ls) in dlm_recovery_stopped() argument 576 return test_bit(LSFL_RECOVERY_STOP, &ls->ls_flags); in dlm_recovery_stopped() 579 static inline int dlm_no_directory(struct dlm_ls *ls) in dlm_no_directory() argument 581 return (ls->ls_exflags & DLM_LSFL_NODIR) ? 1 : 0; in dlm_no_directory() [all …]
|
D | requestqueue.h | 16 void dlm_add_requestqueue(struct dlm_ls *ls, int nodeid, struct dlm_message *ms); 17 int dlm_process_requestqueue(struct dlm_ls *ls); 18 void dlm_wait_requestqueue(struct dlm_ls *ls); 19 void dlm_purge_requestqueue(struct dlm_ls *ls);
|
D | memory.h | 19 struct dlm_rsb *dlm_allocate_rsb(struct dlm_ls *ls, int namelen); 21 struct dlm_lkb *dlm_allocate_lkb(struct dlm_ls *ls); 23 char *dlm_allocate_lvb(struct dlm_ls *ls);
|
D | rcom.h | 17 int dlm_rcom_status(struct dlm_ls *ls, int nodeid); 18 int dlm_rcom_names(struct dlm_ls *ls, int nodeid, char *last_name,int last_len); 21 void dlm_receive_rcom(struct dlm_ls *ls, struct dlm_rcom *rc, int nodeid);
|
/fs/gfs2/locking/dlm/ |
D | mount.c | 18 struct gdlm_ls *ls; in init_gdlm() local 21 ls = kzalloc(sizeof(struct gdlm_ls), GFP_KERNEL); in init_gdlm() 22 if (!ls) in init_gdlm() 25 ls->fscb = cb; in init_gdlm() 26 ls->sdp = sdp; in init_gdlm() 27 ls->fsflags = flags; in init_gdlm() 28 spin_lock_init(&ls->async_lock); in init_gdlm() 29 INIT_LIST_HEAD(&ls->delayed); in init_gdlm() 30 INIT_LIST_HEAD(&ls->submit); in init_gdlm() 31 init_waitqueue_head(&ls->thread_wait); in init_gdlm() [all …]
|
D | sysfs.c | 15 static ssize_t proto_name_show(struct gdlm_ls *ls, char *buf) in proto_name_show() argument 20 static ssize_t block_show(struct gdlm_ls *ls, char *buf) in block_show() argument 25 if (test_bit(DFL_BLOCK_LOCKS, &ls->flags)) in block_show() 31 static ssize_t block_store(struct gdlm_ls *ls, const char *buf, size_t len) in block_store() argument 39 set_bit(DFL_BLOCK_LOCKS, &ls->flags); in block_store() 41 clear_bit(DFL_BLOCK_LOCKS, &ls->flags); in block_store() 42 gdlm_submit_delayed(ls); in block_store() 49 static ssize_t withdraw_show(struct gdlm_ls *ls, char *buf) in withdraw_show() argument 54 if (test_bit(DFL_WITHDRAW, &ls->flags)) in withdraw_show() 60 static ssize_t withdraw_store(struct gdlm_ls *ls, const char *buf, size_t len) in withdraw_store() argument [all …]
|
D | thread.c | 12 static inline int no_work(struct gdlm_ls *ls) in no_work() argument 16 spin_lock(&ls->async_lock); in no_work() 17 ret = list_empty(&ls->submit); in no_work() 18 spin_unlock(&ls->async_lock); in no_work() 25 struct gdlm_ls *ls = (struct gdlm_ls *) data; in gdlm_thread() local 29 wait_event_interruptible(ls->thread_wait, in gdlm_thread() 30 !no_work(ls) || kthread_should_stop()); in gdlm_thread() 32 spin_lock(&ls->async_lock); in gdlm_thread() 34 if (!list_empty(&ls->submit)) { in gdlm_thread() 35 lp = list_entry(ls->submit.next, struct gdlm_lock, in gdlm_thread() [all …]
|
D | lock.c | 39 struct gdlm_ls *ls = lp->ls; in queue_submit() local 41 spin_lock(&ls->async_lock); in queue_submit() 42 list_add_tail(&lp->delay_list, &ls->submit); in queue_submit() 43 spin_unlock(&ls->async_lock); in queue_submit() 44 wake_up(&ls->thread_wait); in queue_submit() 56 struct gdlm_ls *ls = lp->ls; in gdlm_delete_lp() local 58 spin_lock(&ls->async_lock); in gdlm_delete_lp() 61 ls->all_locks_count--; in gdlm_delete_lp() 62 spin_unlock(&ls->async_lock); in gdlm_delete_lp() 69 struct gdlm_ls *ls = lp->ls; in gdlm_queue_delayed() local [all …]
|