Deleted Added
sdiff udiff text old ( 275459 ) new ( 275474 )
full compact
1/*-
2 * Copyright (c) 2003-2009 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 *

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

37 * CAM Target Layer, a SCSI device emulation subsystem.
38 *
39 * Author: Ken Merry <ken@FreeBSD.org>
40 */
41
42#define _CTL_C
43
44#include <sys/cdefs.h>
45__FBSDID("$FreeBSD: head/sys/cam/ctl/ctl.c 275459 2014-12-03 15:19:38Z mav $");
46
47#include <sys/param.h>
48#include <sys/systm.h>
49#include <sys/ctype.h>
50#include <sys/kernel.h>
51#include <sys/types.h>
52#include <sys/kthread.h>
53#include <sys/bio.h>

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

5167 buf = io->scsiio.kern_data_ptr;
5168 else
5169 buf = NULL;
5170 ctl_done(io);
5171 if (buf)
5172 free(buf, M_CTL);
5173}
5174
5175/*
5176 * SCSI release command.
5177 */
5178int
5179ctl_scsi_release(struct ctl_scsiio *ctsio)
5180{
5181 int length, longid, thirdparty_id, resv_id;
5182 struct ctl_softc *ctl_softc;

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

7168 ctl_set_success(ctsio);
7169 ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED;
7170 ctsio->be_move_done = ctl_config_move_done;
7171 ctl_datamove((union ctl_io *)ctsio);
7172 return (CTL_RETVAL_COMPLETE);
7173}
7174
7175int
7176ctl_read_defect(struct ctl_scsiio *ctsio)
7177{
7178 struct scsi_read_defect_data_10 *ccb10;
7179 struct scsi_read_defect_data_12 *ccb12;
7180 struct scsi_read_defect_data_hdr_10 *data10;
7181 struct scsi_read_defect_data_hdr_12 *data12;
7182 uint32_t alloc_len, data_len;
7183 uint8_t format;

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

10637 *len = scsi_4btoul(cdb->length);
10638 break;
10639 }
10640 case UNMAP: {
10641 *lba = 0;
10642 *len = UINT64_MAX;
10643 break;
10644 }
10645 default:
10646 return (1);
10647 break; /* NOTREACHED */
10648 }
10649
10650 return (0);
10651}
10652

--- 3467 unchanged lines hidden ---