xfs_log.c (99428ad0f665a5d5b245ab36cefb6b231d977e73) | xfs_log.c (55b66332d0921146a914d5d75a7b870a65dc4938) |
---|---|
1/* 2 * Copyright (c) 2000-2005 Silicon Graphics, Inc. 3 * All Rights Reserved. 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License as 7 * published by the Free Software Foundation. 8 * --- 36 unchanged lines hidden (view full) --- 45kmem_zone_t *xfs_log_ticket_zone; 46 47#define xlog_write_adv_cnt(ptr, len, off, bytes) \ 48 { (ptr) += (bytes); \ 49 (len) -= (bytes); \ 50 (off) += (bytes);} 51 52/* Local miscellaneous function prototypes */ | 1/* 2 * Copyright (c) 2000-2005 Silicon Graphics, Inc. 3 * All Rights Reserved. 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License as 7 * published by the Free Software Foundation. 8 * --- 36 unchanged lines hidden (view full) --- 45kmem_zone_t *xfs_log_ticket_zone; 46 47#define xlog_write_adv_cnt(ptr, len, off, bytes) \ 48 { (ptr) += (bytes); \ 49 (len) -= (bytes); \ 50 (off) += (bytes);} 51 52/* Local miscellaneous function prototypes */ |
53STATIC int xlog_commit_record(xfs_mount_t *mp, xlog_ticket_t *ticket, | 53STATIC int xlog_commit_record(struct log *log, struct xlog_ticket *ticket, |
54 xlog_in_core_t **, xfs_lsn_t *); 55STATIC xlog_t * xlog_alloc_log(xfs_mount_t *mp, 56 xfs_buftarg_t *log_target, 57 xfs_daddr_t blk_offset, 58 int num_bblks); 59STATIC int xlog_space_left(xlog_t *log, int cycle, int bytes); 60STATIC int xlog_sync(xlog_t *log, xlog_in_core_t *iclog); 61STATIC void xlog_dealloc_log(xlog_t *log); | 54 xlog_in_core_t **, xfs_lsn_t *); 55STATIC xlog_t * xlog_alloc_log(xfs_mount_t *mp, 56 xfs_buftarg_t *log_target, 57 xfs_daddr_t blk_offset, 58 int num_bblks); 59STATIC int xlog_space_left(xlog_t *log, int cycle, int bytes); 60STATIC int xlog_sync(xlog_t *log, xlog_in_core_t *iclog); 61STATIC void xlog_dealloc_log(xlog_t *log); |
62STATIC int xlog_write(xfs_mount_t *mp, xfs_log_iovec_t region[], 63 int nentries, struct xlog_ticket *tic, 64 xfs_lsn_t *start_lsn, 65 xlog_in_core_t **commit_iclog, 66 uint flags); | 62STATIC int xlog_write(struct log *log, struct xfs_log_vec *log_vector, 63 struct xlog_ticket *tic, xfs_lsn_t *start_lsn, 64 xlog_in_core_t **commit_iclog, uint flags); |
67 68/* local state machine functions */ 69STATIC void xlog_state_done_syncing(xlog_in_core_t *iclog, int); 70STATIC void xlog_state_do_callback(xlog_t *log,int aborted, xlog_in_core_t *iclog); 71STATIC int xlog_state_get_iclog_space(xlog_t *log, 72 int len, 73 xlog_in_core_t **iclog, 74 xlog_ticket_t *ticket, --- 178 unchanged lines hidden (view full) --- 253 xfs_lsn_t lsn = 0; 254 255 if (XLOG_FORCED_SHUTDOWN(log) || 256 /* 257 * If nothing was ever written, don't write out commit record. 258 * If we get an error, just continue and give back the log ticket. 259 */ 260 (((ticket->t_flags & XLOG_TIC_INITED) == 0) && | 65 66/* local state machine functions */ 67STATIC void xlog_state_done_syncing(xlog_in_core_t *iclog, int); 68STATIC void xlog_state_do_callback(xlog_t *log,int aborted, xlog_in_core_t *iclog); 69STATIC int xlog_state_get_iclog_space(xlog_t *log, 70 int len, 71 xlog_in_core_t **iclog, 72 xlog_ticket_t *ticket, --- 178 unchanged lines hidden (view full) --- 251 xfs_lsn_t lsn = 0; 252 253 if (XLOG_FORCED_SHUTDOWN(log) || 254 /* 255 * If nothing was ever written, don't write out commit record. 256 * If we get an error, just continue and give back the log ticket. 257 */ 258 (((ticket->t_flags & XLOG_TIC_INITED) == 0) && |
261 (xlog_commit_record(mp, ticket, iclog, &lsn)))) { | 259 (xlog_commit_record(log, ticket, iclog, &lsn)))) { |
262 lsn = (xfs_lsn_t) -1; 263 if (ticket->t_flags & XLOG_TIC_PERM_RESERV) { 264 flags |= XFS_LOG_REL_PERM_RESERV; 265 } 266 } 267 268 269 if ((ticket->t_flags & XLOG_TIC_PERM_RESERV) == 0 || --- 241 unchanged lines hidden (view full) --- 511int 512xfs_log_unmount_write(xfs_mount_t *mp) 513{ 514 xlog_t *log = mp->m_log; 515 xlog_in_core_t *iclog; 516#ifdef DEBUG 517 xlog_in_core_t *first_iclog; 518#endif | 260 lsn = (xfs_lsn_t) -1; 261 if (ticket->t_flags & XLOG_TIC_PERM_RESERV) { 262 flags |= XFS_LOG_REL_PERM_RESERV; 263 } 264 } 265 266 267 if ((ticket->t_flags & XLOG_TIC_PERM_RESERV) == 0 || --- 241 unchanged lines hidden (view full) --- 509int 510xfs_log_unmount_write(xfs_mount_t *mp) 511{ 512 xlog_t *log = mp->m_log; 513 xlog_in_core_t *iclog; 514#ifdef DEBUG 515 xlog_in_core_t *first_iclog; 516#endif |
519 xfs_log_iovec_t reg[1]; | |
520 xlog_ticket_t *tic = NULL; 521 xfs_lsn_t lsn; 522 int error; 523 | 517 xlog_ticket_t *tic = NULL; 518 xfs_lsn_t lsn; 519 int error; 520 |
524 /* the data section must be 32 bit size aligned */ 525 struct { 526 __uint16_t magic; 527 __uint16_t pad1; 528 __uint32_t pad2; /* may as well make it 64 bits */ 529 } magic = { XLOG_UNMOUNT_TYPE, 0, 0 }; 530 | |
531 /* 532 * Don't write out unmount record on read-only mounts. 533 * Or, if we are doing a forced umount (typically because of IO errors). 534 */ 535 if (mp->m_flags & XFS_MOUNT_RDONLY) 536 return 0; 537 538 error = _xfs_log_force(mp, XFS_LOG_SYNC, NULL); --- 5 unchanged lines hidden (view full) --- 544 if (!(iclog->ic_state & XLOG_STATE_IOERROR)) { 545 ASSERT(iclog->ic_state & XLOG_STATE_ACTIVE); 546 ASSERT(iclog->ic_offset == 0); 547 } 548 iclog = iclog->ic_next; 549 } while (iclog != first_iclog); 550#endif 551 if (! (XLOG_FORCED_SHUTDOWN(log))) { | 521 /* 522 * Don't write out unmount record on read-only mounts. 523 * Or, if we are doing a forced umount (typically because of IO errors). 524 */ 525 if (mp->m_flags & XFS_MOUNT_RDONLY) 526 return 0; 527 528 error = _xfs_log_force(mp, XFS_LOG_SYNC, NULL); --- 5 unchanged lines hidden (view full) --- 534 if (!(iclog->ic_state & XLOG_STATE_IOERROR)) { 535 ASSERT(iclog->ic_state & XLOG_STATE_ACTIVE); 536 ASSERT(iclog->ic_offset == 0); 537 } 538 iclog = iclog->ic_next; 539 } while (iclog != first_iclog); 540#endif 541 if (! (XLOG_FORCED_SHUTDOWN(log))) { |
552 reg[0].i_addr = (void*)&magic; 553 reg[0].i_len = sizeof(magic); 554 reg[0].i_type = XLOG_REG_TYPE_UNMOUNT; 555 | |
556 error = xfs_log_reserve(mp, 600, 1, &tic, 557 XFS_LOG, 0, XLOG_UNMOUNT_REC_TYPE); 558 if (!error) { | 542 error = xfs_log_reserve(mp, 600, 1, &tic, 543 XFS_LOG, 0, XLOG_UNMOUNT_REC_TYPE); 544 if (!error) { |
545 /* the data section must be 32 bit size aligned */ 546 struct { 547 __uint16_t magic; 548 __uint16_t pad1; 549 __uint32_t pad2; /* may as well make it 64 bits */ 550 } magic = { 551 .magic = XLOG_UNMOUNT_TYPE, 552 }; 553 struct xfs_log_iovec reg = { 554 .i_addr = (void *)&magic, 555 .i_len = sizeof(magic), 556 .i_type = XLOG_REG_TYPE_UNMOUNT, 557 }; 558 struct xfs_log_vec vec = { 559 .lv_niovecs = 1, 560 .lv_iovecp = ®, 561 }; 562 |
|
559 /* remove inited flag */ | 563 /* remove inited flag */ |
560 ((xlog_ticket_t *)tic)->t_flags = 0; 561 error = xlog_write(mp, reg, 1, tic, &lsn, | 564 tic->t_flags = 0; 565 error = xlog_write(log, &vec, tic, &lsn, |
562 NULL, XLOG_UNMOUNT_TRANS); 563 /* 564 * At this point, we're umounting anyway, 565 * so there's no point in transitioning log state 566 * to IOERROR. Just continue... 567 */ 568 } 569 --- 104 unchanged lines hidden (view full) --- 674 struct xfs_mount *mp, 675 struct xfs_log_iovec reg[], 676 int nentries, 677 struct xlog_ticket *tic, 678 xfs_lsn_t *start_lsn) 679{ 680 struct log *log = mp->m_log; 681 int error; | 566 NULL, XLOG_UNMOUNT_TRANS); 567 /* 568 * At this point, we're umounting anyway, 569 * so there's no point in transitioning log state 570 * to IOERROR. Just continue... 571 */ 572 } 573 --- 104 unchanged lines hidden (view full) --- 678 struct xfs_mount *mp, 679 struct xfs_log_iovec reg[], 680 int nentries, 681 struct xlog_ticket *tic, 682 xfs_lsn_t *start_lsn) 683{ 684 struct log *log = mp->m_log; 685 int error; |
686 struct xfs_log_vec vec = { 687 .lv_niovecs = nentries, 688 .lv_iovecp = reg, 689 }; |
|
682 683 if (XLOG_FORCED_SHUTDOWN(log)) 684 return XFS_ERROR(EIO); 685 | 690 691 if (XLOG_FORCED_SHUTDOWN(log)) 692 return XFS_ERROR(EIO); 693 |
686 error = xlog_write(mp, reg, nentries, tic, start_lsn, NULL, 0); | 694 error = xlog_write(log, &vec, tic, start_lsn, NULL, 0); |
687 if (error) 688 xfs_force_shutdown(mp, SHUTDOWN_LOG_IO_ERROR); 689 return error; 690} 691 692void 693xfs_log_move_tail(xfs_mount_t *mp, 694 xfs_lsn_t tail_lsn) --- 490 unchanged lines hidden (view full) --- 1185} /* xlog_alloc_log */ 1186 1187 1188/* 1189 * Write out the commit record of a transaction associated with the given 1190 * ticket. Return the lsn of the commit record. 1191 */ 1192STATIC int | 695 if (error) 696 xfs_force_shutdown(mp, SHUTDOWN_LOG_IO_ERROR); 697 return error; 698} 699 700void 701xfs_log_move_tail(xfs_mount_t *mp, 702 xfs_lsn_t tail_lsn) --- 490 unchanged lines hidden (view full) --- 1193} /* xlog_alloc_log */ 1194 1195 1196/* 1197 * Write out the commit record of a transaction associated with the given 1198 * ticket. Return the lsn of the commit record. 1199 */ 1200STATIC int |
1193xlog_commit_record(xfs_mount_t *mp, 1194 xlog_ticket_t *ticket, 1195 xlog_in_core_t **iclog, 1196 xfs_lsn_t *commitlsnp) | 1201xlog_commit_record( 1202 struct log *log, 1203 struct xlog_ticket *ticket, 1204 struct xlog_in_core **iclog, 1205 xfs_lsn_t *commitlsnp) |
1197{ | 1206{ |
1198 int error; 1199 xfs_log_iovec_t reg[1]; | 1207 struct xfs_mount *mp = log->l_mp; 1208 int error; 1209 struct xfs_log_iovec reg = { 1210 .i_addr = NULL, 1211 .i_len = 0, 1212 .i_type = XLOG_REG_TYPE_COMMIT, 1213 }; 1214 struct xfs_log_vec vec = { 1215 .lv_niovecs = 1, 1216 .lv_iovecp = ®, 1217 }; |
1200 | 1218 |
1201 reg[0].i_addr = NULL; 1202 reg[0].i_len = 0; 1203 reg[0].i_type = XLOG_REG_TYPE_COMMIT; 1204 | |
1205 ASSERT_ALWAYS(iclog); | 1219 ASSERT_ALWAYS(iclog); |
1206 if ((error = xlog_write(mp, reg, 1, ticket, commitlsnp, 1207 iclog, XLOG_COMMIT_TRANS))) { | 1220 error = xlog_write(log, &vec, ticket, commitlsnp, iclog, 1221 XLOG_COMMIT_TRANS); 1222 if (error) |
1208 xfs_force_shutdown(mp, SHUTDOWN_LOG_IO_ERROR); | 1223 xfs_force_shutdown(mp, SHUTDOWN_LOG_IO_ERROR); |
1209 } | |
1210 return error; | 1224 return error; |
1211} /* xlog_commit_record */ | 1225} |
1212 | 1226 |
1213 | |
1214/* 1215 * Push on the buffer cache code if we ever use more than 75% of the on-disk 1216 * log space. This code pushes on the lsn which would supposedly free up 1217 * the 25% which we want to leave free. We may need to adopt a policy which 1218 * pushes on an lsn which is further along in the log once we reach the high 1219 * water mark. In this manner, we would be creating a low water mark. 1220 */ 1221STATIC void --- 409 unchanged lines hidden (view full) --- 1631 1632/* 1633 * Calculate the potential space needed by the log vector. Each region gets 1634 * its own xlog_op_header_t and may need to be double word aligned. 1635 */ 1636static int 1637xlog_write_calc_vec_length( 1638 struct xlog_ticket *ticket, | 1227/* 1228 * Push on the buffer cache code if we ever use more than 75% of the on-disk 1229 * log space. This code pushes on the lsn which would supposedly free up 1230 * the 25% which we want to leave free. We may need to adopt a policy which 1231 * pushes on an lsn which is further along in the log once we reach the high 1232 * water mark. In this manner, we would be creating a low water mark. 1233 */ 1234STATIC void --- 409 unchanged lines hidden (view full) --- 1644 1645/* 1646 * Calculate the potential space needed by the log vector. Each region gets 1647 * its own xlog_op_header_t and may need to be double word aligned. 1648 */ 1649static int 1650xlog_write_calc_vec_length( 1651 struct xlog_ticket *ticket, |
1639 struct xfs_log_iovec reg[], 1640 int nentries) | 1652 struct xfs_log_vec *log_vector) |
1641{ | 1653{ |
1654 struct xfs_log_vec *lv; |
|
1642 int headers = 0; 1643 int len = 0; 1644 int i; 1645 1646 /* acct for start rec of xact */ 1647 if (ticket->t_flags & XLOG_TIC_INITED) 1648 headers++; 1649 | 1655 int headers = 0; 1656 int len = 0; 1657 int i; 1658 1659 /* acct for start rec of xact */ 1660 if (ticket->t_flags & XLOG_TIC_INITED) 1661 headers++; 1662 |
1650 for (i = 0; i < nentries; i++) { 1651 /* each region gets >= 1 */ 1652 headers++; | 1663 for (lv = log_vector; lv; lv = lv->lv_next) { 1664 headers += lv->lv_niovecs; |
1653 | 1665 |
1654 len += reg[i].i_len; 1655 xlog_tic_add_region(ticket, reg[i].i_len, reg[i].i_type); | 1666 for (i = 0; i < lv->lv_niovecs; i++) { 1667 struct xfs_log_iovec *vecp = &lv->lv_iovecp[i]; 1668 1669 len += vecp->i_len; 1670 xlog_tic_add_region(ticket, vecp->i_len, vecp->i_type); 1671 } |
1656 } 1657 1658 ticket->t_res_num_ophdrs += headers; 1659 len += headers * sizeof(struct xlog_op_header); 1660 1661 return len; 1662} 1663 --- 189 unchanged lines hidden (view full) --- 1853 * operation which contains the end of the continued log_write region. 1854 * 3. When xlog_state_get_iclog_space() grabs the rest of the current iclog, 1855 * we don't really know exactly how much space will be used. As a result, 1856 * we don't update ic_offset until the end when we know exactly how many 1857 * bytes have been written out. 1858 */ 1859STATIC int 1860xlog_write( | 1672 } 1673 1674 ticket->t_res_num_ophdrs += headers; 1675 len += headers * sizeof(struct xlog_op_header); 1676 1677 return len; 1678} 1679 --- 189 unchanged lines hidden (view full) --- 1869 * operation which contains the end of the continued log_write region. 1870 * 3. When xlog_state_get_iclog_space() grabs the rest of the current iclog, 1871 * we don't really know exactly how much space will be used. As a result, 1872 * we don't update ic_offset until the end when we know exactly how many 1873 * bytes have been written out. 1874 */ 1875STATIC int 1876xlog_write( |
1861 struct xfs_mount *mp, 1862 struct xfs_log_iovec reg[], 1863 int nentries, | 1877 struct log *log, 1878 struct xfs_log_vec *log_vector, |
1864 struct xlog_ticket *ticket, 1865 xfs_lsn_t *start_lsn, 1866 struct xlog_in_core **commit_iclog, 1867 uint flags) 1868{ | 1879 struct xlog_ticket *ticket, 1880 xfs_lsn_t *start_lsn, 1881 struct xlog_in_core **commit_iclog, 1882 uint flags) 1883{ |
1869 struct log *log = mp->m_log; | |
1870 struct xlog_in_core *iclog = NULL; | 1884 struct xlog_in_core *iclog = NULL; |
1885 struct xfs_log_iovec *vecp; 1886 struct xfs_log_vec *lv; |
|
1871 int len; 1872 int index; 1873 int partial_copy = 0; 1874 int partial_copy_len = 0; 1875 int contwr = 0; 1876 int record_cnt = 0; 1877 int data_cnt = 0; 1878 int error; 1879 1880 *start_lsn = 0; 1881 | 1887 int len; 1888 int index; 1889 int partial_copy = 0; 1890 int partial_copy_len = 0; 1891 int contwr = 0; 1892 int record_cnt = 0; 1893 int data_cnt = 0; 1894 int error; 1895 1896 *start_lsn = 0; 1897 |
1882 len = xlog_write_calc_vec_length(ticket, reg, nentries); | 1898 len = xlog_write_calc_vec_length(ticket, log_vector); |
1883 if (ticket->t_curr_res < len) { | 1899 if (ticket->t_curr_res < len) { |
1884 xlog_print_tic_res(mp, ticket); | 1900 xlog_print_tic_res(log->l_mp, ticket); |
1885#ifdef DEBUG 1886 xlog_panic( 1887 "xfs_log_write: reservation ran out. Need to up reservation"); 1888#else 1889 /* Customer configurable panic */ | 1901#ifdef DEBUG 1902 xlog_panic( 1903 "xfs_log_write: reservation ran out. Need to up reservation"); 1904#else 1905 /* Customer configurable panic */ |
1890 xfs_cmn_err(XFS_PTAG_LOGRES, CE_ALERT, mp, | 1906 xfs_cmn_err(XFS_PTAG_LOGRES, CE_ALERT, log->l_mp, |
1891 "xfs_log_write: reservation ran out. Need to up reservation"); 1892 1893 /* If we did not panic, shutdown the filesystem */ | 1907 "xfs_log_write: reservation ran out. Need to up reservation"); 1908 1909 /* If we did not panic, shutdown the filesystem */ |
1894 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); | 1910 xfs_force_shutdown(log->l_mp, SHUTDOWN_CORRUPT_INCORE); |
1895#endif 1896 } 1897 1898 ticket->t_curr_res -= len; 1899 | 1911#endif 1912 } 1913 1914 ticket->t_curr_res -= len; 1915 |
1900 for (index = 0; index < nentries; ) { | 1916 index = 0; 1917 lv = log_vector; 1918 vecp = lv->lv_iovecp; 1919 while (lv && index < lv->lv_niovecs) { |
1901 __psint_t ptr; 1902 int log_offset; 1903 1904 error = xlog_state_get_iclog_space(log, len, &iclog, ticket, 1905 &contwr, &log_offset); 1906 if (error) 1907 return error; 1908 1909 ASSERT(log_offset <= iclog->ic_size - 1); 1910 ptr = (__psint_t)((char *)iclog->ic_datap + log_offset); 1911 1912 /* start_lsn is the first lsn written to. That's all we need. */ 1913 if (!*start_lsn) 1914 *start_lsn = be64_to_cpu(iclog->ic_header.h_lsn); 1915 1916 /* 1917 * This loop writes out as many regions as can fit in the amount 1918 * of space which was allocated by xlog_state_get_iclog_space(). 1919 */ | 1920 __psint_t ptr; 1921 int log_offset; 1922 1923 error = xlog_state_get_iclog_space(log, len, &iclog, ticket, 1924 &contwr, &log_offset); 1925 if (error) 1926 return error; 1927 1928 ASSERT(log_offset <= iclog->ic_size - 1); 1929 ptr = (__psint_t)((char *)iclog->ic_datap + log_offset); 1930 1931 /* start_lsn is the first lsn written to. That's all we need. */ 1932 if (!*start_lsn) 1933 *start_lsn = be64_to_cpu(iclog->ic_header.h_lsn); 1934 1935 /* 1936 * This loop writes out as many regions as can fit in the amount 1937 * of space which was allocated by xlog_state_get_iclog_space(). 1938 */ |
1920 while (index < nentries) { | 1939 while (lv && index < lv->lv_niovecs) { 1940 struct xfs_log_iovec *reg = &vecp[index]; |
1921 struct xlog_op_header *ophdr; 1922 int start_rec_copy; 1923 int copy_len; 1924 int copy_off; 1925 | 1941 struct xlog_op_header *ophdr; 1942 int start_rec_copy; 1943 int copy_len; 1944 int copy_off; 1945 |
1926 ASSERT(reg[index].i_len % sizeof(__int32_t) == 0); | 1946 ASSERT(reg->i_len % sizeof(__int32_t) == 0); |
1927 ASSERT((__psint_t)ptr % sizeof(__int32_t) == 0); 1928 1929 start_rec_copy = xlog_write_start_rec(ptr, ticket); 1930 if (start_rec_copy) { 1931 record_cnt++; 1932 xlog_write_adv_cnt(ptr, len, log_offset, 1933 start_rec_copy); 1934 } 1935 1936 ophdr = xlog_write_setup_ophdr(log, ptr, ticket, flags); 1937 if (!ophdr) 1938 return XFS_ERROR(EIO); 1939 1940 xlog_write_adv_cnt(ptr, len, log_offset, 1941 sizeof(struct xlog_op_header)); 1942 1943 len += xlog_write_setup_copy(ticket, ophdr, 1944 iclog->ic_size-log_offset, | 1947 ASSERT((__psint_t)ptr % sizeof(__int32_t) == 0); 1948 1949 start_rec_copy = xlog_write_start_rec(ptr, ticket); 1950 if (start_rec_copy) { 1951 record_cnt++; 1952 xlog_write_adv_cnt(ptr, len, log_offset, 1953 start_rec_copy); 1954 } 1955 1956 ophdr = xlog_write_setup_ophdr(log, ptr, ticket, flags); 1957 if (!ophdr) 1958 return XFS_ERROR(EIO); 1959 1960 xlog_write_adv_cnt(ptr, len, log_offset, 1961 sizeof(struct xlog_op_header)); 1962 1963 len += xlog_write_setup_copy(ticket, ophdr, 1964 iclog->ic_size-log_offset, |
1945 reg[index].i_len, | 1965 reg->i_len, |
1946 ©_off, ©_len, 1947 &partial_copy, 1948 &partial_copy_len); 1949 xlog_verify_dest_ptr(log, ptr); 1950 1951 /* copy region */ 1952 ASSERT(copy_len >= 0); | 1966 ©_off, ©_len, 1967 &partial_copy, 1968 &partial_copy_len); 1969 xlog_verify_dest_ptr(log, ptr); 1970 1971 /* copy region */ 1972 ASSERT(copy_len >= 0); |
1953 memcpy((xfs_caddr_t)ptr, reg[index].i_addr + copy_off, | 1973 memcpy((xfs_caddr_t)ptr, reg->i_addr + copy_off, |
1954 copy_len); 1955 xlog_write_adv_cnt(ptr, len, log_offset, copy_len); 1956 1957 copy_len += start_rec_copy + sizeof(xlog_op_header_t); 1958 record_cnt++; 1959 data_cnt += contwr ? copy_len : 0; 1960 1961 error = xlog_write_copy_finish(log, iclog, flags, --- 15 unchanged lines hidden (view full) --- 1977 * the iclog (indicated by resetting of the record 1978 * count), then we also need to get more log space. If 1979 * this was the last record, though, we are done and 1980 * can just return. 1981 */ 1982 if (partial_copy) 1983 break; 1984 | 1974 copy_len); 1975 xlog_write_adv_cnt(ptr, len, log_offset, copy_len); 1976 1977 copy_len += start_rec_copy + sizeof(xlog_op_header_t); 1978 record_cnt++; 1979 data_cnt += contwr ? copy_len : 0; 1980 1981 error = xlog_write_copy_finish(log, iclog, flags, --- 15 unchanged lines hidden (view full) --- 1997 * the iclog (indicated by resetting of the record 1998 * count), then we also need to get more log space. If 1999 * this was the last record, though, we are done and 2000 * can just return. 2001 */ 2002 if (partial_copy) 2003 break; 2004 |
1985 index++; | 2005 if (++index == lv->lv_niovecs) { 2006 lv = lv->lv_next; 2007 index = 0; 2008 if (lv) 2009 vecp = lv->lv_iovecp; 2010 } |
1986 if (record_cnt == 0) { | 2011 if (record_cnt == 0) { |
1987 if (index == nentries) | 2012 if (!lv) |
1988 return 0; 1989 break; 1990 } 1991 } 1992 } 1993 1994 ASSERT(len == 0); 1995 --- 1769 unchanged lines hidden --- | 2013 return 0; 2014 break; 2015 } 2016 } 2017 } 2018 2019 ASSERT(len == 0); 2020 --- 1769 unchanged lines hidden --- |