Lines Matching refs:mw
448 struct ocfs2_mask_waiter *mw, int ret) in ocfs2_update_lock_stats() argument
461 kt = ktime_sub(ktime_get(), mw->mw_lock_start); in ocfs2_update_lock_stats()
484 static inline void ocfs2_init_start_time(struct ocfs2_mask_waiter *mw) in ocfs2_init_start_time() argument
486 mw->mw_lock_start = ktime_get(); in ocfs2_init_start_time()
493 int level, struct ocfs2_mask_waiter *mw, int ret) in ocfs2_update_lock_stats() argument
499 static inline void ocfs2_init_start_time(struct ocfs2_mask_waiter *mw) in ocfs2_init_start_time() argument
880 struct ocfs2_mask_waiter *mw, *tmp; in lockres_set_flags() local
886 list_for_each_entry_safe(mw, tmp, &lockres->l_mask_waiters, mw_item) { in lockres_set_flags()
887 if ((lockres->l_flags & mw->mw_mask) != mw->mw_goal) in lockres_set_flags()
890 list_del_init(&mw->mw_item); in lockres_set_flags()
891 mw->mw_status = 0; in lockres_set_flags()
892 complete(&mw->mw_complete); in lockres_set_flags()
1377 static void ocfs2_init_mask_waiter(struct ocfs2_mask_waiter *mw) in ocfs2_init_mask_waiter() argument
1379 INIT_LIST_HEAD(&mw->mw_item); in ocfs2_init_mask_waiter()
1380 init_completion(&mw->mw_complete); in ocfs2_init_mask_waiter()
1381 ocfs2_init_start_time(mw); in ocfs2_init_mask_waiter()
1384 static int ocfs2_wait_for_mask(struct ocfs2_mask_waiter *mw) in ocfs2_wait_for_mask() argument
1386 wait_for_completion(&mw->mw_complete); in ocfs2_wait_for_mask()
1388 reinit_completion(&mw->mw_complete); in ocfs2_wait_for_mask()
1389 return mw->mw_status; in ocfs2_wait_for_mask()
1393 struct ocfs2_mask_waiter *mw, in lockres_add_mask_waiter() argument
1397 BUG_ON(!list_empty(&mw->mw_item)); in lockres_add_mask_waiter()
1401 list_add_tail(&mw->mw_item, &lockres->l_mask_waiters); in lockres_add_mask_waiter()
1402 mw->mw_mask = mask; in lockres_add_mask_waiter()
1403 mw->mw_goal = goal; in lockres_add_mask_waiter()
1409 struct ocfs2_mask_waiter *mw) in __lockres_remove_mask_waiter() argument
1414 if (!list_empty(&mw->mw_item)) { in __lockres_remove_mask_waiter()
1415 if ((lockres->l_flags & mw->mw_mask) != mw->mw_goal) in __lockres_remove_mask_waiter()
1418 list_del_init(&mw->mw_item); in __lockres_remove_mask_waiter()
1419 init_completion(&mw->mw_complete); in __lockres_remove_mask_waiter()
1426 struct ocfs2_mask_waiter *mw) in lockres_remove_mask_waiter() argument
1432 ret = __lockres_remove_mask_waiter(lockres, mw); in lockres_remove_mask_waiter()
1439 static int ocfs2_wait_for_mask_interruptible(struct ocfs2_mask_waiter *mw, in ocfs2_wait_for_mask_interruptible() argument
1444 ret = wait_for_completion_interruptible(&mw->mw_complete); in ocfs2_wait_for_mask_interruptible()
1446 lockres_remove_mask_waiter(lockres, mw); in ocfs2_wait_for_mask_interruptible()
1448 ret = mw->mw_status; in ocfs2_wait_for_mask_interruptible()
1450 reinit_completion(&mw->mw_complete); in ocfs2_wait_for_mask_interruptible()
1462 struct ocfs2_mask_waiter mw; in __ocfs2_cluster_lock() local
1476 ocfs2_init_mask_waiter(&mw); in __ocfs2_cluster_lock()
1502 lockres_add_mask_waiter(lockres, &mw, OCFS2_LOCK_BUSY, 0); in __ocfs2_cluster_lock()
1530 lockres_add_mask_waiter(lockres, &mw, OCFS2_LOCK_BLOCKED, 0); in __ocfs2_cluster_lock()
1620 mw.mw_mask & (OCFS2_LOCK_BUSY|OCFS2_LOCK_BLOCKED)) { in __ocfs2_cluster_lock()
1623 if (__lockres_remove_mask_waiter(lockres, &mw)) { in __ocfs2_cluster_lock()
1635 ret = ocfs2_wait_for_mask(&mw); in __ocfs2_cluster_lock()
1640 ocfs2_update_lock_stats(lockres, level, &mw, ret); in __ocfs2_cluster_lock()
1897 struct ocfs2_mask_waiter mw; in ocfs2_flock_handle_signal() local
1899 ocfs2_init_mask_waiter(&mw); in ocfs2_flock_handle_signal()
1914 lockres_add_mask_waiter(lockres, &mw, OCFS2_LOCK_BUSY, 0); in ocfs2_flock_handle_signal()
1917 ocfs2_wait_for_mask(&mw); in ocfs2_flock_handle_signal()
1967 struct ocfs2_mask_waiter mw; in ocfs2_file_lock() local
1969 ocfs2_init_mask_waiter(&mw); in ocfs2_file_lock()
1982 lockres_add_mask_waiter(lockres, &mw, OCFS2_LOCK_BUSY, 0); in ocfs2_file_lock()
1995 ret = ocfs2_wait_for_mask(&mw); in ocfs2_file_lock()
2008 lockres_add_mask_waiter(lockres, &mw, OCFS2_LOCK_BUSY, 0); in ocfs2_file_lock()
2020 lockres_remove_mask_waiter(lockres, &mw); in ocfs2_file_lock()
2024 ret = ocfs2_wait_for_mask_interruptible(&mw, lockres); in ocfs2_file_lock()
2063 struct ocfs2_mask_waiter mw; in ocfs2_file_unlock() local
2065 ocfs2_init_mask_waiter(&mw); in ocfs2_file_unlock()
2085 lockres_add_mask_waiter(lockres, &mw, OCFS2_LOCK_BUSY, 0); in ocfs2_file_unlock()
2094 ret = ocfs2_wait_for_mask(&mw); in ocfs2_file_unlock()
3474 struct ocfs2_mask_waiter mw; in ocfs2_mark_lockres_freeing() local
3477 ocfs2_init_mask_waiter(&mw); in ocfs2_mark_lockres_freeing()
3516 lockres_add_mask_waiter(lockres, &mw, OCFS2_LOCK_QUEUED, 0); in ocfs2_mark_lockres_freeing()
3521 status = ocfs2_wait_for_mask(&mw); in ocfs2_mark_lockres_freeing()