blkfront.c (246e7a2b6494cd991b08ac669ed761ecea0cc98c) | blkfront.c (77b6916d2ef21b25d0dda700d751aa8735b3c02d) |
---|---|
1/* 2 * XenBSD block device driver 3 * 4 * Copyright (c) 2010-2013 Spectra Logic Corporation 5 * Copyright (c) 2009 Scott Long, Yahoo! 6 * Copyright (c) 2009 Frank Suchomel, Citrix 7 * Copyright (c) 2009 Doug F. Rabson, Citrix 8 * Copyright (c) 2005 Kip Macy --- 258 unchanged lines hidden (view full) --- 267 return; 268} 269 270static int 271xbd_queue_request(struct xbd_softc *sc, struct xbd_command *cm) 272{ 273 int error; 274 | 1/* 2 * XenBSD block device driver 3 * 4 * Copyright (c) 2010-2013 Spectra Logic Corporation 5 * Copyright (c) 2009 Scott Long, Yahoo! 6 * Copyright (c) 2009 Frank Suchomel, Citrix 7 * Copyright (c) 2009 Doug F. Rabson, Citrix 8 * Copyright (c) 2005 Kip Macy --- 258 unchanged lines hidden (view full) --- 267 return; 268} 269 270static int 271xbd_queue_request(struct xbd_softc *sc, struct xbd_command *cm) 272{ 273 int error; 274 |
275 if (cm->cm_bp != NULL) 276 error = bus_dmamap_load_bio(sc->xbd_io_dmat, cm->cm_map, 277 cm->cm_bp, xbd_queue_cb, cm, 0); 278 else 279 error = bus_dmamap_load(sc->xbd_io_dmat, cm->cm_map, 280 cm->cm_data, cm->cm_datalen, xbd_queue_cb, cm, 0); | 275 error = bus_dmamap_load(sc->xbd_io_dmat, cm->cm_map, cm->cm_data, 276 cm->cm_datalen, xbd_queue_cb, cm, 0); |
281 if (error == EINPROGRESS) { 282 /* 283 * Maintain queuing order by freezing the queue. The next 284 * command may not require as many resources as the command 285 * we just attempted to map, so we can't rely on bus dma 286 * blocking for it too. 287 */ 288 xbd_cm_freeze(sc, cm, XBDCF_ASYNC_MAPPING); --- 43 unchanged lines hidden (view full) --- 332 sc->xbd_max_request_segments); 333 xbd_freeze(sc, XBDF_GNT_SHORTAGE); 334 xbd_requeue_bio(sc, bp); 335 xbd_enqueue_cm(cm, XBD_Q_FREE); 336 return (NULL); 337 } 338 339 cm->cm_bp = bp; | 277 if (error == EINPROGRESS) { 278 /* 279 * Maintain queuing order by freezing the queue. The next 280 * command may not require as many resources as the command 281 * we just attempted to map, so we can't rely on bus dma 282 * blocking for it too. 283 */ 284 xbd_cm_freeze(sc, cm, XBDCF_ASYNC_MAPPING); --- 43 unchanged lines hidden (view full) --- 328 sc->xbd_max_request_segments); 329 xbd_freeze(sc, XBDF_GNT_SHORTAGE); 330 xbd_requeue_bio(sc, bp); 331 xbd_enqueue_cm(cm, XBD_Q_FREE); 332 return (NULL); 333 } 334 335 cm->cm_bp = bp; |
336 cm->cm_data = bp->bio_data; 337 cm->cm_datalen = bp->bio_bcount; |
|
340 cm->cm_sector_number = (blkif_sector_t)bp->bio_pblkno; 341 342 switch (bp->bio_cmd) { 343 case BIO_READ: 344 cm->cm_operation = BLKIF_OP_READ; 345 break; 346 case BIO_WRITE: 347 cm->cm_operation = BLKIF_OP_WRITE; --- 642 unchanged lines hidden (view full) --- 990 sc->xbd_disk->d_strategy = xbd_strategy; 991 sc->xbd_disk->d_dump = xbd_dump; 992 sc->xbd_disk->d_name = name; 993 sc->xbd_disk->d_drv1 = sc; 994 sc->xbd_disk->d_sectorsize = sector_size; 995 996 sc->xbd_disk->d_mediasize = sectors * sector_size; 997 sc->xbd_disk->d_maxsize = sc->xbd_max_request_size; | 338 cm->cm_sector_number = (blkif_sector_t)bp->bio_pblkno; 339 340 switch (bp->bio_cmd) { 341 case BIO_READ: 342 cm->cm_operation = BLKIF_OP_READ; 343 break; 344 case BIO_WRITE: 345 cm->cm_operation = BLKIF_OP_WRITE; --- 642 unchanged lines hidden (view full) --- 988 sc->xbd_disk->d_strategy = xbd_strategy; 989 sc->xbd_disk->d_dump = xbd_dump; 990 sc->xbd_disk->d_name = name; 991 sc->xbd_disk->d_drv1 = sc; 992 sc->xbd_disk->d_sectorsize = sector_size; 993 994 sc->xbd_disk->d_mediasize = sectors * sector_size; 995 sc->xbd_disk->d_maxsize = sc->xbd_max_request_size; |
998 sc->xbd_disk->d_flags = DISKFLAG_UNMAPPED_BIO; | 996 sc->xbd_disk->d_flags = 0; |
999 if ((sc->xbd_flags & (XBDF_FLUSH|XBDF_BARRIER)) != 0) { 1000 sc->xbd_disk->d_flags |= DISKFLAG_CANFLUSHCACHE; 1001 device_printf(sc->xbd_dev, 1002 "synchronize cache commands enabled.\n"); 1003 } 1004 disk_create(sc->xbd_disk, DISK_VERSION); 1005 1006 return error; --- 582 unchanged lines hidden --- | 997 if ((sc->xbd_flags & (XBDF_FLUSH|XBDF_BARRIER)) != 0) { 998 sc->xbd_disk->d_flags |= DISKFLAG_CANFLUSHCACHE; 999 device_printf(sc->xbd_dev, 1000 "synchronize cache commands enabled.\n"); 1001 } 1002 disk_create(sc->xbd_disk, DISK_VERSION); 1003 1004 return error; --- 582 unchanged lines hidden --- |