Lines Matching refs:bp
39 disk_err(struct bio *bp, const char *what, int blkdone, int nl) in disk_err() argument
43 if (bp->bio_dev != NULL) in disk_err()
44 printf("%s: %s ", devtoname(bp->bio_dev), what); in disk_err()
45 else if (bp->bio_disk != NULL) in disk_err()
47 bp->bio_disk->d_name, bp->bio_disk->d_unit, what); in disk_err()
50 switch(bp->bio_cmd) { in disk_err()
56 default: printf("cmd=%x ", bp->bio_cmd); break; in disk_err()
58 sn = bp->bio_pblkno; in disk_err()
59 if (bp->bio_bcount <= DEV_BSIZE) { in disk_err()
67 printf("%jd-%jd", (intmax_t)bp->bio_pblkno, in disk_err()
68 (intmax_t)(bp->bio_pblkno + (bp->bio_bcount - 1) / DEV_BSIZE)); in disk_err()
163 bioq_remove(struct bio_queue_head *head, struct bio *bp) in bioq_remove() argument
167 if (bp == TAILQ_FIRST(&head->queue)) in bioq_remove()
168 head->last_offset = bp->bio_offset + bp->bio_length; in bioq_remove()
169 } else if (bp == head->insert_point) in bioq_remove()
172 TAILQ_REMOVE(&head->queue, bp, bio_queue); in bioq_remove()
181 struct bio *bp; in bioq_flush() local
183 while ((bp = bioq_takefirst(head)) != NULL) in bioq_flush()
184 biofinish(bp, stp, error); in bioq_flush()
188 bioq_insert_head(struct bio_queue_head *head, struct bio *bp) in bioq_insert_head() argument
192 head->last_offset = bp->bio_offset; in bioq_insert_head()
193 TAILQ_INSERT_HEAD(&head->queue, bp, bio_queue); in bioq_insert_head()
199 bioq_insert_tail(struct bio_queue_head *head, struct bio *bp) in bioq_insert_tail() argument
202 TAILQ_INSERT_TAIL(&head->queue, bp, bio_queue); in bioq_insert_tail()
205 head->insert_point = bp; in bioq_insert_tail()
206 head->last_offset = bp->bio_offset; in bioq_insert_tail()
219 struct bio *bp; in bioq_takefirst() local
221 bp = TAILQ_FIRST(&head->queue); in bioq_takefirst()
222 if (bp != NULL) in bioq_takefirst()
223 bioq_remove(head, bp); in bioq_takefirst()
224 return (bp); in bioq_takefirst()
233 bioq_bio_key(struct bio_queue_head *head, struct bio *bp) in bioq_bio_key() argument
236 return ((uoff_t)(bp->bio_offset - head->last_offset)); in bioq_bio_key()
247 bioq_disksort(struct bio_queue_head *head, struct bio *bp) in bioq_disksort() argument
252 if ((bp->bio_flags & BIO_ORDERED) != 0) { in bioq_disksort()
259 bioq_insert_tail(head, bp); in bioq_disksort()
268 if (bp->bio_cmd != BIO_READ && bp->bio_cmd != BIO_WRITE && in bioq_disksort()
269 bp->bio_cmd != BIO_DELETE) { in bioq_disksort()
270 bioq_insert_tail(head, bp); in bioq_disksort()
275 bioq_insert_tail(head, bp); in bioq_disksort()
280 key = bioq_bio_key(head, bp); in bioq_disksort()
294 TAILQ_INSERT_HEAD(&head->queue, bp, bio_queue); in bioq_disksort()
296 TAILQ_INSERT_AFTER(&head->queue, prev, bp, bio_queue); in bioq_disksort()