Lines Matching defs:bp
235 static void mdevstrategy(struct buf *bp) {
242 devid = minor(buf_device(bp)); /* Get minor device number */
245 buf_seterror(bp, ENXIO);
246 buf_biodone(bp);
250 buf_setresid(bp, buf_count(bp)); /* Set byte count */
252 blkoff = buf_blkno(bp) * mdev[devid].mdSecsize; /* Get offset into file */
261 buf_seterror(bp, EINVAL); /* Yeah, this is an error */
263 buf_biodone(bp); /* Return */
267 if ((blkoff + buf_count(bp)) > (mdev[devid].mdSize << 12)) { /* Will this read go past end? */
268 buf_setcount(bp, ((mdev[devid].mdSize << 12) - blkoff)); /* Yes, trim to max */
274 if (buf_map(bp, (caddr_t *)&vaddr))
279 if (buf_flags(bp) & B_READ) { /* Is this a read? */
282 (void *)vaddr, (size_t)buf_count(bp)); /* This is virtual, just get the data */
285 left = buf_count(bp); /* Init the amount left to copy */
308 (size_t)buf_count(bp)); /* This is virtual, just put the data */
311 left = buf_count(bp); /* Init the amount left to copy */
337 buf_unmap(bp);
339 buf_setresid(bp, 0); /* Nothing more to do */
340 buf_biodone(bp); /* Say we've finished */