netfilter: nf_conntrack: show helper and class in /proc/net/nf_conntrack_expect
[safe/jmp/linux-2.6] / include / scsi / osd_initiator.h
index 3ec346e..a8f3701 100644 (file)
@@ -142,6 +142,7 @@ struct osd_request {
        struct _osd_io_info {
                struct bio *bio;
                u64 total_bytes;
+               u64 residual;
                struct request *req;
                struct _osd_req_data_segment *last_seg;
                u8 *pad_buff;
@@ -150,12 +151,14 @@ struct osd_request {
        gfp_t alloc_flags;
        unsigned timeout;
        unsigned retries;
+       unsigned sense_len;
        u8 sense[OSD_MAX_SENSE_LEN];
        enum osd_attributes_mode attributes_mode;
 
        osd_req_done_fn *async_done;
        void *async_private;
        int async_error;
+       int req_errors;
 };
 
 static inline bool osd_req_is_ver1(struct osd_request *or)
@@ -267,7 +270,7 @@ int osd_execute_request_async(struct osd_request *or,
  * @bad_attr_list - List of failing attributes (optional)
  * @max_attr      - Size of @bad_attr_list.
  *
- * After execution, sense + return code can be analyzed using this function. The
+ * 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
@@ -276,7 +279,29 @@ int osd_execute_request_async(struct osd_request *or,
  * of the SCSI_OSD_DPRINT_SENSE Kconfig value. Set @silent 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.
+ */
+enum osd_err_priority {
+       OSD_ERR_PRI_NO_ERROR    = 0,
+       /* Recoverable, caller should clear_highpage() all pages */
+       OSD_ERR_PRI_CLEAR_PAGES = 1, /* -EFAULT */
+       OSD_ERR_PRI_RESOURCE    = 2, /* -ENOMEM */
+       OSD_ERR_PRI_BAD_CRED    = 3, /* -EINVAL */
+       OSD_ERR_PRI_NO_ACCESS   = 4, /* -EACCES */
+       OSD_ERR_PRI_UNREACHABLE = 5, /* any other */
+       OSD_ERR_PRI_NOT_FOUND   = 6, /* -ENOENT */
+       OSD_ERR_PRI_NO_SPACE    = 7, /* -ENOSPC */
+       OSD_ERR_PRI_EIO         = 8, /* -EIO    */
+};
+
 struct osd_sense_info {
+       enum osd_err_priority osd_err_pri;
+
        int key;                /* one of enum scsi_sense_keys */
        int additional_code ;   /* enum osd_additional_sense_codes */
        union { /* Sense specific information */