- physio(swstrategy, &rswbuf, dev, B_WRITE, minphys);
+#ifdef GENERIC
+ /*
+ * A mini-root gets copied into the front of the swap
+ * and we run over top of the swap area just long
+ * enough for us to do a mkfs and restor of the real
+ * root (sure beats rewriting standalone restor).
+ */
+#define MINIROOTSIZE 4096
+ if (rootdev == dumpdev)
+ bp->b_blkno += MINIROOTSIZE;
+#endif
+ sz = howmany(bp->b_bcount, DEV_BSIZE);
+ if (bp->b_blkno + sz > nswap) {
+ bp->b_flags |= B_ERROR;
+ biodone(bp);
+ return;
+ }
+ if (nswdev > 1) {
+ off = bp->b_blkno % dmmax;
+ if (off+sz > dmmax) {
+ bp->b_flags |= B_ERROR;
+ biodone(bp);
+ return;
+ }
+ seg = bp->b_blkno / dmmax;
+ index = seg % nswdev;
+ seg /= nswdev;
+ bp->b_blkno = seg*dmmax + off;
+ } else
+ index = 0;
+ sp = &swdevt[index];
+#ifdef SECSIZE
+ bp->b_blkno <<= sp->sw_bshift;
+ bp->b_blksize = sp->sw_blksize;
+#endif SECSIZE
+ bp->b_dev = sp->sw_dev;
+ if (bp->b_dev == 0)
+ panic("swstrategy");
+ (*bdevsw[major(bp->b_dev)].d_strategy)(bp);