Removed custom struct for tracking Persistent Resvn type.

This commit is contained in:
Lee Duncan
2012-12-23 21:36:46 -08:00
parent 9ea26fbca5
commit d72e6b3717
6 changed files with 59 additions and 53 deletions

View File

@@ -181,6 +181,7 @@ scsi_inquiry_pagecode_to_str
scsi_protocol_identifier_to_str
scsi_reportluns_cdb
scsi_sense_ascq_str
scsi_pr_type_str
scsi_sense_key_str
scsi_set_task_private_ptr
scsi_task_add_data_in_buffer

View File

@@ -163,6 +163,28 @@ scsi_sense_ascq_str(int ascq)
return value_string_find(ascqs, ascq);
}
const char *
scsi_pr_type_str(enum scsi_persistent_out_type pr_type)
{
struct value_string pr_type_strings[] = {
{SCSI_PERSISTENT_RESERVE_TYPE_WRITE_EXCLUSIVE,
"Write Exclusive"},
{SCSI_PERSISTENT_RESERVE_TYPE_EXCLUSIVE_ACCESS,
"Exclusive Access"},
{SCSI_PERSISTENT_RESERVE_TYPE_WRITE_EXCLUSIVE_REGISTRANTS_ONLY,
"Write Exclusive, Registrants Only"},
{SCSI_PERSISTENT_RESERVE_TYPE_EXCLUSIVE_ACCESS_REGISTRANTS_ONLY,
"Exclusive Access Registrants Only"},
{SCSI_PERSISTENT_RESERVE_TYPE_WRITE_EXCLUSIVE_ALL_REGISTRANTS,
"Write Exclusive, All Registrants"},
{SCSI_PERSISTENT_RESERVE_TYPE_EXCLUSIVE_ACCESS_ALL_REGISTRANTS,
"Exclusive Access, All Registrants"},
{0, NULL}
};
return value_string_find(pr_type_strings, pr_type);
}
inline uint64_t
scsi_get_uint64(const unsigned char *c)
{