Deleted Added
full compact
ctl_backend_ramdisk.c (267519) ctl_backend_ramdisk.c (267537)
1/*-
2 * Copyright (c) 2003, 2008 Silicon Graphics International Corp.
3 * Copyright (c) 2012 The FreeBSD Foundation
4 * All rights reserved.
5 *
6 * Portions of this software were developed by Edward Tomasz Napierala
7 * under sponsorship from the FreeBSD Foundation.
8 *

--- 26 unchanged lines hidden (view full) ---

35 */
36/*
37 * CAM Target Layer backend for a "fake" ramdisk.
38 *
39 * Author: Ken Merry <ken@FreeBSD.org>
40 */
41
42#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2003, 2008 Silicon Graphics International Corp.
3 * Copyright (c) 2012 The FreeBSD Foundation
4 * All rights reserved.
5 *
6 * Portions of this software were developed by Edward Tomasz Napierala
7 * under sponsorship from the FreeBSD Foundation.
8 *

--- 26 unchanged lines hidden (view full) ---

35 */
36/*
37 * CAM Target Layer backend for a "fake" ramdisk.
38 *
39 * Author: Ken Merry <ken@FreeBSD.org>
40 */
41
42#include <sys/cdefs.h>
43__FBSDID("$FreeBSD: head/sys/cam/ctl/ctl_backend_ramdisk.c 267519 2014-06-15 20:14:11Z mav $");
43__FBSDID("$FreeBSD: head/sys/cam/ctl/ctl_backend_ramdisk.c 267537 2014-06-16 11:00:14Z mav $");
44
45#include <sys/param.h>
46#include <sys/systm.h>
47#include <sys/kernel.h>
48#include <sys/condvar.h>
49#include <sys/types.h>
50#include <sys/lock.h>
51#include <sys/mutex.h>

--- 210 unchanged lines hidden (view full) ---

262 * using 16 bits for an error code, since that's
263 * all the space we have in the sks field.
264 */
265 ctl_set_internal_failure(&io->scsiio,
266 /*sks_valid*/ 1,
267 /*retry_count*/
268 io->io_hdr.port_status);
269 }
44
45#include <sys/param.h>
46#include <sys/systm.h>
47#include <sys/kernel.h>
48#include <sys/condvar.h>
49#include <sys/types.h>
50#include <sys/lock.h>
51#include <sys/mutex.h>

--- 210 unchanged lines hidden (view full) ---

262 * using 16 bits for an error code, since that's
263 * all the space we have in the sks field.
264 */
265 ctl_set_internal_failure(&io->scsiio,
266 /*sks_valid*/ 1,
267 /*retry_count*/
268 io->io_hdr.port_status);
269 }
270 ctl_done(io);
270 ctl_data_submit_done(io);
271 return(0);
272}
273
274static int
275ctl_backend_ramdisk_submit(union ctl_io *io)
276{
277 struct ctl_be_lun *ctl_be_lun;
271 return(0);
272}
273
274static int
275ctl_backend_ramdisk_submit(union ctl_io *io)
276{
277 struct ctl_be_lun *ctl_be_lun;
278 struct ctl_lba_len *lbalen;
278 struct ctl_lba_len_flags *lbalen;
279
280 ctl_be_lun = (struct ctl_be_lun *)io->io_hdr.ctl_private[
281 CTL_PRIV_BACKEND_LUN].ptr;
279
280 ctl_be_lun = (struct ctl_be_lun *)io->io_hdr.ctl_private[
281 CTL_PRIV_BACKEND_LUN].ptr;
282 lbalen = (struct ctl_lba_len *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
282 lbalen = (struct ctl_lba_len_flags *)&io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN];
283 if (lbalen->flags & CTL_LLF_VERIFY) {
284 ctl_set_success(&io->scsiio);
285 ctl_data_submit_done(io);
286 return (CTL_RETVAL_COMPLETE);
287 }
283 io->io_hdr.ctl_private[CTL_PRIV_BACKEND].integer =
284 lbalen->len * ctl_be_lun->blocksize;
285 ctl_backend_ramdisk_continue(io);
286 return (CTL_RETVAL_COMPLETE);
287}
288
289static void
290ctl_backend_ramdisk_continue(union ctl_io *io)

--- 676 unchanged lines hidden ---
288 io->io_hdr.ctl_private[CTL_PRIV_BACKEND].integer =
289 lbalen->len * ctl_be_lun->blocksize;
290 ctl_backend_ramdisk_continue(io);
291 return (CTL_RETVAL_COMPLETE);
292}
293
294static void
295ctl_backend_ramdisk_continue(union ctl_io *io)

--- 676 unchanged lines hidden ---