Deleted Added
full compact
ctl_backend_ramdisk.c (287670) ctl_backend_ramdisk.c (288020)
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 287670 2015-09-11 14:33:05Z mav $");
43__FBSDID("$FreeBSD: head/sys/cam/ctl/ctl_backend_ramdisk.c 288020 2015-09-20 10:40:30Z 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>

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

316 sg_filled, M_RAMDISK,
317 M_WAITOK);
318 sg_entries = (struct ctl_sg_entry *)io->scsiio.kern_data_ptr;
319 for (i = 0, len_filled = 0; i < sg_filled; i++) {
320 sg_entries[i].addr = softc->ramdisk_pages[i];
321 sg_entries[i].len = MIN(PAGE_SIZE, len - len_filled);
322 len_filled += sg_entries[i].len;
323 }
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>

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

316 sg_filled, M_RAMDISK,
317 M_WAITOK);
318 sg_entries = (struct ctl_sg_entry *)io->scsiio.kern_data_ptr;
319 for (i = 0, len_filled = 0; i < sg_filled; i++) {
320 sg_entries[i].addr = softc->ramdisk_pages[i];
321 sg_entries[i].len = MIN(PAGE_SIZE, len - len_filled);
322 len_filled += sg_entries[i].len;
323 }
324 io->io_hdr.flags |= CTL_FLAG_KDPTR_SGLIST;
325 } else {
326 sg_filled = 0;
327 len_filled = len;
328 io->scsiio.kern_data_ptr = softc->ramdisk_pages[0];
329 }
330#else
331 sg_filled = 0;
332 len_filled = min(len, softc->rd_size);

--- 662 unchanged lines hidden ---
324 } else {
325 sg_filled = 0;
326 len_filled = len;
327 io->scsiio.kern_data_ptr = softc->ramdisk_pages[0];
328 }
329#else
330 sg_filled = 0;
331 len_filled = min(len, softc->rd_size);

--- 662 unchanged lines hidden ---