Lines Matching refs:bp
106 xfs_buf_t *bp) in xlog_put_bp() argument
108 xfs_buf_free(bp); in xlog_put_bp()
120 xfs_buf_t *bp) in xlog_bread() argument
130 ASSERT(BBTOB(nbblks) <= XFS_BUF_SIZE(bp)); in xlog_bread()
131 ASSERT(bp); in xlog_bread()
133 XFS_BUF_SET_ADDR(bp, log->l_logBBstart + blk_no); in xlog_bread()
134 XFS_BUF_READ(bp); in xlog_bread()
135 XFS_BUF_BUSY(bp); in xlog_bread()
136 XFS_BUF_SET_COUNT(bp, BBTOB(nbblks)); in xlog_bread()
137 XFS_BUF_SET_TARGET(bp, log->l_mp->m_logdev_targp); in xlog_bread()
139 xfsbdstrat(log->l_mp, bp); in xlog_bread()
140 if ((error = xfs_iowait(bp))) in xlog_bread()
142 bp, XFS_BUF_ADDR(bp)); in xlog_bread()
156 xfs_buf_t *bp) in xlog_bwrite() argument
166 ASSERT(BBTOB(nbblks) <= XFS_BUF_SIZE(bp)); in xlog_bwrite()
168 XFS_BUF_SET_ADDR(bp, log->l_logBBstart + blk_no); in xlog_bwrite()
169 XFS_BUF_ZEROFLAGS(bp); in xlog_bwrite()
170 XFS_BUF_BUSY(bp); in xlog_bwrite()
171 XFS_BUF_HOLD(bp); in xlog_bwrite()
172 XFS_BUF_PSEMA(bp, PRIBIO); in xlog_bwrite()
173 XFS_BUF_SET_COUNT(bp, BBTOB(nbblks)); in xlog_bwrite()
174 XFS_BUF_SET_TARGET(bp, log->l_mp->m_logdev_targp); in xlog_bwrite()
176 if ((error = xfs_bwrite(log->l_mp, bp))) in xlog_bwrite()
178 bp, XFS_BUF_ADDR(bp)); in xlog_bwrite()
187 xfs_buf_t *bp) in xlog_align() argument
192 return XFS_BUF_PTR(bp); in xlog_align()
194 ptr = XFS_BUF_PTR(bp) + BBTOB((int)blk_no & log->l_sectbb_mask); in xlog_align()
195 ASSERT(XFS_BUF_SIZE(bp) >= in xlog_align()
286 struct xfs_buf *bp) in xlog_recover_iodone() argument
290 ASSERT(XFS_BUF_FSPRIVATE(bp, void *)); in xlog_recover_iodone()
292 if (XFS_BUF_GETERROR(bp)) { in xlog_recover_iodone()
297 mp = XFS_BUF_FSPRIVATE(bp, xfs_mount_t *); in xlog_recover_iodone()
299 mp, bp, XFS_BUF_ADDR(bp)); in xlog_recover_iodone()
302 XFS_BUF_SET_FSPRIVATE(bp, NULL); in xlog_recover_iodone()
303 XFS_BUF_CLR_IODONE_FUNC(bp); in xlog_recover_iodone()
304 xfs_biodone(bp); in xlog_recover_iodone()
316 xfs_buf_t *bp, in xlog_find_cycle_start() argument
328 if ((error = xlog_bread(log, mid_blk, 1, bp))) in xlog_find_cycle_start()
330 offset = xlog_align(log, mid_blk, 1, bp); in xlog_find_cycle_start()
367 xfs_buf_t *bp; in xlog_find_verify_cycle() local
374 while (!(bp = xlog_get_bp(log, bufblks))) { in xlog_find_verify_cycle()
386 if ((error = xlog_bread(log, i, bcount, bp))) in xlog_find_verify_cycle()
389 buf = xlog_align(log, i, bcount, bp); in xlog_find_verify_cycle()
404 xlog_put_bp(bp); in xlog_find_verify_cycle()
428 xfs_buf_t *bp; in xlog_find_verify_log_record() local
438 if (!(bp = xlog_get_bp(log, num_blks))) { in xlog_find_verify_log_record()
439 if (!(bp = xlog_get_bp(log, 1))) in xlog_find_verify_log_record()
443 if ((error = xlog_bread(log, start_blk, num_blks, bp))) in xlog_find_verify_log_record()
445 offset = xlog_align(log, start_blk, num_blks, bp); in xlog_find_verify_log_record()
460 if ((error = xlog_bread(log, i, 1, bp))) in xlog_find_verify_log_record()
462 offset = xlog_align(log, i, 1, bp); in xlog_find_verify_log_record()
514 xlog_put_bp(bp); in xlog_find_verify_log_record()
536 xfs_buf_t *bp; in xlog_find_head() local
564 bp = xlog_get_bp(log, 1); in xlog_find_head()
565 if (!bp) in xlog_find_head()
567 if ((error = xlog_bread(log, 0, 1, bp))) in xlog_find_head()
569 offset = xlog_align(log, 0, 1, bp); in xlog_find_head()
573 if ((error = xlog_bread(log, last_blk, 1, bp))) in xlog_find_head()
575 offset = xlog_align(log, last_blk, 1, bp); in xlog_find_head()
640 if ((error = xlog_find_cycle_start(log, bp, first_blk, in xlog_find_head()
760 xlog_put_bp(bp); in xlog_find_head()
774 xlog_put_bp(bp); in xlog_find_head()
807 xfs_buf_t *bp; in xlog_find_tail() local
822 bp = xlog_get_bp(log, 1); in xlog_find_tail()
823 if (!bp) in xlog_find_tail()
826 if ((error = xlog_bread(log, 0, 1, bp))) in xlog_find_tail()
828 offset = xlog_align(log, 0, 1, bp); in xlog_find_tail()
841 if ((error = xlog_bread(log, i, 1, bp))) in xlog_find_tail()
843 offset = xlog_align(log, i, 1, bp); in xlog_find_tail()
858 if ((error = xlog_bread(log, i, 1, bp))) in xlog_find_tail()
860 offset = xlog_align(log, i, 1, bp); in xlog_find_tail()
932 if ((error = xlog_bread(log, umount_data_blk, 1, bp))) { in xlog_find_tail()
935 offset = xlog_align(log, umount_data_blk, 1, bp); in xlog_find_tail()
976 xlog_put_bp(bp); in xlog_find_tail()
1004 xfs_buf_t *bp; in xlog_find_zeroed() local
1012 bp = xlog_get_bp(log, 1); in xlog_find_zeroed()
1013 if (!bp) in xlog_find_zeroed()
1015 if ((error = xlog_bread(log, 0, 1, bp))) in xlog_find_zeroed()
1017 offset = xlog_align(log, 0, 1, bp); in xlog_find_zeroed()
1021 xlog_put_bp(bp); in xlog_find_zeroed()
1026 if ((error = xlog_bread(log, log_bbnum-1, 1, bp))) in xlog_find_zeroed()
1028 offset = xlog_align(log, log_bbnum-1, 1, bp); in xlog_find_zeroed()
1031 xlog_put_bp(bp); in xlog_find_zeroed()
1045 if ((error = xlog_find_cycle_start(log, bp, 0, &last_blk, 0))) in xlog_find_zeroed()
1086 xlog_put_bp(bp); in xlog_find_zeroed()
1129 xfs_buf_t *bp; in xlog_write_log_records() local
1138 while (!(bp = xlog_get_bp(log, bufblks))) { in xlog_write_log_records()
1150 if ((error = xlog_bread(log, start_block, 1, bp))) { in xlog_write_log_records()
1151 xlog_put_bp(bp); in xlog_write_log_records()
1169 offset = XFS_BUF_PTR(bp); in xlog_write_log_records()
1171 XFS_BUF_SET_PTR(bp, offset + balign, BBTOB(sectbb)); in xlog_write_log_records()
1172 if ((error = xlog_bread(log, ealign, sectbb, bp))) in xlog_write_log_records()
1174 XFS_BUF_SET_PTR(bp, offset, bufblks); in xlog_write_log_records()
1177 offset = xlog_align(log, start_block, endcount, bp); in xlog_write_log_records()
1183 error = xlog_bwrite(log, start_block, endcount, bp); in xlog_write_log_records()
1189 xlog_put_bp(bp); in xlog_write_log_records()
1805 xfs_buf_t *bp, in xlog_recover_do_inode_buffer() argument
1844 inodes_per_buf = XFS_BUF_COUNT(bp) >> mp->m_sb.sb_inodelog; in xlog_recover_do_inode_buffer()
1887 ASSERT((reg_buf_offset + reg_buf_bytes) <= XFS_BUF_COUNT(bp)); in xlog_recover_do_inode_buffer()
1900 item, bp); in xlog_recover_do_inode_buffer()
1906 buffer_nextp = (xfs_agino_t *)xfs_buf_offset(bp, in xlog_recover_do_inode_buffer()
1925 xfs_buf_t *bp, in xlog_recover_do_reg_buffer() argument
1958 ASSERT(XFS_BUF_COUNT(bp) >= in xlog_recover_do_reg_buffer()
1974 memcpy(xfs_buf_offset(bp, in xlog_recover_do_reg_buffer()
2123 xfs_buf_t *bp, in xlog_recover_do_dquot_buffer() argument
2146 xlog_recover_do_reg_buffer(mp, item, bp, buf_f); in xlog_recover_do_dquot_buffer()
2181 xfs_buf_t *bp; in xlog_recover_do_buffer_trans() local
2234 bp = xfs_buf_read_flags(mp->m_ddev_targp, blkno, len, in xlog_recover_do_buffer_trans()
2237 bp = xfs_buf_read(mp->m_ddev_targp, blkno, len, 0); in xlog_recover_do_buffer_trans()
2239 if (XFS_BUF_ISERROR(bp)) { in xlog_recover_do_buffer_trans()
2241 bp, blkno); in xlog_recover_do_buffer_trans()
2242 error = XFS_BUF_GETERROR(bp); in xlog_recover_do_buffer_trans()
2243 xfs_buf_relse(bp); in xlog_recover_do_buffer_trans()
2249 error = xlog_recover_do_inode_buffer(mp, item, bp, buf_f); in xlog_recover_do_buffer_trans()
2251 xlog_recover_do_dquot_buffer(mp, log, item, bp, buf_f); in xlog_recover_do_buffer_trans()
2253 xlog_recover_do_reg_buffer(mp, item, bp, buf_f); in xlog_recover_do_buffer_trans()
2274 INT_GET(*((__uint16_t *)(xfs_buf_offset(bp, 0))), ARCH_CONVERT) && in xlog_recover_do_buffer_trans()
2275 (XFS_BUF_COUNT(bp) != MAX(log->l_mp->m_sb.sb_blocksize, in xlog_recover_do_buffer_trans()
2277 XFS_BUF_STALE(bp); in xlog_recover_do_buffer_trans()
2278 error = xfs_bwrite(mp, bp); in xlog_recover_do_buffer_trans()
2280 ASSERT(XFS_BUF_FSPRIVATE(bp, void *) == NULL || in xlog_recover_do_buffer_trans()
2281 XFS_BUF_FSPRIVATE(bp, xfs_mount_t *) == mp); in xlog_recover_do_buffer_trans()
2282 XFS_BUF_SET_FSPRIVATE(bp, mp); in xlog_recover_do_buffer_trans()
2283 XFS_BUF_SET_IODONE_FUNC(bp, xlog_recover_iodone); in xlog_recover_do_buffer_trans()
2284 xfs_bdwrite(mp, bp); in xlog_recover_do_buffer_trans()
2298 xfs_buf_t *bp; in xlog_recover_do_inode_trans() local
2343 bp = xfs_buf_read_flags(mp->m_ddev_targp, imap.im_blkno, imap.im_len, in xlog_recover_do_inode_trans()
2345 if (XFS_BUF_ISERROR(bp)) { in xlog_recover_do_inode_trans()
2347 bp, imap.im_blkno); in xlog_recover_do_inode_trans()
2348 error = XFS_BUF_GETERROR(bp); in xlog_recover_do_inode_trans()
2349 xfs_buf_relse(bp); in xlog_recover_do_inode_trans()
2354 dip = (xfs_dinode_t *)xfs_buf_offset(bp, imap.im_boffset); in xlog_recover_do_inode_trans()
2361 xfs_buf_relse(bp); in xlog_recover_do_inode_trans()
2364 dip, bp, ino); in xlog_recover_do_inode_trans()
2371 xfs_buf_relse(bp); in xlog_recover_do_inode_trans()
2392 xfs_buf_relse(bp); in xlog_recover_do_inode_trans()
2404 xfs_buf_relse(bp); in xlog_recover_do_inode_trans()
2407 item, dip, bp, ino); in xlog_recover_do_inode_trans()
2416 xfs_buf_relse(bp); in xlog_recover_do_inode_trans()
2419 item, dip, bp, ino); in xlog_recover_do_inode_trans()
2426 xfs_buf_relse(bp); in xlog_recover_do_inode_trans()
2429 item, dip, bp, ino, in xlog_recover_do_inode_trans()
2437 xfs_buf_relse(bp); in xlog_recover_do_inode_trans()
2440 item, dip, bp, ino, dicp->di_forkoff); in xlog_recover_do_inode_trans()
2446 xfs_buf_relse(bp); in xlog_recover_do_inode_trans()
2537 xfs_buf_relse(bp); in xlog_recover_do_inode_trans()
2544 ASSERT(XFS_BUF_FSPRIVATE(bp, void *) == NULL || in xlog_recover_do_inode_trans()
2545 XFS_BUF_FSPRIVATE(bp, xfs_mount_t *) == mp); in xlog_recover_do_inode_trans()
2546 XFS_BUF_SET_FSPRIVATE(bp, mp); in xlog_recover_do_inode_trans()
2547 XFS_BUF_SET_IODONE_FUNC(bp, xlog_recover_iodone); in xlog_recover_do_inode_trans()
2548 xfs_bdwrite(mp, bp); in xlog_recover_do_inode_trans()
2550 XFS_BUF_STALE(bp); in xlog_recover_do_inode_trans()
2551 error = xfs_bwrite(mp, bp); in xlog_recover_do_inode_trans()
2599 xfs_buf_t *bp; in xlog_recover_do_dquot_trans() local
2650 0, &bp); in xlog_recover_do_dquot_trans()
2653 bp, dq_f->qlf_blkno); in xlog_recover_do_dquot_trans()
2656 ASSERT(bp); in xlog_recover_do_dquot_trans()
2657 ddq = (xfs_disk_dquot_t *)xfs_buf_offset(bp, dq_f->qlf_boffset); in xlog_recover_do_dquot_trans()
2666 xfs_buf_relse(bp); in xlog_recover_do_dquot_trans()
2673 ASSERT(XFS_BUF_FSPRIVATE(bp, void *) == NULL || in xlog_recover_do_dquot_trans()
2674 XFS_BUF_FSPRIVATE(bp, xfs_mount_t *) == mp); in xlog_recover_do_dquot_trans()
2675 XFS_BUF_SET_FSPRIVATE(bp, mp); in xlog_recover_do_dquot_trans()
2676 XFS_BUF_SET_IODONE_FUNC(bp, xlog_recover_iodone); in xlog_recover_do_dquot_trans()
2677 xfs_bdwrite(mp, bp); in xlog_recover_do_dquot_trans()
3848 xfs_buf_t *bp; in xlog_do_recover() local
3883 bp = xfs_getsb(log->l_mp, 0); in xlog_do_recover()
3884 XFS_BUF_UNDONE(bp); in xlog_do_recover()
3885 XFS_BUF_READ(bp); in xlog_do_recover()
3886 xfsbdstrat(log->l_mp, bp); in xlog_do_recover()
3887 if ((error = xfs_iowait(bp))) { in xlog_do_recover()
3889 log->l_mp, bp, XFS_BUF_ADDR(bp)); in xlog_do_recover()
3891 xfs_buf_relse(bp); in xlog_do_recover()
3897 xfs_xlatesb(XFS_BUF_TO_SBP(bp), sbp, 1, ARCH_CONVERT, XFS_SB_ALL_BITS); in xlog_do_recover()
3900 xfs_buf_relse(bp); in xlog_do_recover()