Lines Matching refs:dr
42 struct xfs_defer_drain *dr) in xfs_defer_drain_init() argument
44 atomic_set(&dr->dr_count, 0); in xfs_defer_drain_init()
45 init_waitqueue_head(&dr->dr_waiters); in xfs_defer_drain_init()
49 xfs_defer_drain_free(struct xfs_defer_drain *dr) in xfs_defer_drain_free() argument
51 ASSERT(atomic_read(&dr->dr_count) == 0); in xfs_defer_drain_free()
55 static inline void xfs_defer_drain_grab(struct xfs_defer_drain *dr) in xfs_defer_drain_grab() argument
57 atomic_inc(&dr->dr_count); in xfs_defer_drain_grab()
71 static inline void xfs_defer_drain_rele(struct xfs_defer_drain *dr) in xfs_defer_drain_rele() argument
73 if (atomic_dec_and_test(&dr->dr_count) && in xfs_defer_drain_rele()
75 has_waiters(&dr->dr_waiters)) in xfs_defer_drain_rele()
76 wake_up(&dr->dr_waiters); in xfs_defer_drain_rele()
80 static inline bool xfs_defer_drain_busy(struct xfs_defer_drain *dr) in xfs_defer_drain_busy() argument
82 return atomic_read(&dr->dr_count) > 0; in xfs_defer_drain_busy()
91 static inline int xfs_defer_drain_wait(struct xfs_defer_drain *dr) in xfs_defer_drain_wait() argument
93 return wait_event_killable(dr->dr_waiters, !xfs_defer_drain_busy(dr)); in xfs_defer_drain_wait()