Lines Matching refs:bp

436 	struct bio *bp;
478 bp = &trs->trso_bio;
479 memset(bp, 0, sizeof(*bp));
480 bp->bio_offset = offset + start +
482 bp->bio_length = len;
483 bp->bio_data = trs->trso_buffer;
484 bp->bio_cmd = BIO_READ;
485 bp->bio_cflags = G_RAID_BIO_FLAG_SYNC;
486 bp->bio_caller1 = &vol->v_subdisks[(disk + best) % vol->v_disks_count];
487 G_RAID_LOGREQ(3, bp, "Queueing rebuild read");
501 g_raid_lock_range(sd->sd_volume, virtual, len, NULL, bp);
693 g_raid_tr_iostart_raid1e_read(struct g_raid_tr_object *tr, struct bio *bp)
705 if ((bp->bio_flags & BIO_UNMAPPED) != 0)
708 addr = bp->bio_data;
710 V2P(vol, bp->bio_offset, &no, &offset, &start);
711 remain = bp->bio_length;
724 cbp = g_clone_bio(bp);
729 if ((bp->bio_flags & BIO_UNMAPPED) != 0) {
757 if (bp->bio_error == 0)
758 bp->bio_error = ENOMEM;
759 g_raid_iodone(bp, bp->bio_error);
763 g_raid_tr_iostart_raid1e_write(struct g_raid_tr_object *tr, struct bio *bp)
775 if ((bp->bio_flags & BIO_UNMAPPED) != 0)
778 addr = bp->bio_data;
780 V2P(vol, bp->bio_offset, &no, &offset, &start);
781 remain = bp->bio_length;
799 cbp = g_clone_bio(bp);
804 if ((bp->bio_flags & BIO_UNMAPPED) != 0 &&
805 bp->bio_cmd != BIO_DELETE) {
822 if (bp->bio_cmd != BIO_DELETE)
835 if (bp->bio_error == 0)
836 bp->bio_error = ENOMEM;
837 g_raid_iodone(bp, bp->bio_error);
841 g_raid_tr_iostart_raid1e(struct g_raid_tr_object *tr, struct bio *bp)
851 g_raid_iodone(bp, EIO);
861 !(bp->bio_cflags & G_RAID_BIO_FLAG_SPECIAL)) {
869 switch (bp->bio_cmd) {
871 g_raid_tr_iostart_raid1e_read(tr, bp);
875 g_raid_tr_iostart_raid1e_write(tr, bp);
878 g_raid_tr_flush_common(tr, bp);
882 bp->bio_cmd, vol->v_name));
889 struct g_raid_subdisk *sd, struct bio *bp)
902 if (bp->bio_cflags & G_RAID_BIO_FLAG_SYNC) {
905 if (bp->bio_cmd == BIO_READ) {
915 if (bp->bio_error != 0) {
916 G_RAID_LOGREQ(0, bp,
919 bp->bio_error);
927 G_RAID_LOGREQ(3, bp, "Rebuild read done: %d",
928 bp->bio_error);
929 bp->bio_cmd = BIO_WRITE;
930 bp->bio_cflags = G_RAID_BIO_FLAG_SYNC;
931 bp->bio_offset = nsd->sd_rebuild_pos;
932 G_RAID_LOGREQ(3, bp, "Queueing rebuild write.");
933 g_raid_subdisk_iostart(nsd, bp);
941 G_RAID_LOGREQ(3, bp, "Rebuild write done: %d",
942 bp->bio_error);
943 if (bp->bio_error != 0 ||
958 nsd->sd_rebuild_pos += bp->bio_length;
1002 pbp = bp->bio_parent;
1004 mask = (intptr_t)bp->bio_caller2;
1005 if (bp->bio_cmd == BIO_READ && bp->bio_error != 0) {
1012 G_RAID_LOGREQ(0, bp,
1014 bp->bio_error, sd->sd_disk->d_read_errs);
1029 P2V(vol, sd->sd_pos, bp->bio_offset, &virtual, &copy);
1043 cbp->bio_length = bp->bio_length;
1044 cbp->bio_data = bp->bio_data;
1045 cbp->bio_ma = bp->bio_ma;
1046 cbp->bio_ma_offset = bp->bio_ma_offset;
1047 cbp->bio_ma_n = bp->bio_ma_n;
1048 g_destroy_bio(bp);
1073 G_RAID_LOGREQ(2, bp, "Couldn't retry read, failing it");
1075 if (bp->bio_cmd == BIO_READ &&
1076 bp->bio_error == 0 &&
1078 G_RAID_LOGREQ(3, bp, "Recovered data from other drive");
1081 P2V(vol, sd->sd_pos, bp->bio_offset, &virtual, &copy);
1097 g_destroy_bio(bp);
1116 P2V(vol, sd->sd_pos, bp->bio_offset, &virtual, &copy);
1125 if (bp->bio_cmd == BIO_WRITE && bp->bio_error) {
1126 G_RAID_LOGREQ(0, bp, "Remap write failed: "
1129 bp->bio_error = 0;
1131 G_RAID_LOGREQ(2, bp, "REMAP done %d.", bp->bio_error);
1132 g_raid_unlock_range(sd->sd_volume, virtual, bp->bio_length);
1136 pbp->bio_error = bp->bio_error;
1137 if (pbp->bio_cmd == BIO_WRITE && bp->bio_error != 0) {
1138 G_RAID_LOGREQ(0, bp, "Write failed: failing subdisk.");
1143 error = bp->bio_error;
1144 g_destroy_bio(bp);
1205 struct bio *bp;
1208 bp = (struct bio *)argp;
1209 sd = (struct g_raid_subdisk *)bp->bio_caller1;
1210 g_raid_subdisk_iostart(sd, bp);