subr_disk.c (58934) | subr_disk.c (59249) |
---|---|
1/* 2 * ---------------------------------------------------------------------------- 3 * "THE BEER-WARE LICENSE" (Revision 42): 4 * <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you 5 * can do whatever you want with this stuff. If we meet some day, and you think 6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 7 * ---------------------------------------------------------------------------- 8 * | 1/* 2 * ---------------------------------------------------------------------------- 3 * "THE BEER-WARE LICENSE" (Revision 42): 4 * <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you 5 * can do whatever you want with this stuff. If we meet some day, and you think 6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 7 * ---------------------------------------------------------------------------- 8 * |
9 * $FreeBSD: head/sys/kern/subr_disk.c 58934 2000-04-02 15:24:56Z phk $ | 9 * $FreeBSD: head/sys/kern/subr_disk.c 59249 2000-04-15 05:54:02Z phk $ |
10 * 11 */ 12 13#include <sys/param.h> 14#include <sys/systm.h> 15#include <sys/kernel.h> 16#include <sys/sysctl.h> 17#include <sys/buf.h> --- 150 unchanged lines hidden (view full) --- 168 dsclose(dev, devtype, dp->d_slice); 169 if (!dsisopen(dp->d_slice)) { 170 error = dp->d_devsw->d_close(dp->d_dev, fflag, devtype, p); 171 } 172 return (error); 173} 174 175static void | 10 * 11 */ 12 13#include <sys/param.h> 14#include <sys/systm.h> 15#include <sys/kernel.h> 16#include <sys/sysctl.h> 17#include <sys/buf.h> --- 150 unchanged lines hidden (view full) --- 168 dsclose(dev, devtype, dp->d_slice); 169 if (!dsisopen(dp->d_slice)) { 170 error = dp->d_devsw->d_close(dp->d_dev, fflag, devtype, p); 171 } 172 return (error); 173} 174 175static void |
176diskstrategy(struct buf *bp) | 176diskstrategy(struct bio *bp) |
177{ 178 dev_t pdev; 179 struct disk *dp; 180 | 177{ 178 dev_t pdev; 179 struct disk *dp; 180 |
181 dp = bp->b_dev->si_disk; | 181 dp = bp->bio_dev->si_disk; |
182 if (!dp) { | 182 if (!dp) { |
183 pdev = dkmodpart(dkmodslice(bp->b_dev, WHOLE_DISK_SLICE), RAW_PART); 184 dp = bp->b_dev->si_disk = pdev->si_disk; 185 bp->b_dev->si_drv1 = pdev->si_drv1; 186 bp->b_dev->si_drv2 = pdev->si_drv2; 187 bp->b_dev->si_iosize_max = pdev->si_iosize_max; 188 bp->b_dev->si_bsize_phys = pdev->si_bsize_phys; 189 bp->b_dev->si_bsize_best = pdev->si_bsize_best; | 183 pdev = dkmodpart(dkmodslice(bp->bio_dev, WHOLE_DISK_SLICE), RAW_PART); 184 dp = bp->bio_dev->si_disk = pdev->si_disk; 185 bp->bio_dev->si_drv1 = pdev->si_drv1; 186 bp->bio_dev->si_drv2 = pdev->si_drv2; 187 bp->bio_dev->si_iosize_max = pdev->si_iosize_max; 188 bp->bio_dev->si_bsize_phys = pdev->si_bsize_phys; 189 bp->bio_dev->si_bsize_best = pdev->si_bsize_best; |
190 } 191 192 if (!dp) { | 190 } 191 192 if (!dp) { |
193 bp->b_error = ENXIO; 194 bp->b_ioflags |= BIO_ERROR; | 193 bp->bio_error = ENXIO; 194 bp->bio_flags |= BIO_ERROR; |
195 biodone(bp); 196 return; 197 } 198 199 if (dscheck(bp, dp->d_slice) <= 0) { 200 biodone(bp); 201 return; 202 } --- 48 unchanged lines hidden --- | 195 biodone(bp); 196 return; 197 } 198 199 if (dscheck(bp, dp->d_slice) <= 0) { 200 biodone(bp); 201 return; 202 } --- 48 unchanged lines hidden --- |