@@ -534,8 +534,8 @@ xlog_state_release_iclog(
534534 */
535535 if ((iclog -> ic_state == XLOG_STATE_WANT_SYNC ||
536536 (iclog -> ic_flags & XLOG_ICL_NEED_FUA )) &&
537- !iclog -> ic_header . h_tail_lsn ) {
538- iclog -> ic_header . h_tail_lsn =
537+ !iclog -> ic_header -> h_tail_lsn ) {
538+ iclog -> ic_header -> h_tail_lsn =
539539 cpu_to_be64 (atomic64_read (& log -> l_tail_lsn ));
540540 }
541541
@@ -1457,11 +1457,11 @@ xlog_alloc_log(
14571457 iclog -> ic_prev = prev_iclog ;
14581458 prev_iclog = iclog ;
14591459
1460- iclog -> ic_data = kvzalloc (log -> l_iclog_size ,
1460+ iclog -> ic_header = kvzalloc (log -> l_iclog_size ,
14611461 GFP_KERNEL | __GFP_RETRY_MAYFAIL );
1462- if (!iclog -> ic_data )
1462+ if (!iclog -> ic_header )
14631463 goto out_free_iclog ;
1464- head = & iclog -> ic_header ;
1464+ head = iclog -> ic_header ;
14651465 memset (head , 0 , sizeof (xlog_rec_header_t ));
14661466 head -> h_magicno = cpu_to_be32 (XLOG_HEADER_MAGIC_NUM );
14671467 head -> h_version = cpu_to_be32 (
@@ -1476,7 +1476,7 @@ xlog_alloc_log(
14761476 iclog -> ic_log = log ;
14771477 atomic_set (& iclog -> ic_refcnt , 0 );
14781478 INIT_LIST_HEAD (& iclog -> ic_callbacks );
1479- iclog -> ic_datap = (void * )iclog -> ic_data + log -> l_iclog_hsize ;
1479+ iclog -> ic_datap = (void * )iclog -> ic_header + log -> l_iclog_hsize ;
14801480
14811481 init_waitqueue_head (& iclog -> ic_force_wait );
14821482 init_waitqueue_head (& iclog -> ic_write_wait );
@@ -1504,7 +1504,7 @@ xlog_alloc_log(
15041504out_free_iclog :
15051505 for (iclog = log -> l_iclog ; iclog ; iclog = prev_iclog ) {
15061506 prev_iclog = iclog -> ic_next ;
1507- kvfree (iclog -> ic_data );
1507+ kvfree (iclog -> ic_header );
15081508 kfree (iclog );
15091509 if (prev_iclog == log -> l_iclog )
15101510 break ;
@@ -1524,7 +1524,7 @@ xlog_pack_data(
15241524 struct xlog_in_core * iclog ,
15251525 int roundoff )
15261526{
1527- struct xlog_rec_header * rhead = & iclog -> ic_header ;
1527+ struct xlog_rec_header * rhead = iclog -> ic_header ;
15281528 __be32 cycle_lsn = CYCLE_LSN_DISK (rhead -> h_lsn );
15291529 char * dp = iclog -> ic_datap ;
15301530 int i ;
@@ -1536,7 +1536,7 @@ xlog_pack_data(
15361536 }
15371537
15381538 if (xfs_has_logv2 (log -> l_mp )) {
1539- xlog_in_core_2_t * xhdr = iclog -> ic_data ;
1539+ xlog_in_core_2_t * xhdr = ( xlog_in_core_2_t * ) iclog -> ic_header ;
15401540
15411541 for (i = 1 ; i < log -> l_iclog_heads ; i ++ )
15421542 xhdr [i ].hic_xheader .xh_cycle = cycle_lsn ;
@@ -1658,11 +1658,11 @@ xlog_write_iclog(
16581658
16591659 iclog -> ic_flags &= ~(XLOG_ICL_NEED_FLUSH | XLOG_ICL_NEED_FUA );
16601660
1661- if (is_vmalloc_addr (iclog -> ic_data )) {
1662- if (!bio_add_vmalloc (& iclog -> ic_bio , iclog -> ic_data , count ))
1661+ if (is_vmalloc_addr (iclog -> ic_header )) {
1662+ if (!bio_add_vmalloc (& iclog -> ic_bio , iclog -> ic_header , count ))
16631663 goto shutdown ;
16641664 } else {
1665- bio_add_virt_nofail (& iclog -> ic_bio , iclog -> ic_data , count );
1665+ bio_add_virt_nofail (& iclog -> ic_bio , iclog -> ic_header , count );
16661666 }
16671667
16681668 /*
@@ -1791,19 +1791,19 @@ xlog_sync(
17911791 size = iclog -> ic_offset ;
17921792 if (xfs_has_logv2 (log -> l_mp ))
17931793 size += roundoff ;
1794- iclog -> ic_header . h_len = cpu_to_be32 (size );
1794+ iclog -> ic_header -> h_len = cpu_to_be32 (size );
17951795
17961796 XFS_STATS_INC (log -> l_mp , xs_log_writes );
17971797 XFS_STATS_ADD (log -> l_mp , xs_log_blocks , BTOBB (count ));
17981798
1799- bno = BLOCK_LSN (be64_to_cpu (iclog -> ic_header . h_lsn ));
1799+ bno = BLOCK_LSN (be64_to_cpu (iclog -> ic_header -> h_lsn ));
18001800
18011801 /* Do we need to split this write into 2 parts? */
18021802 if (bno + BTOBB (count ) > log -> l_logBBsize )
1803- xlog_split_iclog (log , & iclog -> ic_header , bno , count );
1803+ xlog_split_iclog (log , iclog -> ic_header , bno , count );
18041804
18051805 /* calculcate the checksum */
1806- iclog -> ic_header . h_crc = xlog_cksum (log , & iclog -> ic_header ,
1806+ iclog -> ic_header -> h_crc = xlog_cksum (log , iclog -> ic_header ,
18071807 iclog -> ic_datap , XLOG_REC_SIZE , size );
18081808 /*
18091809 * Intentionally corrupt the log record CRC based on the error injection
@@ -1814,11 +1814,11 @@ xlog_sync(
18141814 */
18151815#ifdef DEBUG
18161816 if (XFS_TEST_ERROR (log -> l_mp , XFS_ERRTAG_LOG_BAD_CRC )) {
1817- iclog -> ic_header . h_crc &= cpu_to_le32 (0xAAAAAAAA );
1817+ iclog -> ic_header -> h_crc &= cpu_to_le32 (0xAAAAAAAA );
18181818 iclog -> ic_fail_crc = true;
18191819 xfs_warn (log -> l_mp ,
18201820 "Intentionally corrupted log record at LSN 0x%llx. Shutdown imminent." ,
1821- be64_to_cpu (iclog -> ic_header . h_lsn ));
1821+ be64_to_cpu (iclog -> ic_header -> h_lsn ));
18221822 }
18231823#endif
18241824 xlog_verify_iclog (log , iclog , count );
@@ -1845,7 +1845,7 @@ xlog_dealloc_log(
18451845 iclog = log -> l_iclog ;
18461846 for (i = 0 ; i < log -> l_iclog_bufs ; i ++ ) {
18471847 next_iclog = iclog -> ic_next ;
1848- kvfree (iclog -> ic_data );
1848+ kvfree (iclog -> ic_header );
18491849 kfree (iclog );
18501850 iclog = next_iclog ;
18511851 }
@@ -1867,7 +1867,7 @@ xlog_state_finish_copy(
18671867{
18681868 lockdep_assert_held (& log -> l_icloglock );
18691869
1870- be32_add_cpu (& iclog -> ic_header . h_num_logops , record_cnt );
1870+ be32_add_cpu (& iclog -> ic_header -> h_num_logops , record_cnt );
18711871 iclog -> ic_offset += copy_bytes ;
18721872}
18731873
@@ -2290,7 +2290,7 @@ xlog_state_activate_iclog(
22902290 * We don't need to cover the dummy.
22912291 */
22922292 if (* iclogs_changed == 0 &&
2293- iclog -> ic_header . h_num_logops == cpu_to_be32 (XLOG_COVER_OPS )) {
2293+ iclog -> ic_header -> h_num_logops == cpu_to_be32 (XLOG_COVER_OPS )) {
22942294 * iclogs_changed = 1 ;
22952295 } else {
22962296 /*
@@ -2302,11 +2302,11 @@ xlog_state_activate_iclog(
23022302
23032303 iclog -> ic_state = XLOG_STATE_ACTIVE ;
23042304 iclog -> ic_offset = 0 ;
2305- iclog -> ic_header . h_num_logops = 0 ;
2306- memset (iclog -> ic_header . h_cycle_data , 0 ,
2307- sizeof (iclog -> ic_header . h_cycle_data ));
2308- iclog -> ic_header . h_lsn = 0 ;
2309- iclog -> ic_header . h_tail_lsn = 0 ;
2305+ iclog -> ic_header -> h_num_logops = 0 ;
2306+ memset (iclog -> ic_header -> h_cycle_data , 0 ,
2307+ sizeof (iclog -> ic_header -> h_cycle_data ));
2308+ iclog -> ic_header -> h_lsn = 0 ;
2309+ iclog -> ic_header -> h_tail_lsn = 0 ;
23102310}
23112311
23122312/*
@@ -2398,7 +2398,7 @@ xlog_get_lowest_lsn(
23982398 iclog -> ic_state == XLOG_STATE_DIRTY )
23992399 continue ;
24002400
2401- lsn = be64_to_cpu (iclog -> ic_header . h_lsn );
2401+ lsn = be64_to_cpu (iclog -> ic_header -> h_lsn );
24022402 if ((lsn && !lowest_lsn ) || XFS_LSN_CMP (lsn , lowest_lsn ) < 0 )
24032403 lowest_lsn = lsn ;
24042404 } while ((iclog = iclog -> ic_next ) != log -> l_iclog );
@@ -2433,7 +2433,7 @@ xlog_state_iodone_process_iclog(
24332433 * If this is not the lowest lsn iclog, then we will leave it
24342434 * for another completion to process.
24352435 */
2436- header_lsn = be64_to_cpu (iclog -> ic_header . h_lsn );
2436+ header_lsn = be64_to_cpu (iclog -> ic_header -> h_lsn );
24372437 lowest_lsn = xlog_get_lowest_lsn (log );
24382438 if (lowest_lsn && XFS_LSN_CMP (lowest_lsn , header_lsn ) < 0 )
24392439 return false;
@@ -2616,7 +2616,7 @@ xlog_state_get_iclog_space(
26162616 goto restart ;
26172617 }
26182618
2619- head = & iclog -> ic_header ;
2619+ head = iclog -> ic_header ;
26202620
26212621 atomic_inc (& iclog -> ic_refcnt ); /* prevents sync */
26222622 log_offset = iclog -> ic_offset ;
@@ -2781,7 +2781,7 @@ xlog_state_switch_iclogs(
27812781 if (!eventual_size )
27822782 eventual_size = iclog -> ic_offset ;
27832783 iclog -> ic_state = XLOG_STATE_WANT_SYNC ;
2784- iclog -> ic_header . h_prev_block = cpu_to_be32 (log -> l_prev_block );
2784+ iclog -> ic_header -> h_prev_block = cpu_to_be32 (log -> l_prev_block );
27852785 log -> l_prev_block = log -> l_curr_block ;
27862786 log -> l_prev_cycle = log -> l_curr_cycle ;
27872787
@@ -2825,7 +2825,7 @@ xlog_force_and_check_iclog(
28252825 struct xlog_in_core * iclog ,
28262826 bool * completed )
28272827{
2828- xfs_lsn_t lsn = be64_to_cpu (iclog -> ic_header . h_lsn );
2828+ xfs_lsn_t lsn = be64_to_cpu (iclog -> ic_header -> h_lsn );
28292829 int error ;
28302830
28312831 * completed = false;
@@ -2837,7 +2837,7 @@ xlog_force_and_check_iclog(
28372837 * If the iclog has already been completed and reused the header LSN
28382838 * will have been rewritten by completion
28392839 */
2840- if (be64_to_cpu (iclog -> ic_header . h_lsn ) != lsn )
2840+ if (be64_to_cpu (iclog -> ic_header -> h_lsn ) != lsn )
28412841 * completed = true;
28422842 return 0 ;
28432843}
@@ -2970,7 +2970,7 @@ xlog_force_lsn(
29702970 goto out_error ;
29712971
29722972 iclog = log -> l_iclog ;
2973- while (be64_to_cpu (iclog -> ic_header . h_lsn ) != lsn ) {
2973+ while (be64_to_cpu (iclog -> ic_header -> h_lsn ) != lsn ) {
29742974 trace_xlog_iclog_force_lsn (iclog , _RET_IP_ );
29752975 iclog = iclog -> ic_next ;
29762976 if (iclog == log -> l_iclog )
@@ -3236,7 +3236,7 @@ xlog_verify_dump_tail(
32363236{
32373237 xfs_alert (log -> l_mp ,
32383238"ran out of log space tail 0x%llx/0x%llx, head lsn 0x%llx, head 0x%x/0x%x, prev head 0x%x/0x%x" ,
3239- iclog ? be64_to_cpu (iclog -> ic_header . h_tail_lsn ) : -1 ,
3239+ iclog ? be64_to_cpu (iclog -> ic_header -> h_tail_lsn ) : -1 ,
32403240 atomic64_read (& log -> l_tail_lsn ),
32413241 log -> l_ailp -> ail_head_lsn ,
32423242 log -> l_curr_cycle , log -> l_curr_block ,
@@ -3255,7 +3255,7 @@ xlog_verify_tail_lsn(
32553255 struct xlog * log ,
32563256 struct xlog_in_core * iclog )
32573257{
3258- xfs_lsn_t tail_lsn = be64_to_cpu (iclog -> ic_header . h_tail_lsn );
3258+ xfs_lsn_t tail_lsn = be64_to_cpu (iclog -> ic_header -> h_tail_lsn );
32593259 int blocks ;
32603260
32613261 if (CYCLE_LSN (tail_lsn ) == log -> l_prev_cycle ) {
@@ -3309,7 +3309,7 @@ xlog_verify_iclog(
33093309 struct xlog_in_core * iclog ,
33103310 int count )
33113311{
3312- struct xlog_rec_header * rhead = & iclog -> ic_header ;
3312+ struct xlog_rec_header * rhead = iclog -> ic_header ;
33133313 xlog_in_core_t * icptr ;
33143314 void * base_ptr , * ptr ;
33153315 ptrdiff_t field_offset ;
@@ -3507,7 +3507,7 @@ xlog_iclogs_empty(
35073507 /* endianness does not matter here, zero is zero in
35083508 * any language.
35093509 */
3510- if (iclog -> ic_header . h_num_logops )
3510+ if (iclog -> ic_header -> h_num_logops )
35113511 return 0 ;
35123512 iclog = iclog -> ic_next ;
35133513 } while (iclog != log -> l_iclog );
0 commit comments