Lines Matching refs:iclog

43 	struct xlog_in_core	*iclog);
50 struct xlog_in_core **iclog,
60 struct xlog_in_core *iclog,
69 struct xlog_in_core *iclog,
74 struct xlog_in_core *iclog);
526 struct xlog_in_core *iclog; in xlog_state_shutdown_callbacks() local
529 iclog = log->l_iclog; in xlog_state_shutdown_callbacks()
531 if (atomic_read(&iclog->ic_refcnt)) { in xlog_state_shutdown_callbacks()
535 list_splice_init(&iclog->ic_callbacks, &cb_list); in xlog_state_shutdown_callbacks()
541 wake_up_all(&iclog->ic_write_wait); in xlog_state_shutdown_callbacks()
542 wake_up_all(&iclog->ic_force_wait); in xlog_state_shutdown_callbacks()
543 } while ((iclog = iclog->ic_next) != log->l_iclog); in xlog_state_shutdown_callbacks()
571 struct xlog_in_core *iclog, in xlog_state_release_iclog() argument
579 trace_xlog_iclog_release(iclog, _RET_IP_); in xlog_state_release_iclog()
586 if ((iclog->ic_state == XLOG_STATE_WANT_SYNC || in xlog_state_release_iclog()
587 (iclog->ic_flags & XLOG_ICL_NEED_FUA)) && in xlog_state_release_iclog()
588 !iclog->ic_header.h_tail_lsn) { in xlog_state_release_iclog()
590 iclog->ic_header.h_tail_lsn = cpu_to_be64(tail_lsn); in xlog_state_release_iclog()
593 last_ref = atomic_dec_and_test(&iclog->ic_refcnt); in xlog_state_release_iclog()
609 if (iclog->ic_state != XLOG_STATE_WANT_SYNC) { in xlog_state_release_iclog()
610 ASSERT(iclog->ic_state == XLOG_STATE_ACTIVE); in xlog_state_release_iclog()
614 iclog->ic_state = XLOG_STATE_SYNCING; in xlog_state_release_iclog()
615 xlog_verify_tail_lsn(log, iclog); in xlog_state_release_iclog()
616 trace_xlog_iclog_syncing(iclog, _RET_IP_); in xlog_state_release_iclog()
619 xlog_sync(log, iclog, ticket); in xlog_state_release_iclog()
848 struct xlog_in_core *iclog) in xlog_force_iclog() argument
850 atomic_inc(&iclog->ic_refcnt); in xlog_force_iclog()
851 iclog->ic_flags |= XLOG_ICL_NEED_FLUSH | XLOG_ICL_NEED_FUA; in xlog_force_iclog()
852 if (iclog->ic_state == XLOG_STATE_ACTIVE) in xlog_force_iclog()
853 xlog_state_switch_iclogs(iclog->ic_log, iclog, 0); in xlog_force_iclog()
854 return xlog_state_release_iclog(iclog->ic_log, iclog, NULL); in xlog_force_iclog()
865 struct xlog_in_core *iclog = log->l_iclog; in xlog_wait_iclog_completion() local
868 down(&iclog->ic_sema); in xlog_wait_iclog_completion()
869 up(&iclog->ic_sema); in xlog_wait_iclog_completion()
870 iclog = iclog->ic_next; in xlog_wait_iclog_completion()
882 struct xlog_in_core *iclog) in xlog_wait_on_iclog() argument
883 __releases(iclog->ic_log->l_icloglock) in xlog_wait_on_iclog()
885 struct xlog *log = iclog->ic_log; in xlog_wait_on_iclog()
887 trace_xlog_iclog_wait_on(iclog, _RET_IP_); in xlog_wait_on_iclog()
889 iclog->ic_state != XLOG_STATE_ACTIVE && in xlog_wait_on_iclog()
890 iclog->ic_state != XLOG_STATE_DIRTY) { in xlog_wait_on_iclog()
892 xlog_wait(&iclog->ic_force_wait, &log->l_icloglock); in xlog_wait_on_iclog()
956 struct xlog_in_core *iclog; in xlog_unmount_write() local
974 iclog = log->l_iclog; in xlog_unmount_write()
975 error = xlog_force_iclog(iclog); in xlog_unmount_write()
976 xlog_wait_on_iclog(iclog); in xlog_unmount_write()
988 struct xlog_in_core *iclog = log->l_iclog; in xfs_log_unmount_verify_iclog() local
991 ASSERT(iclog->ic_state == XLOG_STATE_ACTIVE); in xfs_log_unmount_verify_iclog()
992 ASSERT(iclog->ic_offset == 0); in xfs_log_unmount_verify_iclog()
993 } while ((iclog = iclog->ic_next) != log->l_iclog); in xfs_log_unmount_verify_iclog()
1378 struct xlog_in_core *iclog = in xlog_ioend_work() local
1380 struct xlog *log = iclog->ic_log; in xlog_ioend_work()
1383 error = blk_status_to_errno(iclog->ic_bio.bi_status); in xlog_ioend_work()
1386 if (iclog->ic_fail_crc) in xlog_ioend_work()
1398 xlog_state_done_syncing(iclog); in xlog_ioend_work()
1399 bio_uninit(&iclog->ic_bio); in xlog_ioend_work()
1407 up(&iclog->ic_sema); in xlog_ioend_work()
1526 xlog_in_core_t *iclog, *prev_iclog=NULL; in xlog_alloc_log() local
1607 iclog = kmem_zalloc(sizeof(*iclog) + bvec_size, KM_MAYFAIL); in xlog_alloc_log()
1608 if (!iclog) in xlog_alloc_log()
1611 *iclogp = iclog; in xlog_alloc_log()
1612 iclog->ic_prev = prev_iclog; in xlog_alloc_log()
1613 prev_iclog = iclog; in xlog_alloc_log()
1615 iclog->ic_data = kvzalloc(log->l_iclog_size, in xlog_alloc_log()
1617 if (!iclog->ic_data) in xlog_alloc_log()
1619 head = &iclog->ic_header; in xlog_alloc_log()
1629 iclog->ic_size = log->l_iclog_size - log->l_iclog_hsize; in xlog_alloc_log()
1630 iclog->ic_state = XLOG_STATE_ACTIVE; in xlog_alloc_log()
1631 iclog->ic_log = log; in xlog_alloc_log()
1632 atomic_set(&iclog->ic_refcnt, 0); in xlog_alloc_log()
1633 INIT_LIST_HEAD(&iclog->ic_callbacks); in xlog_alloc_log()
1634 iclog->ic_datap = (void *)iclog->ic_data + log->l_iclog_hsize; in xlog_alloc_log()
1636 init_waitqueue_head(&iclog->ic_force_wait); in xlog_alloc_log()
1637 init_waitqueue_head(&iclog->ic_write_wait); in xlog_alloc_log()
1638 INIT_WORK(&iclog->ic_end_io_work, xlog_ioend_work); in xlog_alloc_log()
1639 sema_init(&iclog->ic_sema, 1); in xlog_alloc_log()
1641 iclogp = &iclog->ic_next; in xlog_alloc_log()
1661 for (iclog = log->l_iclog; iclog; iclog = prev_iclog) { in xlog_alloc_log()
1662 prev_iclog = iclog->ic_next; in xlog_alloc_log()
1663 kmem_free(iclog->ic_data); in xlog_alloc_log()
1664 kmem_free(iclog); in xlog_alloc_log()
1763 struct xlog_in_core *iclog, in xlog_pack_data() argument
1767 int size = iclog->ic_offset + roundoff; in xlog_pack_data()
1771 cycle_lsn = CYCLE_LSN_DISK(iclog->ic_header.h_lsn); in xlog_pack_data()
1773 dp = iclog->ic_datap; in xlog_pack_data()
1777 iclog->ic_header.h_cycle_data[i] = *(__be32 *)dp; in xlog_pack_data()
1783 xlog_in_core_2_t *xhdr = iclog->ic_data; in xlog_pack_data()
1842 struct xlog_in_core *iclog = bio->bi_private; in xlog_bio_end_io() local
1844 queue_work(iclog->ic_log->l_ioend_workqueue, in xlog_bio_end_io()
1845 &iclog->ic_end_io_work); in xlog_bio_end_io()
1872 struct xlog_in_core *iclog, in xlog_write_iclog() argument
1877 trace_xlog_iclog_write(iclog, _RET_IP_); in xlog_write_iclog()
1887 down(&iclog->ic_sema); in xlog_write_iclog()
1905 bio_init(&iclog->ic_bio, log->l_targ->bt_bdev, iclog->ic_bvec, in xlog_write_iclog()
1908 iclog->ic_bio.bi_iter.bi_sector = log->l_logBBstart + bno; in xlog_write_iclog()
1909 iclog->ic_bio.bi_end_io = xlog_bio_end_io; in xlog_write_iclog()
1910 iclog->ic_bio.bi_private = iclog; in xlog_write_iclog()
1912 if (iclog->ic_flags & XLOG_ICL_NEED_FLUSH) { in xlog_write_iclog()
1913 iclog->ic_bio.bi_opf |= REQ_PREFLUSH; in xlog_write_iclog()
1929 if (iclog->ic_flags & XLOG_ICL_NEED_FUA) in xlog_write_iclog()
1930 iclog->ic_bio.bi_opf |= REQ_FUA; in xlog_write_iclog()
1932 iclog->ic_flags &= ~(XLOG_ICL_NEED_FLUSH | XLOG_ICL_NEED_FUA); in xlog_write_iclog()
1934 if (xlog_map_iclog_data(&iclog->ic_bio, iclog->ic_data, count)) in xlog_write_iclog()
1937 if (is_vmalloc_addr(iclog->ic_data)) in xlog_write_iclog()
1938 flush_kernel_vmap_range(iclog->ic_data, count); in xlog_write_iclog()
1947 split = bio_split(&iclog->ic_bio, log->l_logBBsize - bno, in xlog_write_iclog()
1949 bio_chain(split, &iclog->ic_bio); in xlog_write_iclog()
1953 iclog->ic_bio.bi_iter.bi_sector = log->l_logBBstart; in xlog_write_iclog()
1956 submit_bio(&iclog->ic_bio); in xlog_write_iclog()
1961 xlog_state_done_syncing(iclog); in xlog_write_iclog()
1962 up(&iclog->ic_sema); in xlog_write_iclog()
1992 struct xlog_in_core *iclog, in xlog_calc_iclog_size() argument
1998 count_init = log->l_iclog_hsize + iclog->ic_offset; in xlog_calc_iclog_size()
2034 struct xlog_in_core *iclog, in xlog_sync() argument
2042 ASSERT(atomic_read(&iclog->ic_refcnt) == 0); in xlog_sync()
2043 trace_xlog_iclog_sync(iclog, _RET_IP_); in xlog_sync()
2045 count = xlog_calc_iclog_size(log, iclog, &roundoff); in xlog_sync()
2060 xlog_pack_data(log, iclog, roundoff); in xlog_sync()
2063 size = iclog->ic_offset; in xlog_sync()
2066 iclog->ic_header.h_len = cpu_to_be32(size); in xlog_sync()
2071 bno = BLOCK_LSN(be64_to_cpu(iclog->ic_header.h_lsn)); in xlog_sync()
2075 xlog_split_iclog(log, &iclog->ic_header, bno, count); in xlog_sync()
2078 iclog->ic_header.h_crc = xlog_cksum(log, &iclog->ic_header, in xlog_sync()
2079 iclog->ic_datap, size); in xlog_sync()
2089 iclog->ic_header.h_crc &= cpu_to_le32(0xAAAAAAAA); in xlog_sync()
2090 iclog->ic_fail_crc = true; in xlog_sync()
2093 be64_to_cpu(iclog->ic_header.h_lsn)); in xlog_sync()
2096 xlog_verify_iclog(log, iclog, count); in xlog_sync()
2097 xlog_write_iclog(log, iclog, bno, count); in xlog_sync()
2107 xlog_in_core_t *iclog, *next_iclog; in xlog_dealloc_log() local
2117 iclog = log->l_iclog; in xlog_dealloc_log()
2119 next_iclog = iclog->ic_next; in xlog_dealloc_log()
2120 kmem_free(iclog->ic_data); in xlog_dealloc_log()
2121 kmem_free(iclog); in xlog_dealloc_log()
2122 iclog = next_iclog; in xlog_dealloc_log()
2136 struct xlog_in_core *iclog, in xlog_state_finish_copy() argument
2142 be32_add_cpu(&iclog->ic_header.h_num_logops, record_cnt); in xlog_state_finish_copy()
2143 iclog->ic_offset += copy_bytes; in xlog_state_finish_copy()
2214 struct xlog_in_core *iclog, in xlog_write_iovec() argument
2222 ASSERT(*log_offset < iclog->ic_log->l_iclog_size); in xlog_write_iovec()
2226 memcpy(iclog->ic_datap + *log_offset, data, write_len); in xlog_write_iovec()
2241 struct xlog_in_core *iclog, in xlog_write_full() argument
2249 ASSERT(*log_offset + *len <= iclog->ic_size || in xlog_write_full()
2250 iclog->ic_state == XLOG_STATE_WANT_SYNC); in xlog_write_full()
2261 xlog_write_iovec(iclog, log_offset, reg->i_addr, in xlog_write_full()
2275 struct xlog_in_core *iclog = *iclogp; in xlog_write_get_more_iclog_space() local
2276 struct xlog *log = iclog->ic_log; in xlog_write_get_more_iclog_space()
2280 ASSERT(iclog->ic_state == XLOG_STATE_WANT_SYNC); in xlog_write_get_more_iclog_space()
2281 xlog_state_finish_copy(log, iclog, *record_cnt, *data_cnt); in xlog_write_get_more_iclog_space()
2282 error = xlog_state_release_iclog(log, iclog, ticket); in xlog_write_get_more_iclog_space()
2287 error = xlog_state_get_iclog_space(log, len, &iclog, ticket, in xlog_write_get_more_iclog_space()
2293 *iclogp = iclog; in xlog_write_get_more_iclog_space()
2313 struct xlog_in_core *iclog = *iclogp; in xlog_write_partial() local
2335 if (iclog->ic_size - *log_offset <= in xlog_write_partial()
2338 &iclog, log_offset, *len, record_cnt, in xlog_write_partial()
2345 rlen = min_t(uint32_t, reg->i_len, iclog->ic_size - *log_offset); in xlog_write_partial()
2352 xlog_write_iovec(iclog, log_offset, reg->i_addr, in xlog_write_partial()
2389 &iclog, log_offset, in xlog_write_partial()
2395 ophdr = iclog->ic_datap + *log_offset; in xlog_write_partial()
2411 if (rlen <= iclog->ic_size - *log_offset) in xlog_write_partial()
2416 rlen = min_t(uint32_t, rlen, iclog->ic_size - *log_offset); in xlog_write_partial()
2419 xlog_write_iovec(iclog, log_offset, in xlog_write_partial()
2430 *iclogp = iclog; in xlog_write_partial()
2483 struct xlog_in_core *iclog = NULL; in xlog_write() local
2497 error = xlog_state_get_iclog_space(log, len, &iclog, ticket, in xlog_write()
2502 ASSERT(log_offset <= iclog->ic_size - 1); in xlog_write()
2510 xlog_cil_set_ctx_write_state(ctx, iclog); in xlog_write()
2518 lv->lv_bytes > iclog->ic_size - log_offset) { in xlog_write()
2519 error = xlog_write_partial(lv, ticket, &iclog, in xlog_write()
2530 xlog_write_full(lv, ticket, iclog, &log_offset, in xlog_write()
2543 xlog_state_finish_copy(log, iclog, record_cnt, 0); in xlog_write()
2544 error = xlog_state_release_iclog(log, iclog, ticket); in xlog_write()
2552 struct xlog_in_core *iclog, in xlog_state_activate_iclog() argument
2555 ASSERT(list_empty_careful(&iclog->ic_callbacks)); in xlog_state_activate_iclog()
2556 trace_xlog_iclog_activate(iclog, _RET_IP_); in xlog_state_activate_iclog()
2565 iclog->ic_header.h_num_logops == cpu_to_be32(XLOG_COVER_OPS)) { in xlog_state_activate_iclog()
2575 iclog->ic_state = XLOG_STATE_ACTIVE; in xlog_state_activate_iclog()
2576 iclog->ic_offset = 0; in xlog_state_activate_iclog()
2577 iclog->ic_header.h_num_logops = 0; in xlog_state_activate_iclog()
2578 memset(iclog->ic_header.h_cycle_data, 0, in xlog_state_activate_iclog()
2579 sizeof(iclog->ic_header.h_cycle_data)); in xlog_state_activate_iclog()
2580 iclog->ic_header.h_lsn = 0; in xlog_state_activate_iclog()
2581 iclog->ic_header.h_tail_lsn = 0; in xlog_state_activate_iclog()
2593 struct xlog_in_core *iclog = log->l_iclog; in xlog_state_activate_iclogs() local
2596 if (iclog->ic_state == XLOG_STATE_DIRTY) in xlog_state_activate_iclogs()
2597 xlog_state_activate_iclog(iclog, iclogs_changed); in xlog_state_activate_iclogs()
2602 else if (iclog->ic_state != XLOG_STATE_ACTIVE) in xlog_state_activate_iclogs()
2604 } while ((iclog = iclog->ic_next) != log->l_iclog); in xlog_state_activate_iclogs()
2665 struct xlog_in_core *iclog = log->l_iclog; in xlog_get_lowest_lsn() local
2669 if (iclog->ic_state == XLOG_STATE_ACTIVE || in xlog_get_lowest_lsn()
2670 iclog->ic_state == XLOG_STATE_DIRTY) in xlog_get_lowest_lsn()
2673 lsn = be64_to_cpu(iclog->ic_header.h_lsn); in xlog_get_lowest_lsn()
2676 } while ((iclog = iclog->ic_next) != log->l_iclog); in xlog_get_lowest_lsn()
2706 struct xlog_in_core *iclog, in xlog_state_set_callback() argument
2709 trace_xlog_iclog_callback(iclog, _RET_IP_); in xlog_state_set_callback()
2710 iclog->ic_state = XLOG_STATE_CALLBACK; in xlog_state_set_callback()
2715 if (list_empty_careful(&iclog->ic_callbacks)) in xlog_state_set_callback()
2730 struct xlog_in_core *iclog) in xlog_state_iodone_process_iclog() argument
2735 switch (iclog->ic_state) { in xlog_state_iodone_process_iclog()
2749 header_lsn = be64_to_cpu(iclog->ic_header.h_lsn); in xlog_state_iodone_process_iclog()
2753 xlog_state_set_callback(log, iclog, header_lsn); in xlog_state_iodone_process_iclog()
2779 struct xlog_in_core *iclog = first_iclog; in xlog_state_do_iclog_callbacks() local
2785 if (xlog_state_iodone_process_iclog(log, iclog)) in xlog_state_do_iclog_callbacks()
2787 if (iclog->ic_state != XLOG_STATE_CALLBACK) { in xlog_state_do_iclog_callbacks()
2788 iclog = iclog->ic_next; in xlog_state_do_iclog_callbacks()
2791 list_splice_init(&iclog->ic_callbacks, &cb_list); in xlog_state_do_iclog_callbacks()
2794 trace_xlog_iclog_callbacks_start(iclog, _RET_IP_); in xlog_state_do_iclog_callbacks()
2796 trace_xlog_iclog_callbacks_done(iclog, _RET_IP_); in xlog_state_do_iclog_callbacks()
2800 xlog_state_clean_iclog(log, iclog); in xlog_state_do_iclog_callbacks()
2801 iclog = iclog->ic_next; in xlog_state_do_iclog_callbacks()
2802 } while (iclog != first_iclog); in xlog_state_do_iclog_callbacks()
2848 struct xlog_in_core *iclog) in xlog_state_done_syncing() argument
2850 struct xlog *log = iclog->ic_log; in xlog_state_done_syncing()
2853 ASSERT(atomic_read(&iclog->ic_refcnt) == 0); in xlog_state_done_syncing()
2854 trace_xlog_iclog_sync_done(iclog, _RET_IP_); in xlog_state_done_syncing()
2862 ASSERT(iclog->ic_state == XLOG_STATE_SYNCING); in xlog_state_done_syncing()
2863 iclog->ic_state = XLOG_STATE_DONE_SYNC; in xlog_state_done_syncing()
2871 wake_up_all(&iclog->ic_write_wait); in xlog_state_done_syncing()
2904 xlog_in_core_t *iclog; in xlog_state_get_iclog_space() local
2913 iclog = log->l_iclog; in xlog_state_get_iclog_space()
2914 if (iclog->ic_state != XLOG_STATE_ACTIVE) { in xlog_state_get_iclog_space()
2922 head = &iclog->ic_header; in xlog_state_get_iclog_space()
2924 atomic_inc(&iclog->ic_refcnt); /* prevents sync */ in xlog_state_get_iclog_space()
2925 log_offset = iclog->ic_offset; in xlog_state_get_iclog_space()
2927 trace_xlog_iclog_get_space(iclog, _RET_IP_); in xlog_state_get_iclog_space()
2951 if (iclog->ic_size - iclog->ic_offset < 2*sizeof(xlog_op_header_t)) { in xlog_state_get_iclog_space()
2954 xlog_state_switch_iclogs(log, iclog, iclog->ic_size); in xlog_state_get_iclog_space()
2963 if (!atomic_add_unless(&iclog->ic_refcnt, -1, 1)) in xlog_state_get_iclog_space()
2964 error = xlog_state_release_iclog(log, iclog, ticket); in xlog_state_get_iclog_space()
2977 if (len <= iclog->ic_size - iclog->ic_offset) in xlog_state_get_iclog_space()
2978 iclog->ic_offset += len; in xlog_state_get_iclog_space()
2980 xlog_state_switch_iclogs(log, iclog, iclog->ic_size); in xlog_state_get_iclog_space()
2981 *iclogp = iclog; in xlog_state_get_iclog_space()
2983 ASSERT(iclog->ic_offset <= iclog->ic_size); in xlog_state_get_iclog_space()
3081 struct xlog_in_core *iclog, in xlog_state_switch_iclogs() argument
3084 ASSERT(iclog->ic_state == XLOG_STATE_ACTIVE); in xlog_state_switch_iclogs()
3086 trace_xlog_iclog_switch(iclog, _RET_IP_); in xlog_state_switch_iclogs()
3089 eventual_size = iclog->ic_offset; in xlog_state_switch_iclogs()
3090 iclog->ic_state = XLOG_STATE_WANT_SYNC; in xlog_state_switch_iclogs()
3091 iclog->ic_header.h_prev_block = cpu_to_be32(log->l_prev_block); in xlog_state_switch_iclogs()
3119 ASSERT(iclog == log->l_iclog); in xlog_state_switch_iclogs()
3120 log->l_iclog = iclog->ic_next; in xlog_state_switch_iclogs()
3132 struct xlog_in_core *iclog, in xlog_force_and_check_iclog() argument
3135 xfs_lsn_t lsn = be64_to_cpu(iclog->ic_header.h_lsn); in xlog_force_and_check_iclog()
3139 error = xlog_force_iclog(iclog); in xlog_force_and_check_iclog()
3147 if (be64_to_cpu(iclog->ic_header.h_lsn) != lsn) in xlog_force_and_check_iclog()
3185 struct xlog_in_core *iclog; in xfs_log_force() local
3196 iclog = log->l_iclog; in xfs_log_force()
3197 trace_xlog_iclog_force(iclog, _RET_IP_); in xfs_log_force()
3199 if (iclog->ic_state == XLOG_STATE_DIRTY || in xfs_log_force()
3200 (iclog->ic_state == XLOG_STATE_ACTIVE && in xfs_log_force()
3201 atomic_read(&iclog->ic_refcnt) == 0 && iclog->ic_offset == 0)) { in xfs_log_force()
3210 iclog = iclog->ic_prev; in xfs_log_force()
3211 } else if (iclog->ic_state == XLOG_STATE_ACTIVE) { in xfs_log_force()
3212 if (atomic_read(&iclog->ic_refcnt) == 0) { in xfs_log_force()
3216 if (xlog_force_and_check_iclog(iclog, &completed)) in xfs_log_force()
3227 xlog_state_switch_iclogs(log, iclog, 0); in xfs_log_force()
3237 if (iclog->ic_state == XLOG_STATE_WANT_SYNC) in xfs_log_force()
3238 iclog->ic_flags |= XLOG_ICL_NEED_FLUSH | XLOG_ICL_NEED_FUA; in xfs_log_force()
3241 return xlog_wait_on_iclog(iclog); in xfs_log_force()
3272 struct xlog_in_core *iclog; in xlog_force_lsn() local
3279 iclog = log->l_iclog; in xlog_force_lsn()
3280 while (be64_to_cpu(iclog->ic_header.h_lsn) != lsn) { in xlog_force_lsn()
3281 trace_xlog_iclog_force_lsn(iclog, _RET_IP_); in xlog_force_lsn()
3282 iclog = iclog->ic_next; in xlog_force_lsn()
3283 if (iclog == log->l_iclog) in xlog_force_lsn()
3287 switch (iclog->ic_state) { in xlog_force_lsn()
3305 (iclog->ic_prev->ic_state == XLOG_STATE_WANT_SYNC || in xlog_force_lsn()
3306 iclog->ic_prev->ic_state == XLOG_STATE_SYNCING)) { in xlog_force_lsn()
3307 xlog_wait(&iclog->ic_prev->ic_write_wait, in xlog_force_lsn()
3311 if (xlog_force_and_check_iclog(iclog, &completed)) in xlog_force_lsn()
3326 iclog->ic_flags |= XLOG_ICL_NEED_FLUSH | XLOG_ICL_NEED_FUA; in xlog_force_lsn()
3339 return xlog_wait_on_iclog(iclog); in xlog_force_lsn()
3577 struct xlog_in_core *iclog) in xlog_verify_tail_lsn() argument
3579 xfs_lsn_t tail_lsn = be64_to_cpu(iclog->ic_header.h_tail_lsn); in xlog_verify_tail_lsn()
3585 if (blocks < BTOBB(iclog->ic_offset)+BTOBB(log->l_iclog_hsize)) in xlog_verify_tail_lsn()
3594 if (blocks < BTOBB(iclog->ic_offset) + 1) in xlog_verify_tail_lsn()
3617 struct xlog_in_core *iclog, in xlog_verify_iclog() argument
3640 if (iclog->ic_header.h_magicno != cpu_to_be32(XLOG_HEADER_MAGIC_NUM)) in xlog_verify_iclog()
3643 base_ptr = ptr = &iclog->ic_header; in xlog_verify_iclog()
3644 p = &iclog->ic_header; in xlog_verify_iclog()
3652 len = be32_to_cpu(iclog->ic_header.h_num_logops); in xlog_verify_iclog()
3653 base_ptr = ptr = iclog->ic_datap; in xlog_verify_iclog()
3655 xhdr = iclog->ic_data; in xlog_verify_iclog()
3665 idx = BTOBBT((void *)&ophead->oh_clientid - iclog->ic_datap); in xlog_verify_iclog()
3673 iclog->ic_header.h_cycle_data[idx]); in xlog_verify_iclog()
3689 idx = BTOBBT((void *)&ophead->oh_len - iclog->ic_datap); in xlog_verify_iclog()
3695 op_len = be32_to_cpu(iclog->ic_header.h_cycle_data[idx]); in xlog_verify_iclog()
3815 xlog_in_core_t *iclog; in xlog_iclogs_empty() local
3817 iclog = log->l_iclog; in xlog_iclogs_empty()
3822 if (iclog->ic_header.h_num_logops) in xlog_iclogs_empty()
3824 iclog = iclog->ic_next; in xlog_iclogs_empty()
3825 } while (iclog != log->l_iclog); in xlog_iclogs_empty()