Lines Matching refs:bp

104 	struct xfs_buf	*bp;  in xlog_get_bp()  local
133 bp = xfs_buf_get_uncached(log->l_mp->m_logdev_targp, nbblks, 0); in xlog_get_bp()
134 if (bp) in xlog_get_bp()
135 xfs_buf_unlock(bp); in xlog_get_bp()
136 return bp; in xlog_get_bp()
141 xfs_buf_t *bp) in xlog_put_bp() argument
143 xfs_buf_free(bp); in xlog_put_bp()
155 struct xfs_buf *bp) in xlog_align() argument
159 ASSERT(offset + nbblks <= bp->b_length); in xlog_align()
160 return bp->b_addr + BBTOB(offset); in xlog_align()
172 struct xfs_buf *bp) in xlog_bread_noalign() argument
187 ASSERT(nbblks <= bp->b_length); in xlog_bread_noalign()
189 XFS_BUF_SET_ADDR(bp, log->l_logBBstart + blk_no); in xlog_bread_noalign()
190 XFS_BUF_READ(bp); in xlog_bread_noalign()
191 bp->b_io_length = nbblks; in xlog_bread_noalign()
192 bp->b_error = 0; in xlog_bread_noalign()
194 error = xfs_buf_submit_wait(bp); in xlog_bread_noalign()
196 xfs_buf_ioerror_alert(bp, __func__); in xlog_bread_noalign()
205 struct xfs_buf *bp, in xlog_bread() argument
210 error = xlog_bread_noalign(log, blk_no, nbblks, bp); in xlog_bread()
214 *offset = xlog_align(log, blk_no, nbblks, bp); in xlog_bread()
227 struct xfs_buf *bp, in xlog_bread_offset() argument
230 xfs_caddr_t orig_offset = bp->b_addr; in xlog_bread_offset()
231 int orig_len = BBTOB(bp->b_length); in xlog_bread_offset()
234 error = xfs_buf_associate_memory(bp, offset, BBTOB(nbblks)); in xlog_bread_offset()
238 error = xlog_bread_noalign(log, blk_no, nbblks, bp); in xlog_bread_offset()
241 error2 = xfs_buf_associate_memory(bp, orig_offset, orig_len); in xlog_bread_offset()
257 struct xfs_buf *bp) in xlog_bwrite() argument
272 ASSERT(nbblks <= bp->b_length); in xlog_bwrite()
274 XFS_BUF_SET_ADDR(bp, log->l_logBBstart + blk_no); in xlog_bwrite()
275 XFS_BUF_ZEROFLAGS(bp); in xlog_bwrite()
276 xfs_buf_hold(bp); in xlog_bwrite()
277 xfs_buf_lock(bp); in xlog_bwrite()
278 bp->b_io_length = nbblks; in xlog_bwrite()
279 bp->b_error = 0; in xlog_bwrite()
281 error = xfs_bwrite(bp); in xlog_bwrite()
283 xfs_buf_ioerror_alert(bp, __func__); in xlog_bwrite()
284 xfs_buf_relse(bp); in xlog_bwrite()
368 struct xfs_buf *bp) in xlog_recover_iodone() argument
370 if (bp->b_error) { in xlog_recover_iodone()
375 if (!XFS_FORCED_SHUTDOWN(bp->b_target->bt_mount)) { in xlog_recover_iodone()
376 xfs_buf_ioerror_alert(bp, __func__); in xlog_recover_iodone()
377 xfs_force_shutdown(bp->b_target->bt_mount, in xlog_recover_iodone()
381 bp->b_iodone = NULL; in xlog_recover_iodone()
382 xfs_buf_ioend(bp); in xlog_recover_iodone()
394 struct xfs_buf *bp, in xlog_find_cycle_start() argument
408 error = xlog_bread(log, mid_blk, 1, bp, &offset); in xlog_find_cycle_start()
444 xfs_buf_t *bp; in xlog_find_verify_cycle() local
458 while (!(bp = xlog_get_bp(log, bufblks))) { in xlog_find_verify_cycle()
469 error = xlog_bread(log, i, bcount, bp, &buf); in xlog_find_verify_cycle()
487 xlog_put_bp(bp); in xlog_find_verify_cycle()
511 xfs_buf_t *bp; in xlog_find_verify_log_record() local
521 if (!(bp = xlog_get_bp(log, num_blks))) { in xlog_find_verify_log_record()
522 if (!(bp = xlog_get_bp(log, 1))) in xlog_find_verify_log_record()
526 error = xlog_bread(log, start_blk, num_blks, bp, &offset); in xlog_find_verify_log_record()
543 error = xlog_bread(log, i, 1, bp, &offset); in xlog_find_verify_log_record()
596 xlog_put_bp(bp); in xlog_find_verify_log_record()
618 xfs_buf_t *bp; in xlog_find_head() local
648 bp = xlog_get_bp(log, 1); in xlog_find_head()
649 if (!bp) in xlog_find_head()
652 error = xlog_bread(log, 0, 1, bp, &offset); in xlog_find_head()
659 error = xlog_bread(log, last_blk, 1, bp, &offset); in xlog_find_head()
729 if ((error = xlog_find_cycle_start(log, bp, first_blk, in xlog_find_head()
849 xlog_put_bp(bp); in xlog_find_head()
863 xlog_put_bp(bp); in xlog_find_head()
895 xfs_buf_t *bp; in xlog_find_tail() local
910 bp = xlog_get_bp(log, 1); in xlog_find_tail()
911 if (!bp) in xlog_find_tail()
914 error = xlog_bread(log, 0, 1, bp, &offset); in xlog_find_tail()
930 error = xlog_bread(log, i, 1, bp, &offset); in xlog_find_tail()
947 error = xlog_bread(log, i, 1, bp, &offset); in xlog_find_tail()
960 xlog_put_bp(bp); in xlog_find_tail()
1023 error = xlog_bread(log, umount_data_blk, 1, bp, &offset); in xlog_find_tail()
1073 xlog_put_bp(bp); in xlog_find_tail()
1101 xfs_buf_t *bp; in xlog_find_zeroed() local
1111 bp = xlog_get_bp(log, 1); in xlog_find_zeroed()
1112 if (!bp) in xlog_find_zeroed()
1114 error = xlog_bread(log, 0, 1, bp, &offset); in xlog_find_zeroed()
1121 xlog_put_bp(bp); in xlog_find_zeroed()
1126 error = xlog_bread(log, log_bbnum-1, 1, bp, &offset); in xlog_find_zeroed()
1132 xlog_put_bp(bp); in xlog_find_zeroed()
1148 if ((error = xlog_find_cycle_start(log, bp, 0, &last_blk, 0))) in xlog_find_zeroed()
1188 xlog_put_bp(bp); in xlog_find_zeroed()
1231 xfs_buf_t *bp; in xlog_write_log_records() local
1248 while (!(bp = xlog_get_bp(log, bufblks))) { in xlog_write_log_records()
1260 error = xlog_bread_noalign(log, start_block, 1, bp); in xlog_write_log_records()
1279 offset = bp->b_addr + BBTOB(ealign - start_block); in xlog_write_log_records()
1281 bp, offset); in xlog_write_log_records()
1287 offset = xlog_align(log, start_block, endcount, bp); in xlog_write_log_records()
1293 error = xlog_bwrite(log, start_block, endcount, bp); in xlog_write_log_records()
1301 xlog_put_bp(bp); in xlog_write_log_records()
1707 struct xfs_buf *bp, in xlog_recover_do_inode_buffer() argument
1728 bp->b_ops = &xfs_inode_buf_ops; in xlog_recover_do_inode_buffer()
1730 inodes_per_buf = BBTOB(bp->b_io_length) >> mp->m_sb.sb_inodelog; in xlog_recover_do_inode_buffer()
1773 BBTOB(bp->b_io_length)); in xlog_recover_do_inode_buffer()
1786 item, bp); in xlog_recover_do_inode_buffer()
1792 buffer_nextp = (xfs_agino_t *)xfs_buf_offset(bp, in xlog_recover_do_inode_buffer()
1802 xfs_buf_offset(bp, i * mp->m_sb.sb_inodesize)); in xlog_recover_do_inode_buffer()
1832 struct xfs_buf *bp) in xlog_recover_get_buf_lsn() argument
1837 void *blk = bp->b_addr; in xlog_recover_get_buf_lsn()
1968 struct xfs_buf *bp, in xlog_recover_validate_buf_type() argument
1971 struct xfs_da_blkinfo *info = bp->b_addr; in xlog_recover_validate_buf_type()
1987 magic32 = be32_to_cpu(*(__be32 *)bp->b_addr); in xlog_recover_validate_buf_type()
1988 magic16 = be16_to_cpu(*(__be16*)bp->b_addr); in xlog_recover_validate_buf_type()
1997 bp->b_ops = &xfs_allocbt_buf_ops; in xlog_recover_validate_buf_type()
2003 bp->b_ops = &xfs_inobt_buf_ops; in xlog_recover_validate_buf_type()
2007 bp->b_ops = &xfs_bmbt_buf_ops; in xlog_recover_validate_buf_type()
2021 bp->b_ops = &xfs_agf_buf_ops; in xlog_recover_validate_buf_type()
2029 bp->b_ops = &xfs_agfl_buf_ops; in xlog_recover_validate_buf_type()
2037 bp->b_ops = &xfs_agi_buf_ops; in xlog_recover_validate_buf_type()
2048 bp->b_ops = &xfs_dquot_buf_ops; in xlog_recover_validate_buf_type()
2061 bp->b_ops = &xfs_inode_buf_ops; in xlog_recover_validate_buf_type()
2069 bp->b_ops = &xfs_symlink_buf_ops; in xlog_recover_validate_buf_type()
2078 bp->b_ops = &xfs_dir3_block_buf_ops; in xlog_recover_validate_buf_type()
2087 bp->b_ops = &xfs_dir3_data_buf_ops; in xlog_recover_validate_buf_type()
2096 bp->b_ops = &xfs_dir3_free_buf_ops; in xlog_recover_validate_buf_type()
2105 bp->b_ops = &xfs_dir3_leaf1_buf_ops; in xlog_recover_validate_buf_type()
2114 bp->b_ops = &xfs_dir3_leafn_buf_ops; in xlog_recover_validate_buf_type()
2123 bp->b_ops = &xfs_da3_node_buf_ops; in xlog_recover_validate_buf_type()
2132 bp->b_ops = &xfs_attr3_leaf_buf_ops; in xlog_recover_validate_buf_type()
2140 bp->b_ops = &xfs_attr3_rmt_buf_ops; in xlog_recover_validate_buf_type()
2148 bp->b_ops = &xfs_sb_buf_ops; in xlog_recover_validate_buf_type()
2167 struct xfs_buf *bp, in xlog_recover_do_reg_buffer() argument
2189 ASSERT(BBTOB(bp->b_io_length) >= in xlog_recover_do_reg_buffer()
2229 memcpy(xfs_buf_offset(bp, in xlog_recover_do_reg_buffer()
2241 xlog_recover_validate_buf_type(mp, bp, buf_f); in xlog_recover_do_reg_buffer()
2258 struct xfs_buf *bp, in xlog_recover_do_dquot_buffer() argument
2284 xlog_recover_do_reg_buffer(mp, item, bp, buf_f); in xlog_recover_do_dquot_buffer()
2320 xfs_buf_t *bp; in xlog_recover_buffer_pass2() local
2341 bp = xfs_buf_read(mp->m_ddev_targp, buf_f->blf_blkno, buf_f->blf_len, in xlog_recover_buffer_pass2()
2343 if (!bp) in xlog_recover_buffer_pass2()
2345 error = bp->b_error; in xlog_recover_buffer_pass2()
2347 xfs_buf_ioerror_alert(bp, "xlog_recover_do..(read#1)"); in xlog_recover_buffer_pass2()
2370 lsn = xlog_recover_get_buf_lsn(mp, bp); in xlog_recover_buffer_pass2()
2372 xlog_recover_validate_buf_type(mp, bp, buf_f); in xlog_recover_buffer_pass2()
2377 error = xlog_recover_do_inode_buffer(mp, item, bp, buf_f); in xlog_recover_buffer_pass2()
2384 dirty = xlog_recover_do_dquot_buffer(mp, log, item, bp, buf_f); in xlog_recover_buffer_pass2()
2388 xlog_recover_do_reg_buffer(mp, item, bp, buf_f); in xlog_recover_buffer_pass2()
2407 be16_to_cpu(*((__be16 *)xfs_buf_offset(bp, 0))) && in xlog_recover_buffer_pass2()
2408 (BBTOB(bp->b_io_length) != MAX(log->l_mp->m_sb.sb_blocksize, in xlog_recover_buffer_pass2()
2410 xfs_buf_stale(bp); in xlog_recover_buffer_pass2()
2411 error = xfs_bwrite(bp); in xlog_recover_buffer_pass2()
2413 ASSERT(bp->b_target->bt_mount == mp); in xlog_recover_buffer_pass2()
2414 bp->b_iodone = xlog_recover_iodone; in xlog_recover_buffer_pass2()
2415 xfs_buf_delwri_queue(bp, buffer_list); in xlog_recover_buffer_pass2()
2419 xfs_buf_relse(bp); in xlog_recover_buffer_pass2()
2508 xfs_buf_t *bp; in xlog_recover_inode_pass2() local
2542 bp = xfs_buf_read(mp->m_ddev_targp, in_f->ilf_blkno, in_f->ilf_len, 0, in xlog_recover_inode_pass2()
2544 if (!bp) { in xlog_recover_inode_pass2()
2548 error = bp->b_error; in xlog_recover_inode_pass2()
2550 xfs_buf_ioerror_alert(bp, "xlog_recover_do..(read#2)"); in xlog_recover_inode_pass2()
2554 dip = (xfs_dinode_t *)xfs_buf_offset(bp, in_f->ilf_boffset); in xlog_recover_inode_pass2()
2563 __func__, dip, bp, in_f->ilf_ino); in xlog_recover_inode_pass2()
2632 __func__, item, dip, bp, in_f->ilf_ino); in xlog_recover_inode_pass2()
2645 __func__, item, dip, bp, in_f->ilf_ino); in xlog_recover_inode_pass2()
2656 __func__, item, dip, bp, in_f->ilf_ino, in xlog_recover_inode_pass2()
2668 item, dip, bp, in_f->ilf_ino, dicp->di_forkoff); in xlog_recover_inode_pass2()
2779 ASSERT(bp->b_target->bt_mount == mp); in xlog_recover_inode_pass2()
2780 bp->b_iodone = xlog_recover_iodone; in xlog_recover_inode_pass2()
2781 xfs_buf_delwri_queue(bp, buffer_list); in xlog_recover_inode_pass2()
2784 xfs_buf_relse(bp); in xlog_recover_inode_pass2()
2829 xfs_buf_t *bp; in xlog_recover_dquot_pass2() local
2887 XFS_FSB_TO_BB(mp, dq_f->qlf_len), 0, &bp, in xlog_recover_dquot_pass2()
2892 ASSERT(bp); in xlog_recover_dquot_pass2()
2893 ddq = (xfs_disk_dquot_t *)xfs_buf_offset(bp, dq_f->qlf_boffset); in xlog_recover_dquot_pass2()
2915 ASSERT(bp->b_target->bt_mount == mp); in xlog_recover_dquot_pass2()
2916 bp->b_iodone = xlog_recover_iodone; in xlog_recover_dquot_pass2()
2917 xfs_buf_delwri_queue(bp, buffer_list); in xlog_recover_dquot_pass2()
2920 xfs_buf_relse(bp); in xlog_recover_dquot_pass2()
4422 xfs_buf_t *bp; in xlog_do_recover() local
4454 bp = xfs_getsb(log->l_mp, 0); in xlog_do_recover()
4455 XFS_BUF_UNDONE(bp); in xlog_do_recover()
4456 ASSERT(!(XFS_BUF_ISWRITE(bp))); in xlog_do_recover()
4457 XFS_BUF_READ(bp); in xlog_do_recover()
4458 XFS_BUF_UNASYNC(bp); in xlog_do_recover()
4459 bp->b_ops = &xfs_sb_buf_ops; in xlog_do_recover()
4461 error = xfs_buf_submit_wait(bp); in xlog_do_recover()
4464 xfs_buf_ioerror_alert(bp, __func__); in xlog_do_recover()
4467 xfs_buf_relse(bp); in xlog_do_recover()
4473 xfs_sb_from_disk(sbp, XFS_BUF_TO_SBP(bp)); in xlog_do_recover()
4478 xfs_buf_relse(bp); in xlog_do_recover()