persist.c (302408) | persist.c (314220) |
---|---|
1/*- 2 * Copyright (c) 2013 Spectra Logic Corporation 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 20 unchanged lines hidden (view full) --- 29 * 30 * Authors: Ken Merry (Spectra Logic Corporation) 31 */ 32/* 33 * SCSI Persistent Reservation support for camcontrol(8). 34 */ 35 36#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2013 Spectra Logic Corporation 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 20 unchanged lines hidden (view full) --- 29 * 30 * Authors: Ken Merry (Spectra Logic Corporation) 31 */ 32/* 33 * SCSI Persistent Reservation support for camcontrol(8). 34 */ 35 36#include <sys/cdefs.h> |
37__FBSDID("$FreeBSD: stable/11/sbin/camcontrol/persist.c 300547 2016-05-24 00:57:11Z truckman $"); | 37__FBSDID("$FreeBSD: stable/11/sbin/camcontrol/persist.c 314220 2017-02-24 20:47:56Z ken $"); |
38 39#include <sys/ioctl.h> 40#include <sys/stdint.h> 41#include <sys/types.h> 42#include <sys/endian.h> 43#include <sys/sbuf.h> 44#include <sys/queue.h> 45 --- 372 unchanged lines hidden (view full) --- 418 cur_length = sizeof(*desc) + additional_length; 419 len_to_go -= cur_length; 420 cur_pos += cur_length; 421 } 422} 423 424int 425scsipersist(struct cam_device *device, int argc, char **argv, char *combinedopt, | 38 39#include <sys/ioctl.h> 40#include <sys/stdint.h> 41#include <sys/types.h> 42#include <sys/endian.h> 43#include <sys/sbuf.h> 44#include <sys/queue.h> 45 --- 372 unchanged lines hidden (view full) --- 418 cur_length = sizeof(*desc) + additional_length; 419 len_to_go -= cur_length; 420 cur_pos += cur_length; 421 } 422} 423 424int 425scsipersist(struct cam_device *device, int argc, char **argv, char *combinedopt, |
426 int retry_count, int timeout, int verbosemode, int err_recover) | 426 int task_attr, int retry_count, int timeout, int verbosemode, 427 int err_recover) |
427{ 428 union ccb *ccb = NULL; 429 int c, in = 0, out = 0; 430 int action = -1, num_ids = 0; 431 int error = 0; 432 uint32_t res_len = 0; 433 unsigned long rel_tgt_port = 0; 434 uint8_t *res_buf = NULL; --- 314 unchanged lines hidden (view full) --- 749 goto bailout; 750 } 751 bzero(res_buf, res_len); 752 753 if (in != 0) { 754 scsi_persistent_reserve_in(&ccb->csio, 755 /*retries*/ retry_count, 756 /*cbfcnp*/ NULL, | 428{ 429 union ccb *ccb = NULL; 430 int c, in = 0, out = 0; 431 int action = -1, num_ids = 0; 432 int error = 0; 433 uint32_t res_len = 0; 434 unsigned long rel_tgt_port = 0; 435 uint8_t *res_buf = NULL; --- 314 unchanged lines hidden (view full) --- 750 goto bailout; 751 } 752 bzero(res_buf, res_len); 753 754 if (in != 0) { 755 scsi_persistent_reserve_in(&ccb->csio, 756 /*retries*/ retry_count, 757 /*cbfcnp*/ NULL, |
757 /*tag_action*/ MSG_SIMPLE_Q_TAG, | 758 /*tag_action*/ task_attr, |
758 /*service_action*/ action, 759 /*data_ptr*/ res_buf, 760 /*dxfer_len*/ res_len, 761 /*sense_len*/ SSD_FULL_SIZE, 762 /*timeout*/ timeout ? timeout :5000); 763 764 } else { 765 switch (action) { --- 65 unchanged lines hidden (view full) --- 831 break; 832 } 833 default: 834 break; 835 } 836 scsi_persistent_reserve_out(&ccb->csio, 837 /*retries*/ retry_count, 838 /*cbfcnp*/ NULL, | 759 /*service_action*/ action, 760 /*data_ptr*/ res_buf, 761 /*dxfer_len*/ res_len, 762 /*sense_len*/ SSD_FULL_SIZE, 763 /*timeout*/ timeout ? timeout :5000); 764 765 } else { 766 switch (action) { --- 65 unchanged lines hidden (view full) --- 832 break; 833 } 834 default: 835 break; 836 } 837 scsi_persistent_reserve_out(&ccb->csio, 838 /*retries*/ retry_count, 839 /*cbfcnp*/ NULL, |
839 /*tag_action*/ MSG_SIMPLE_Q_TAG, | 840 /*tag_action*/ task_attr, |
840 /*service_action*/ action, 841 /*scope*/ scope, 842 /*res_type*/ res_type, 843 /*data_ptr*/ res_buf, 844 /*dxfer_len*/ res_len, 845 /*sense_len*/ SSD_FULL_SIZE, 846 /*timeout*/ timeout ?timeout :5000); 847 } --- 116 unchanged lines hidden --- | 841 /*service_action*/ action, 842 /*scope*/ scope, 843 /*res_type*/ res_type, 844 /*data_ptr*/ res_buf, 845 /*dxfer_len*/ res_len, 846 /*sense_len*/ SSD_FULL_SIZE, 847 /*timeout*/ timeout ?timeout :5000); 848 } --- 116 unchanged lines hidden --- |