diff options
author | phk <phk@FreeBSD.org> | 2004-11-04 08:38:07 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-11-04 08:38:07 +0000 |
commit | 50168ede53026689de3fa360a408431643fee3bd (patch) | |
tree | d686152871ddc575e662110a2928f87f35e9cb0c | |
parent | 1afcf752787de0bedf3d93599ce4f103bed718c9 (diff) | |
download | FreeBSD-src-50168ede53026689de3fa360a408431643fee3bd.zip FreeBSD-src-50168ede53026689de3fa360a408431643fee3bd.tar.gz |
De-couple our I/O bio request from the embedded bio in buf by explicitly
copying the fields.
-rw-r--r-- | sys/vm/swap_pager.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c index 8360d6a..b4c6a6a 100644 --- a/sys/vm/swap_pager.c +++ b/sys/vm/swap_pager.c @@ -2374,8 +2374,11 @@ swapgeom_done(struct bio *bp2) struct buf *bp; bp = bp2->bio_caller2; + bp->b_ioflags = bp2->bio_flags; if (bp2->bio_error) bp->b_ioflags |= BIO_ERROR; + bp->b_resid = bp->b_bcount - bp2->bio_completed; + bp->b_error = bp2->bio_error; bufdone(bp); g_destroy_bio(bp2); } @@ -2393,7 +2396,7 @@ swapgeom_strategy(struct buf *bp, struct swdevt *sp) bufdone(bp); return; } - bio = g_clone_bio(&bp->b_io); + bio = g_new_bio(); if (bio == NULL) { /* * XXX: This is better than panicing, but not much better. @@ -2406,6 +2409,8 @@ swapgeom_strategy(struct buf *bp, struct swdevt *sp) return; } bio->bio_caller2 = bp; + bio->bio_cmd = bp->b_iocmd; + bio->bio_data = bp->b_data; bio->bio_offset = (bp->b_blkno - sp->sw_first) * PAGE_SIZE; bio->bio_length = bp->b_bcount; bio->bio_done = swapgeom_done; |