Linux Kernel
3.7.1
|
#include <scsi/osd_protocol.h>
#include <scsi/osd_types.h>
#include <linux/blkdev.h>
#include <scsi/scsi_device.h>
Go to the source code of this file.
Data Structures | |
struct | osd_dev |
struct | osd_dev_info |
struct | osd_request |
struct | osd_request::_osd_req_data_segment |
struct | osd_request::_osd_io_info |
struct | osd_sense_info |
Macros | |
#define | OSD_VER1_SUPPORT y |
Typedefs | |
typedef int( | do_test_fn )(struct osd_dev *od, unsigned cmd, unsigned long arg) |
typedef void( | osd_req_done_fn )(struct osd_request *or, void *private) |
Enumerations | |
enum | osd_std_version { OSD_VER_NONE = 0, OSD_VER1 = 1, OSD_VER2 = 2 } |
enum | osd_req_options { OSD_REQ_FUA = 0x08, OSD_REQ_DPO = 0x10, OSD_REQ_BYPASS_TIMESTAMPS = 0x80 } |
enum | osd_err_priority { OSD_ERR_PRI_NO_ERROR = 0, OSD_ERR_PRI_CLEAR_PAGES = 1, OSD_ERR_PRI_RESOURCE = 2, OSD_ERR_PRI_BAD_CRED = 3, OSD_ERR_PRI_NO_ACCESS = 4, OSD_ERR_PRI_UNREACHABLE = 5, OSD_ERR_PRI_NOT_FOUND = 6, OSD_ERR_PRI_NO_SPACE = 7, OSD_ERR_PRI_EIO = 8 } |
#define OSD_VER1_SUPPORT y |
Definition at line 34 of file osd_initiator.h.
Definition at line 77 of file osd_initiator.h.
typedef void( osd_req_done_fn)(struct osd_request *or, void *private) |
Definition at line 126 of file osd_initiator.h.
enum osd_err_priority |
osd_req_decode_sense_full - Decode sense information after execution.
: - osd_request to examine - Receives a more detailed error report information (optional). - Do not print to dmsg (Even if enabled) - Some commands act on multiple objects. Failed objects will be received here (optional) - Size of . - List of failing attributes (optional) - Size of .
After execution, osd_request results are analyzed using this function. The return code is the final disposition on the error. So it is possible that a CHECK_CONDITION was returned from target but this will return NO_ERROR, for example on recovered errors. All parameters are optional if caller does not need any returned information. Note: This function will also dump the error to dmsg according to settings of the SCSI_OSD_DPRINT_SENSE Kconfig value. Set if you know the command would routinely fail, to not spam the dmsg file. osd_err_priority - osd categorized return codes in ascending severity.
The categories are borrowed from the pnfs_osd_errno enum. See comments for translated Linux codes returned by osd_req_decode_sense.
OSD_ERR_PRI_NO_ERROR | |
OSD_ERR_PRI_CLEAR_PAGES | |
OSD_ERR_PRI_RESOURCE | |
OSD_ERR_PRI_BAD_CRED | |
OSD_ERR_PRI_NO_ACCESS | |
OSD_ERR_PRI_UNREACHABLE | |
OSD_ERR_PRI_NOT_FOUND | |
OSD_ERR_PRI_NO_SPACE | |
OSD_ERR_PRI_EIO |
Definition at line 289 of file osd_initiator.h.
enum osd_req_options |
Definition at line 214 of file osd_initiator.h.
enum osd_std_version |
Definition at line 36 of file osd_initiator.h.
osd_auto_detect_ver - Detect the OSD version, return Unique Identification
: OSD target lun handle : Capabilities authorizing OSD root read attributes access : Retrieved information uniquely identifying the osd target lun Note: odi->osdname must be kfreed by caller.
Auto detects the OSD version of the OSD target and sets the accordingly. Meanwhile also returns the "system id" and "osd name" root attributes which uniquely identify the OSD target. This member is usually called by the ULD. ULD users should call osduld_device_info(). This rutine allocates osd requests and memory at GFP_KERNEL level and might sleep.
Definition at line 197 of file osd_initiator.c.
Definition at line 388 of file osd_initiator.c.
void osd_dev_init | ( | struct osd_dev * | od, |
struct scsi_device * | scsi_device | ||
) |
Definition at line 376 of file osd_initiator.c.
void osd_end_request | ( | struct osd_request * | or | ) |
osd_end_request - return osd_request to free store
: osd_request to free
Deallocate all osd_request resources (struct req's, BIOs, buffers, etc.)
Definition at line 452 of file osd_initiator.c.
int osd_execute_request | ( | struct osd_request * | or | ) |
osd_execute_request - Execute the request synchronously through block-layer
: osd_request to Executed
Calls blk_execute_rq to q the command and waits for completion.
Definition at line 486 of file osd_initiator.c.
int osd_finalize_request | ( | struct osd_request * | or, |
u8 | options, | ||
const void * | cap, | ||
const u8 * | cap_key | ||
) |
osd_finalize_request - Sign request and prepare request for execution
: osd_request to prepare : combination of osd_req_options bit flags or 0. : A Pointer to an OSD_CAP_LEN bytes buffer that is received from The security manager as capabilities for this cdb. : The cryptographic key used to sign the cdb/data. Can be null if NOSEC is used.
The actual request and bios are only allocated here, so are the get_attr buffers that will receive the returned attributes. Copy's to cdb. Sign the cdb/data with .
Definition at line 1620 of file osd_initiator.c.
Definition at line 1225 of file osd_initiator.c.
int osd_req_add_get_attr_page | ( | struct osd_request * | or, |
u32 | page_id, | ||
void * | attr_page_data, | ||
unsigned | max_page_len, | ||
const struct osd_attr * | set_one | ||
) |
Definition at line 1419 of file osd_initiator.c.
Definition at line 1120 of file osd_initiator.c.
void osd_req_append | ( | struct osd_request * | or, |
const struct osd_obj_id * | , | ||
struct bio * | data_out | ||
) |
void osd_req_clear | ( | struct osd_request * | or, |
const struct osd_obj_id * | , | ||
u64 | offset, | ||
u64 | len | ||
) |
void osd_req_create_collection | ( | struct osd_request * | or, |
const struct osd_obj_id * | |||
) |
void osd_req_create_object | ( | struct osd_request * | or, |
struct osd_obj_id * | |||
) |
Definition at line 803 of file osd_initiator.c.
void osd_req_create_partition | ( | struct osd_request * | or, |
osd_id | partition | ||
) |
Definition at line 692 of file osd_initiator.c.
void osd_req_create_write | ( | struct osd_request * | or, |
const struct osd_obj_id * | , | ||
struct bio * | data_out, | ||
u64 | offset | ||
) |
int osd_req_decode_get_attr_list | ( | struct osd_request * | or, |
struct osd_attr * | , | ||
int * | nelem, | ||
void ** | iterator | ||
) |
Definition at line 1348 of file osd_initiator.c.
int osd_req_decode_sense_full | ( | struct osd_request * | or, |
struct osd_sense_info * | osi, | ||
bool | silent, | ||
struct osd_obj_id * | bad_obj_list, | ||
int | max_obj, | ||
struct osd_attr * | bad_attr_list, | ||
int | max_attr | ||
) |
void osd_req_flush_collection | ( | struct osd_request * | or, |
const struct osd_obj_id * | , | ||
enum | osd_options_flush_scope_values | ||
) |
Definition at line 789 of file osd_initiator.c.
void osd_req_flush_object | ( | struct osd_request * | or, |
const struct osd_obj_id * | , | ||
enum | osd_options_flush_scope_values, | ||
u64 | offset, | ||
u64 | len | ||
) |
Definition at line 856 of file osd_initiator.c.
void osd_req_flush_obsd | ( | struct osd_request * | or, |
enum | osd_options_flush_scope_values | ||
) |
Definition at line 666 of file osd_initiator.c.
void osd_req_flush_partition | ( | struct osd_request * | or, |
osd_id | partition, | ||
enum | osd_options_flush_scope_values | ||
) |
Definition at line 762 of file osd_initiator.c.
void osd_req_format | ( | struct osd_request * | or, |
u64 | tot_capacity | ||
) |
Definition at line 644 of file osd_initiator.c.
void osd_req_get_attributes | ( | struct osd_request * | or, |
const struct osd_obj_id * | |||
) |
Definition at line 1102 of file osd_initiator.c.
void osd_req_get_member_attrs | ( | struct osd_request * | or, |
... | |||
) |
int osd_req_list_collection_objects | ( | struct osd_request * | or, |
const struct osd_obj_id * | , | ||
osd_id | initial_id, | ||
struct osd_obj_id_list * | list, | ||
unsigned | nelem | ||
) |
Definition at line 778 of file osd_initiator.c.
int osd_req_list_dev_partitions | ( | struct osd_request * | or, |
osd_id | initial_id, | ||
struct osd_obj_id_list * | list, | ||
unsigned | nelem | ||
) |
Definition at line 651 of file osd_initiator.c.
int osd_req_list_partition_collections | ( | struct osd_request * | or, |
osd_id | partition, | ||
osd_id | initial_id, | ||
struct osd_obj_id_list * | list, | ||
unsigned | nelem | ||
) |
Definition at line 734 of file osd_initiator.c.
int osd_req_list_partition_objects | ( | struct osd_request * | or, |
osd_id | partition, | ||
osd_id | initial_id, | ||
struct osd_obj_id_list * | list, | ||
unsigned | nelem | ||
) |
Definition at line 748 of file osd_initiator.c.
void osd_req_perform_scsi_command | ( | struct osd_request * | or, |
const u8 * | cdb, | ||
... | |||
) |
void osd_req_punch | ( | struct osd_request * | or, |
const struct osd_obj_id * | , | ||
u64 | offset, | ||
u64 | len | ||
) |
void osd_req_query | ( | struct osd_request * | or, |
... | |||
) |
void osd_req_read | ( | struct osd_request * | or, |
const struct osd_obj_id * | obj, | ||
u64 | offset, | ||
struct bio * | bio, | ||
u64 | len | ||
) |
Definition at line 871 of file osd_initiator.c.
int osd_req_read_kern | ( | struct osd_request * | or, |
const struct osd_obj_id * | obj, | ||
u64 | offset, | ||
void * | buff, | ||
u64 | len | ||
) |
Definition at line 883 of file osd_initiator.c.
int osd_req_read_sg | ( | struct osd_request * | or, |
const struct osd_obj_id * | obj, | ||
struct bio * | bio, | ||
const struct osd_sg_entry * | sglist, | ||
unsigned | numentries | ||
) |
Definition at line 1004 of file osd_initiator.c.
int osd_req_read_sg_kern | ( | struct osd_request * | or, |
const struct osd_obj_id * | obj, | ||
void ** | buff, | ||
const struct osd_sg_entry * | sglist, | ||
unsigned | numentries | ||
) |
Definition at line 1086 of file osd_initiator.c.
void osd_req_remove_collection | ( | struct osd_request * | or, |
const struct osd_obj_id * | |||
) |
void osd_req_remove_object | ( | struct osd_request * | or, |
struct osd_obj_id * | |||
) |
Definition at line 809 of file osd_initiator.c.
void osd_req_remove_partition | ( | struct osd_request * | or, |
osd_id | partition | ||
) |
Definition at line 698 of file osd_initiator.c.
void osd_req_set_attributes | ( | struct osd_request * | or, |
const struct osd_obj_id * | |||
) |
Definition at line 1109 of file osd_initiator.c.
void osd_req_set_master_key | ( | struct osd_request * | or, |
... | |||
) |
void osd_req_set_master_seed_xchg | ( | struct osd_request * | or, |
... | |||
) |
void osd_req_set_member_attrs | ( | struct osd_request * | or, |
... | |||
) |
void osd_req_set_partition_key | ( | struct osd_request * | or, |
osd_id | partition, | ||
u8 | new_key_id[OSD_CRYPTO_KEYID_SIZE], | ||
u8 | seed[OSD_CRYPTO_SEED_SIZE] | ||
) |
void osd_req_task_management | ( | struct osd_request * | or, |
... | |||
) |
void osd_req_write | ( | struct osd_request * | or, |
const struct osd_obj_id * | obj, | ||
u64 | offset, | ||
struct bio * | bio, | ||
u64 | len | ||
) |
Definition at line 820 of file osd_initiator.c.
int osd_req_write_kern | ( | struct osd_request * | or, |
const struct osd_obj_id * | obj, | ||
u64 | offset, | ||
void * | buff, | ||
u64 | len | ||
) |
Definition at line 832 of file osd_initiator.c.
int osd_req_write_sg | ( | struct osd_request * | or, |
const struct osd_obj_id * | obj, | ||
struct bio * | bio, | ||
const struct osd_sg_entry * | sglist, | ||
unsigned | numentries | ||
) |
Definition at line 986 of file osd_initiator.c.
int osd_req_write_sg_kern | ( | struct osd_request * | or, |
const struct osd_obj_id * | obj, | ||
void ** | buff, | ||
const struct osd_sg_entry * | sglist, | ||
unsigned | numentries | ||
) |
Definition at line 1071 of file osd_initiator.c.
|
read |
osd_start_request - Allocate and initialize an osd_request
: OSD device that holds the scsi-device and default values that the request is associated with. : The allocation flags to use for request allocation, and all subsequent allocations. This will be stored at osd_request->alloc_flags, can be changed by user later
Allocate osd_request and initialize all members to the default/initial state.
Definition at line 410 of file osd_initiator.c.
|
read |
|
read |
int osduld_register_test | ( | unsigned | ioctl, |
do_test_fn * | do_test | ||
) |