Lines Matching refs:head
36 atomic64_t *head);
96 atomic64_t *head, in xlog_grant_sub_space() argument
99 int64_t head_val = atomic64_read(head); in xlog_grant_sub_space()
115 head_val = atomic64_cmpxchg(head, old, new); in xlog_grant_sub_space()
122 atomic64_t *head, in xlog_grant_add_space() argument
125 int64_t head_val = atomic64_read(head); in xlog_grant_add_space()
144 head_val = atomic64_cmpxchg(head, old, new); in xlog_grant_add_space()
150 struct xlog_grant_head *head) in xlog_grant_head_init() argument
152 xlog_assign_grant_head(&head->grant, 1, 0); in xlog_grant_head_init()
153 INIT_LIST_HEAD(&head->waiters); in xlog_grant_head_init()
154 spin_lock_init(&head->lock); in xlog_grant_head_init()
159 struct xlog_grant_head *head) in xlog_grant_head_wake_all() argument
163 spin_lock(&head->lock); in xlog_grant_head_wake_all()
164 list_for_each_entry(tic, &head->waiters, t_queue) in xlog_grant_head_wake_all()
166 spin_unlock(&head->lock); in xlog_grant_head_wake_all()
172 struct xlog_grant_head *head, in xlog_ticket_reservation() argument
175 if (head == &log->l_write_head) { in xlog_ticket_reservation()
189 struct xlog_grant_head *head, in xlog_grant_head_wake() argument
196 list_for_each_entry(tic, &head->waiters, t_queue) { in xlog_grant_head_wake()
219 need_bytes = xlog_ticket_reservation(log, head, tic); in xlog_grant_head_wake()
238 struct xlog_grant_head *head, in xlog_grant_head_wait() argument
240 int need_bytes) __releases(&head->lock) in xlog_grant_head_wait()
241 __acquires(&head->lock) in xlog_grant_head_wait()
243 list_add_tail(&tic->t_queue, &head->waiters); in xlog_grant_head_wait()
251 spin_unlock(&head->lock); in xlog_grant_head_wait()
259 spin_lock(&head->lock); in xlog_grant_head_wait()
262 } while (xlog_space_left(log, &head->grant) < need_bytes); in xlog_grant_head_wait()
291 struct xlog_grant_head *head, in xlog_grant_head_check() argument
306 *need_bytes = xlog_ticket_reservation(log, head, tic); in xlog_grant_head_check()
307 free_bytes = xlog_space_left(log, &head->grant); in xlog_grant_head_check()
308 if (!list_empty_careful(&head->waiters)) { in xlog_grant_head_check()
309 spin_lock(&head->lock); in xlog_grant_head_check()
310 if (!xlog_grant_head_wake(log, head, &free_bytes) || in xlog_grant_head_check()
312 error = xlog_grant_head_wait(log, head, tic, in xlog_grant_head_check()
315 spin_unlock(&head->lock); in xlog_grant_head_check()
317 spin_lock(&head->lock); in xlog_grant_head_check()
318 error = xlog_grant_head_wait(log, head, tic, *need_bytes); in xlog_grant_head_check()
319 spin_unlock(&head->lock); in xlog_grant_head_check()
1305 atomic64_t *head) in xlog_space_left() argument
1312 xlog_crack_grant_head(head, &head_cycle, &head_bytes); in xlog_space_left()
1493 xlog_rec_header_t *head; in xlog_alloc_log() local
1591 head = &iclog->ic_header; in xlog_alloc_log()
1592 memset(head, 0, sizeof(xlog_rec_header_t)); in xlog_alloc_log()
1593 head->h_magicno = cpu_to_be32(XLOG_HEADER_MAGIC_NUM); in xlog_alloc_log()
1594 head->h_version = cpu_to_be32( in xlog_alloc_log()
1596 head->h_size = cpu_to_be32(log->l_iclog_size); in xlog_alloc_log()
1598 head->h_fmt = cpu_to_be32(XLOG_FMT); in xlog_alloc_log()
1599 memcpy(&head->h_fs_uuid, &mp->m_sb.sb_uuid, sizeof(uuid_t)); in xlog_alloc_log()
2984 xlog_rec_header_t *head; in xlog_state_get_iclog_space() local
3003 head = &iclog->ic_header; in xlog_state_get_iclog_space()
3020 head->h_cycle = cpu_to_be32(log->l_curr_cycle); in xlog_state_get_iclog_space()
3021 head->h_lsn = cpu_to_be64( in xlog_state_get_iclog_space()