Lines Matching refs:cbp

945 #define	G_RAID3_NEXT_BIO(cbp)	(cbp)->bio_caller1
964 g_raid3_remove_bio(struct bio *cbp)
968 pbp = cbp->bio_parent;
969 if (G_RAID3_HEAD_BIO(pbp) == cbp)
970 G_RAID3_HEAD_BIO(pbp) = G_RAID3_NEXT_BIO(cbp);
973 if (G_RAID3_NEXT_BIO(bp) == cbp) {
974 G_RAID3_NEXT_BIO(bp) = G_RAID3_NEXT_BIO(cbp);
979 G_RAID3_NEXT_BIO(cbp) = NULL;
1004 g_raid3_destroy_bio(struct g_raid3_softc *sc, struct bio *cbp)
1009 pbp = cbp->bio_parent;
1011 KASSERT(cbp->bio_data != NULL, ("NULL bio_data"));
1013 g_raid3_free(sc, cbp->bio_data, size);
1014 if (G_RAID3_HEAD_BIO(pbp) == cbp) {
1015 G_RAID3_HEAD_BIO(pbp) = G_RAID3_NEXT_BIO(cbp);
1016 G_RAID3_NEXT_BIO(cbp) = NULL;
1017 g_destroy_bio(cbp);
1020 if (G_RAID3_NEXT_BIO(bp) == cbp)
1026 G_RAID3_NEXT_BIO(bp) = G_RAID3_NEXT_BIO(cbp);
1027 G_RAID3_NEXT_BIO(cbp) = NULL;
1029 g_destroy_bio(cbp);
1036 struct bio *bp, *cbp;
1040 cbp = g_clone_bio(pbp);
1041 if (cbp == NULL)
1048 cbp->bio_data = g_raid3_alloc(sc, size, memflag);
1049 if (cbp->bio_data == NULL) {
1051 g_destroy_bio(cbp);
1054 G_RAID3_NEXT_BIO(cbp) = NULL;
1056 G_RAID3_HEAD_BIO(pbp) = cbp;
1060 G_RAID3_NEXT_BIO(bp) = cbp;
1065 return (cbp);
1073 struct bio *bp, *cbp, *tmpbp;
1083 G_RAID3_FOREACH_BIO(pbp, cbp) {
1084 if ((cbp->bio_cflags & G_RAID3_BIO_CFLAG_PARITY) != 0) {
1085 bp = cbp;
1094 G_RAID3_FOREACH_BIO(pbp, cbp) {
1095 if (cbp == bp)
1097 bcopy(pbp->bio_data + padd, cbp->bio_data + cadd, atom);
1107 G_RAID3_FOREACH_SAFE_BIO(pbp, cbp, tmpbp) {
1108 if (cbp == bp)
1111 bcopy(cbp->bio_data, bp->bio_data,
1115 g_raid3_xor(cbp->bio_data, bp->bio_data,
1118 if ((cbp->bio_cflags & G_RAID3_BIO_CFLAG_NODISK) != 0)
1119 g_raid3_destroy_bio(sc, cbp);
1122 G_RAID3_FOREACH_SAFE_BIO(pbp, cbp, tmpbp) {
1125 disk = cbp->bio_caller2;
1127 cbp->bio_to = cp->provider;
1128 G_RAID3_LOGREQ(3, cbp, "Sending request.");
1134 g_io_request(cbp, cp);
1143 struct bio *xbp, *fbp, *cbp;
1156 G_RAID3_FOREACH_BIO(pbp, cbp) {
1157 if ((cbp->bio_cflags & G_RAID3_BIO_CFLAG_PARITY) != 0) {
1159 xbp = cbp;
1161 if (cbp->bio_error == 0)
1173 pbp->bio_error = cbp->bio_error;
1175 fbp = cbp;
1184 disk = cbp->bio_caller2;
1189 G_RAID3_LOGREQ(0, cbp, "Request failed (error=%d).",
1190 cbp->bio_error);
1192 G_RAID3_LOGREQ(1, cbp, "Request failed (error=%d).",
1193 cbp->bio_error);
1246 G_RAID3_FOREACH_BIO(pbp, cbp) {
1247 if ((cbp->bio_cflags & G_RAID3_BIO_CFLAG_PARITY) != 0)
1249 g_raid3_xor(cbp->bio_data, xbp->bio_data,
1265 G_RAID3_FOREACH_BIO(pbp, cbp) {
1266 bcopy(cbp->bio_data + cadd, pbp->bio_data + padd, atom);
1282 while ((cbp = G_RAID3_HEAD_BIO(pbp)) != NULL)
1283 g_raid3_destroy_bio(sc, cbp);
1303 g_raid3_regular_request(struct bio *cbp)
1311 pbp = cbp->bio_parent;
1313 cbp->bio_from->index--;
1314 if (cbp->bio_cmd == BIO_WRITE)
1316 disk = cbp->bio_from->private;
1319 g_raid3_kill_consumer(sc, cbp->bio_from);
1323 G_RAID3_LOGREQ(3, cbp, "Request finished.");
1340 while ((cbp = G_RAID3_HEAD_BIO(pbp)) != NULL) {
1341 if (cbp->bio_error == 0) {
1342 g_raid3_destroy_bio(sc, cbp);
1347 error = cbp->bio_error;
1355 disk = cbp->bio_caller2;
1357 g_raid3_destroy_bio(sc, cbp);
1363 G_RAID3_LOGREQ(0, cbp,
1365 cbp->bio_error);
1367 G_RAID3_LOGREQ(1, cbp,
1369 cbp->bio_error);
1378 g_raid3_destroy_bio(sc, cbp);
1416 struct bio *cbp;
1424 cbp = g_clone_bio(bp);
1425 if (cbp == NULL) {
1426 for (cbp = bioq_first(&queue); cbp != NULL;
1427 cbp = bioq_first(&queue)) {
1428 bioq_remove(&queue, cbp);
1429 g_destroy_bio(cbp);
1436 bioq_insert_tail(&queue, cbp);
1437 cbp->bio_done = g_std_done;
1438 cbp->bio_caller1 = disk;
1439 cbp->bio_to = disk->d_consumer->provider;
1441 for (cbp = bioq_first(&queue); cbp != NULL; cbp = bioq_first(&queue)) {
1442 bioq_remove(&queue, cbp);
1443 G_RAID3_LOGREQ(3, cbp, "Sending request.");
1444 disk = cbp->bio_caller1;
1445 cbp->bio_caller1 = NULL;
1450 g_io_request(cbp, disk->d_consumer);
1802 struct bio *cbp, *tmpbp;
1860 cbp = g_raid3_clone_bio(sc, pbp);
1861 if (cbp == NULL) {
1862 while ((cbp = G_RAID3_HEAD_BIO(pbp)) != NULL)
1863 g_raid3_destroy_bio(sc, cbp);
1877 cbp->bio_offset = offset;
1878 cbp->bio_length = length;
1879 cbp->bio_done = g_raid3_done;
1888 cbp->bio_cflags |= G_RAID3_BIO_CFLAG_PARITY;
1898 cbp->bio_cflags |= G_RAID3_BIO_CFLAG_PARITY;
1902 cbp->bio_cflags |= G_RAID3_BIO_CFLAG_PARITY;
1913 cbp->bio_cflags |=
1925 g_raid3_destroy_bio(sc, cbp);
1926 cbp = NULL;
1928 cbp->bio_cflags |=
1935 if (cbp != NULL)
1936 cbp->bio_caller2 = disk;
1948 G_RAID3_FOREACH_SAFE_BIO(pbp, cbp, tmpbp) {
1949 disk = cbp->bio_caller2;
1951 cbp->bio_to = cp->provider;
1952 G_RAID3_LOGREQ(3, cbp, "Sending request.");
1957 g_io_request(cbp, cp);