Lines Matching defs:bp
75 flash_io_getblock(struct flash_io *fio, struct buf *bp)
80 block = bp->b_rawblkno * DEV_BSIZE / fio->fio_if->erasesize;
83 last = (bp->b_rawblkno * DEV_BSIZE + bp->b_resid - 1)
89 bp->b_rawblkno * DEV_BSIZE,
90 bp->b_rawblkno * DEV_BSIZE + bp->b_resid - 1);
158 flash_io_submit(struct flash_io *fio, struct buf *bp)
160 FLDPRINTF(("submitting job to flash io thread: %p\n", bp));
163 flash_io_done(fio, bp, ENODEV);
167 if (BUF_ISREAD(bp)) {
175 flash_io_read(fio, bp);
179 flash_io_write(fio, bp);
185 flash_io_cache_write(struct flash_io *fio, flash_addr_t block, struct buf *bp)
195 offset = bp->b_rawblkno * DEV_BSIZE - base;
219 memcpy(fio->fio_data + offset, bp->b_data, bp->b_resid);
220 bufq_put(fio->fio_bufq, bp);
232 struct buf *bp;
269 while ((bp = bufq_get(fio->fio_bufq)) != NULL)
270 flash_io_done(fio, bp, error);
310 flash_io_read(struct flash_io *fio, struct buf *bp)
318 offset = bp->b_rawblkno * DEV_BSIZE;
320 error = fio->fio_if->read(fio->fio_dev, offset, bp->b_resid,
321 &retlen, bp->b_data);
323 flash_io_done(fio, bp, error);
327 flash_io_write(struct flash_io *fio, struct buf *bp)
333 block = flash_io_getblock(fio, bp);
343 flash_io_cache_write(fio, block, bp);
349 flash_io_done(struct flash_io *fio, struct buf *bp, int error)
351 FLDPRINTF(("io done: %p\n", bp));
354 bp->b_resid = 0;
356 bp->b_error = error;
357 biodone(bp);