Home
last modified time | relevance | path

Searched refs:lock (Results 1 – 25 of 237) sorted by relevance

12345678910

/fs/ocfs2/dlm/
Ddlmast.c37 struct dlm_lock *lock);
38 static int dlm_should_cancel_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock);
49 static int dlm_should_cancel_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock) in dlm_should_cancel_bast() argument
52 assert_spin_locked(&lock->spinlock); in dlm_should_cancel_bast()
54 if (lock->ml.highest_blocked == LKM_IVMODE) in dlm_should_cancel_bast()
56 BUG_ON(lock->ml.highest_blocked == LKM_NLMODE); in dlm_should_cancel_bast()
58 if (lock->bast_pending && in dlm_should_cancel_bast()
59 list_empty(&lock->bast_list)) in dlm_should_cancel_bast()
63 if (lock->ml.type == LKM_EXMODE) in dlm_should_cancel_bast()
66 else if (lock->ml.type == LKM_NLMODE) in dlm_should_cancel_bast()
[all …]
Ddlmlock.c47 struct dlm_lock *lock, int flags);
51 static void dlm_lock_detach_lockres(struct dlm_lock *lock);
76 struct dlm_lock *lock) in dlm_can_grant_new_lock() argument
81 if (!dlm_lock_compatible(tmplock->ml.type, lock->ml.type)) in dlm_can_grant_new_lock()
86 if (!dlm_lock_compatible(tmplock->ml.type, lock->ml.type)) in dlm_can_grant_new_lock()
89 lock->ml.type)) in dlm_can_grant_new_lock()
105 struct dlm_lock *lock, int flags) in dlmlock_master() argument
110 mlog(0, "type=%d\n", lock->ml.type); in dlmlock_master()
117 lock->ml.node != dlm->node_num) { in dlmlock_master()
126 if (dlm_can_grant_new_lock(res, lock)) { in dlmlock_master()
[all …]
Ddlmconvert.c45 struct dlm_lock *lock, int flags,
50 struct dlm_lock *lock, int flags, int type);
63 struct dlm_lock *lock, int flags, int type) in dlmconvert_master() argument
74 status = __dlmconvert_master(dlm, res, lock, flags, type, in dlmconvert_master()
85 dlm_queue_ast(dlm, lock); in dlmconvert_master()
106 struct dlm_lock *lock, int flags, in __dlmconvert_master() argument
116 lock->ml.type, lock->ml.convert_type, type); in __dlmconvert_master()
118 spin_lock(&lock->spinlock); in __dlmconvert_master()
121 if (lock->ml.convert_type != LKM_IVMODE) { in __dlmconvert_master()
129 if (!dlm_lock_on_list(&res->granted, lock)) { in __dlmconvert_master()
[all …]
Ddlmunlock.c45 struct dlm_lock *lock,
50 struct dlm_lock *lock,
56 struct dlm_lock *lock,
85 struct dlm_lock *lock, in dlmunlock_common() argument
107 in_use = !list_empty(&lock->ast_list); in dlmunlock_common()
127 spin_lock(&lock->spinlock); in dlmunlock_common()
142 status = dlm_get_cancel_actions(dlm, res, lock, lksb, &actions); in dlmunlock_common()
144 status = dlm_get_unlock_actions(dlm, res, lock, lksb, &actions); in dlmunlock_common()
163 lock->cancel_pending = 1; in dlmunlock_common()
165 lock->unlock_pending = 1; in dlmunlock_common()
[all …]
Ddlmthread.c345 struct dlm_lock *lock, *target; in dlm_shuffle_lists() local
372 list_for_each_entry(lock, &res->granted, list) { in dlm_shuffle_lists()
373 if (lock==target) in dlm_shuffle_lists()
375 if (!dlm_lock_compatible(lock->ml.type, in dlm_shuffle_lists()
379 if (lock->ml.highest_blocked == LKM_IVMODE) { in dlm_shuffle_lists()
381 __dlm_queue_bast(dlm, lock); in dlm_shuffle_lists()
384 if (lock->ml.highest_blocked < target->ml.convert_type) in dlm_shuffle_lists()
385 lock->ml.highest_blocked = in dlm_shuffle_lists()
390 list_for_each_entry(lock, &res->converting, list) { in dlm_shuffle_lists()
391 if (lock==target) in dlm_shuffle_lists()
[all …]
Ddlmdebug.c59 static void __dlm_print_lock(struct dlm_lock *lock) in __dlm_print_lock() argument
61 spin_lock(&lock->spinlock); in __dlm_print_lock()
66 lock->ml.type, lock->ml.convert_type, lock->ml.node, in __dlm_print_lock()
67 dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)), in __dlm_print_lock()
68 dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)), in __dlm_print_lock()
69 kref_read(&lock->lock_refs), in __dlm_print_lock()
70 (list_empty(&lock->ast_list) ? 'y' : 'n'), in __dlm_print_lock()
71 (lock->ast_pending ? 'y' : 'n'), in __dlm_print_lock()
72 (list_empty(&lock->bast_list) ? 'y' : 'n'), in __dlm_print_lock()
73 (lock->bast_pending ? 'y' : 'n'), in __dlm_print_lock()
[all …]
Ddlmrecovery.c1048 struct dlm_lock *lock; in dlm_move_reco_locks_to_list() local
1057 list_for_each_entry(lock, &res->granted, list) { in dlm_move_reco_locks_to_list()
1058 if (lock->ml.node == dead_node) { in dlm_move_reco_locks_to_list()
1063 list_del_init(&lock->list); in dlm_move_reco_locks_to_list()
1064 dlm_lock_put(lock); in dlm_move_reco_locks_to_list()
1067 dlm_lock_put(lock); in dlm_move_reco_locks_to_list()
1180 static void dlm_prepare_lvb_for_migration(struct dlm_lock *lock, in dlm_prepare_lvb_for_migration() argument
1184 if (!lock->lksb) in dlm_prepare_lvb_for_migration()
1192 if (lock->ml.type != LKM_EXMODE && lock->ml.type != LKM_PRMODE) in dlm_prepare_lvb_for_migration()
1196 memcpy(mres->lvb, lock->lksb->lvb, DLM_LVB_LEN); in dlm_prepare_lvb_for_migration()
[all …]
/fs/lockd/
Dsvclock.c47 static int nlmsvc_setgrantargs(struct nlm_rqst *call, struct nlm_lock *lock);
145 nlmsvc_lookup_block(struct nlm_file *file, struct nlm_lock *lock) in nlmsvc_lookup_block() argument
151 file, lock->fl.fl_pid, in nlmsvc_lookup_block()
152 (long long)lock->fl.fl_start, in nlmsvc_lookup_block()
153 (long long)lock->fl.fl_end, lock->fl.fl_type); in nlmsvc_lookup_block()
155 fl = &block->b_call->a_args.lock.fl; in nlmsvc_lookup_block()
161 if (block->b_file == file && nlm_compare_locks(fl, &lock->fl)) { in nlmsvc_lookup_block()
217 struct nlm_file *file, struct nlm_lock *lock, in nlmsvc_create_block() argument
235 if (!nlmsvc_setgrantargs(call, lock)) in nlmsvc_create_block()
239 call->a_args.lock.fl.fl_flags |= FL_SLEEP; in nlmsvc_create_block()
[all …]
Dxdr4.c107 nlm4_decode_lock(__be32 *p, struct nlm_lock *lock) in nlm4_decode_lock() argument
109 struct file_lock *fl = &lock->fl; in nlm4_decode_lock()
113 if (!(p = xdr_decode_string_inplace(p, &lock->caller, in nlm4_decode_lock()
114 &lock->len, NLM_MAXSTRLEN)) in nlm4_decode_lock()
115 || !(p = nlm4_decode_fh(p, &lock->fh)) in nlm4_decode_lock()
116 || !(p = nlm4_decode_oh(p, &lock->oh))) in nlm4_decode_lock()
118 lock->svid = ntohl(*p++); in nlm4_decode_lock()
150 struct file_lock *fl = &resp->lock.fl; in nlm4_encode_testres()
153 *p++ = htonl(resp->lock.svid); in nlm4_encode_testres()
156 if (!(p = xdr_encode_netobj(p, &resp->lock.oh))) in nlm4_encode_testres()
[all …]
Dclnt4xdr.c65 static void nlm4_compute_offsets(const struct nlm_lock *lock, in nlm4_compute_offsets() argument
68 const struct file_lock *fl = &lock->fl; in nlm4_compute_offsets()
242 const struct nlm_lock *lock = &result->lock; in encode_nlm4_holder() local
246 encode_bool(xdr, lock->fl.fl_type == F_RDLCK); in encode_nlm4_holder()
247 encode_int32(xdr, lock->svid); in encode_nlm4_holder()
248 encode_netobj(xdr, lock->oh.data, lock->oh.len); in encode_nlm4_holder()
251 nlm4_compute_offsets(lock, &l_offset, &l_len); in encode_nlm4_holder()
258 struct nlm_lock *lock = &result->lock; in decode_nlm4_holder() local
259 struct file_lock *fl = &lock->fl; in decode_nlm4_holder()
266 memset(lock, 0, sizeof(*lock)); in decode_nlm4_holder()
[all …]
Dclntxdr.c61 static void nlm_compute_offsets(const struct nlm_lock *lock, in nlm_compute_offsets() argument
64 const struct file_lock *fl = &lock->fl; in nlm_compute_offsets()
237 const struct nlm_lock *lock = &result->lock; in encode_nlm_holder() local
241 encode_bool(xdr, lock->fl.fl_type == F_RDLCK); in encode_nlm_holder()
242 encode_int32(xdr, lock->svid); in encode_nlm_holder()
243 encode_netobj(xdr, lock->oh.data, lock->oh.len); in encode_nlm_holder()
246 nlm_compute_offsets(lock, &l_offset, &l_len); in encode_nlm_holder()
253 struct nlm_lock *lock = &result->lock; in decode_nlm_holder() local
254 struct file_lock *fl = &lock->fl; in decode_nlm_holder()
260 memset(lock, 0, sizeof(*lock)); in decode_nlm_holder()
[all …]
Dxdr.c115 nlm_decode_lock(__be32 *p, struct nlm_lock *lock) in nlm_decode_lock() argument
117 struct file_lock *fl = &lock->fl; in nlm_decode_lock()
120 if (!(p = xdr_decode_string_inplace(p, &lock->caller, in nlm_decode_lock()
121 &lock->len, in nlm_decode_lock()
123 || !(p = nlm_decode_fh(p, &lock->fh)) in nlm_decode_lock()
124 || !(p = nlm_decode_oh(p, &lock->oh))) in nlm_decode_lock()
126 lock->svid = ntohl(*p++); in nlm_decode_lock()
157 struct file_lock *fl = &resp->lock.fl; in nlm_encode_testres()
160 *p++ = htonl(resp->lock.svid); in nlm_encode_testres()
163 if (!(p = xdr_encode_netobj(p, &resp->lock.oh))) in nlm_encode_testres()
[all …]
/fs/btrfs/
Dlocking.c209 read_unlock(&eb->lock); in btrfs_set_lock_blocking_read()
234 write_unlock(&eb->lock); in btrfs_set_lock_blocking_write()
255 read_lock(&eb->lock); in __btrfs_tree_read_lock()
270 read_unlock(&eb->lock); in __btrfs_tree_read_lock()
274 read_unlock(&eb->lock); in __btrfs_tree_read_lock()
300 read_lock(&eb->lock); in btrfs_tree_read_lock_atomic()
303 read_unlock(&eb->lock); in btrfs_tree_read_lock_atomic()
322 if (!read_trylock(&eb->lock)) in btrfs_try_tree_read_lock()
327 read_unlock(&eb->lock); in btrfs_try_tree_read_lock()
347 write_lock(&eb->lock); in btrfs_try_tree_write_lock()
[all …]
Dspace-info.c203 spin_lock_init(&space_info->lock); in create_space_info()
270 spin_lock(&found->lock); in btrfs_update_space_info()
279 spin_unlock(&found->lock); in btrfs_update_space_info()
373 lockdep_assert_held(&space_info->lock); in btrfs_try_granting_tickets()
409 spin_lock(&__rsv->lock); \
412 spin_unlock(&__rsv->lock); \
418 lockdep_assert_held(&info->lock); in __btrfs_dump_space_info()
446 spin_lock(&info->lock); in btrfs_dump_space_info()
448 spin_unlock(&info->lock); in btrfs_dump_space_info()
456 spin_lock(&cache->lock); in btrfs_dump_space_info()
[all …]
Ddiscard.c102 spin_lock(&discard_ctl->lock); in add_to_discard_list()
104 spin_unlock(&discard_ctl->lock); in add_to_discard_list()
110 spin_lock(&discard_ctl->lock); in add_to_discard_unused_list()
113 spin_unlock(&discard_ctl->lock); in add_to_discard_unused_list()
126 spin_unlock(&discard_ctl->lock); in add_to_discard_unused_list()
134 spin_lock(&discard_ctl->lock); in remove_from_discard_list()
144 spin_unlock(&discard_ctl->lock); in remove_from_discard_list()
206 spin_lock(&discard_ctl->lock); in peek_discard_list()
229 spin_unlock(&discard_ctl->lock); in peek_discard_list()
388 spin_lock(&discard_ctl->lock); in btrfs_discard_schedule_work()
[all …]
Dblock-rsv.c111 spin_lock(&block_rsv->lock); in block_rsv_release_bytes()
132 spin_unlock(&block_rsv->lock); in block_rsv_release_bytes()
137 spin_lock(&dest->lock); in block_rsv_release_bytes()
148 spin_unlock(&dest->lock); in block_rsv_release_bytes()
177 spin_lock_init(&rsv->lock); in btrfs_init_block_rsv()
236 spin_lock(&block_rsv->lock); in btrfs_block_rsv_check()
240 spin_unlock(&block_rsv->lock); in btrfs_block_rsv_check()
255 spin_lock(&block_rsv->lock); in btrfs_block_rsv_refill()
261 spin_unlock(&block_rsv->lock); in btrfs_block_rsv_refill()
303 spin_lock(&block_rsv->lock); in btrfs_block_rsv_use_bytes()
[all …]
Dblock-group.c295 spin_lock(&bg->lock); in btrfs_inc_nocow_writers()
300 spin_unlock(&bg->lock); in btrfs_inc_nocow_writers()
372 spin_lock(&cache->lock); in btrfs_get_caching_control()
374 spin_unlock(&cache->lock); in btrfs_get_caching_control()
380 spin_unlock(&cache->lock); in btrfs_get_caching_control()
662 spin_lock(&block_group->lock); in caching_thread()
665 spin_unlock(&block_group->lock); in caching_thread()
671 spin_lock(&block_group->space_info->lock); in caching_thread()
672 spin_lock(&block_group->lock); in caching_thread()
675 spin_unlock(&block_group->lock); in caching_thread()
[all …]
/fs/nilfs2/
Dalloc.c131 spinlock_t *lock) in nilfs_palloc_group_desc_nfrees() argument
135 spin_lock(lock); in nilfs_palloc_group_desc_nfrees()
137 spin_unlock(lock); in nilfs_palloc_group_desc_nfrees()
149 spinlock_t *lock, u32 n) in nilfs_palloc_group_desc_add_entries() argument
153 spin_lock(lock); in nilfs_palloc_group_desc_add_entries()
156 spin_unlock(lock); in nilfs_palloc_group_desc_add_entries()
203 spinlock_t *lock) in nilfs_palloc_get_block() argument
207 spin_lock(lock); in nilfs_palloc_get_block()
212 spin_unlock(lock); in nilfs_palloc_get_block()
215 spin_unlock(lock); in nilfs_palloc_get_block()
[all …]
/fs/
Dfs_struct.c20 spin_lock(&fs->lock); in set_fs_root()
25 spin_unlock(&fs->lock); in set_fs_root()
39 spin_lock(&fs->lock); in set_fs_pwd()
44 spin_unlock(&fs->lock); in set_fs_pwd()
70 spin_lock(&fs->lock); in chroot_fs_refs()
79 spin_unlock(&fs->lock); in chroot_fs_refs()
102 spin_lock(&fs->lock); in exit_fs()
105 spin_unlock(&fs->lock); in exit_fs()
119 spin_lock_init(&fs->lock); in copy_fs_struct()
120 seqcount_spinlock_init(&fs->seq, &fs->lock); in copy_fs_struct()
[all …]
Deventfd.c63 spin_lock_irqsave(&ctx->wqh.lock, flags); in eventfd_signal_mask()
71 spin_unlock_irqrestore(&ctx->wqh.lock, flags); in eventfd_signal_mask()
192 lockdep_assert_held(&ctx->wqh.lock); in eventfd_ctx_do_read()
217 spin_lock_irqsave(&ctx->wqh.lock, flags); in eventfd_ctx_remove_wait_queue()
222 spin_unlock_irqrestore(&ctx->wqh.lock, flags); in eventfd_ctx_remove_wait_queue()
237 spin_lock_irq(&ctx->wqh.lock); in eventfd_read()
241 spin_unlock_irq(&ctx->wqh.lock); in eventfd_read()
252 spin_unlock_irq(&ctx->wqh.lock); in eventfd_read()
255 spin_unlock_irq(&ctx->wqh.lock); in eventfd_read()
257 spin_lock_irq(&ctx->wqh.lock); in eventfd_read()
[all …]
/fs/xfs/
Dxfs_mru_cache.c95 spinlock_t lock; /* Lock to protect this struct. */ member
230 __releases(mru->lock) __acquires(mru->lock) in _xfs_mru_cache_clear_reap_list()
247 spin_unlock(&mru->lock); in _xfs_mru_cache_clear_reap_list()
254 spin_lock(&mru->lock); in _xfs_mru_cache_clear_reap_list()
276 spin_lock(&mru->lock); in _xfs_mru_cache_reap()
290 spin_unlock(&mru->lock); in _xfs_mru_cache_reap()
357 spin_lock_init(&mru->lock); in xfs_mru_cache_create()
387 spin_lock(&mru->lock); in xfs_mru_cache_flush()
389 spin_unlock(&mru->lock); in xfs_mru_cache_flush()
391 spin_lock(&mru->lock); in xfs_mru_cache_flush()
[all …]
/fs/notify/
Dmark.c124 assert_spin_locked(&conn->lock); in __fsnotify_recalc_mask()
146 spin_lock(&conn->lock); in fsnotify_recalc_mask()
148 spin_unlock(&conn->lock); in fsnotify_recalc_mask()
245 if (!refcount_dec_and_lock(&mark->refcnt, &conn->lock)) in fsnotify_put_mark()
256 spin_unlock(&conn->lock); in fsnotify_put_mark()
294 spin_lock(&mark->lock); in fsnotify_get_mark_safe()
298 spin_unlock(&mark->lock); in fsnotify_get_mark_safe()
301 spin_unlock(&mark->lock); in fsnotify_get_mark_safe()
384 spin_lock(&mark->lock); in fsnotify_detach_mark()
387 spin_unlock(&mark->lock); in fsnotify_detach_mark()
[all …]
/fs/btrfs/tests/
Dextent-map-tests.c72 write_lock(&em_tree->lock); in test_case_1()
74 write_unlock(&em_tree->lock); in test_case_1()
93 write_lock(&em_tree->lock); in test_case_1()
95 write_unlock(&em_tree->lock); in test_case_1()
114 write_lock(&em_tree->lock); in test_case_1()
116 write_unlock(&em_tree->lock); in test_case_1()
160 write_lock(&em_tree->lock); in test_case_2()
162 write_unlock(&em_tree->lock); in test_case_2()
181 write_lock(&em_tree->lock); in test_case_2()
183 write_unlock(&em_tree->lock); in test_case_2()
[all …]
/fs/fuse/
Dvirtio_fs.c42 spinlock_t lock; member
184 spin_lock(&fsvq->lock); in virtio_fs_drain_queue()
190 spin_unlock(&fsvq->lock); in virtio_fs_drain_queue()
193 spin_unlock(&fsvq->lock); in virtio_fs_drain_queue()
231 spin_lock(&fsvq->lock); in virtio_fs_start_all_queues()
233 spin_unlock(&fsvq->lock); in virtio_fs_start_all_queues()
329 spin_lock(&fsvq->lock); in virtio_fs_hiprio_done_work()
341 spin_unlock(&fsvq->lock); in virtio_fs_hiprio_done_work()
353 spin_lock(&fsvq->lock); in virtio_fs_request_dispatch_work()
357 spin_unlock(&fsvq->lock); in virtio_fs_request_dispatch_work()
[all …]
/fs/orangefs/
Dwaitqueue.c23 __acquires(op->lock);
25 __releases(op->lock);
113 spin_lock(&op->lock); in service_operation()
126 spin_unlock(&op->lock); in service_operation()
155 spin_unlock(&op->lock); in service_operation()
228 spin_lock(&op->lock); in orangefs_cancel_op_in_progress()
237 spin_unlock(&op->lock); in orangefs_cancel_op_in_progress()
251 __releases(op->lock) in orangefs_clean_up_interrupted_operation()
269 spin_unlock(&op->lock); in orangefs_clean_up_interrupted_operation()
276 spin_unlock(&op->lock); in orangefs_clean_up_interrupted_operation()
[all …]

12345678910