[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/9] scsi/constant: add persistent reservation in/out protocol co
From: |
Changqi Lu |
Subject: |
[PATCH 3/9] scsi/constant: add persistent reservation in/out protocol constants |
Date: |
Wed, 8 May 2024 17:36:23 +0800 |
Add constants for the persistent reservation in/out protocol
in the scsi/constant module. The constants include the persistent
reservation command, type, and scope values defined in sections
6.13 and 6.14 of the SCSI Primary Commands-4 (SPC-4) specification.
Signed-off-by: Changqi Lu <luchangqi.123@bytedance.com>
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
---
include/scsi/constants.h | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/include/scsi/constants.h b/include/scsi/constants.h
index 9b98451912..511cb3d03e 100644
--- a/include/scsi/constants.h
+++ b/include/scsi/constants.h
@@ -319,4 +319,33 @@
#define IDENT_DESCR_TGT_DESCR_SIZE 32
#define XCOPY_BLK2BLK_SEG_DESC_SIZE 28
+typedef enum {
+ SCSI_PR_WRITE_EXCLUSIVE = 0x01,
+ SCSI_PR_EXCLUSIVE_ACCESS = 0x03,
+ SCSI_PR_WRITE_EXCLUSIVE_REGS_ONLY = 0x05,
+ SCSI_PR_EXCLUSIVE_ACCESS_REGS_ONLY = 0x06,
+ SCSI_PR_WRITE_EXCLUSIVE_ALL_REGS = 0x07,
+ SCSI_PR_EXCLUSIVE_ACCESS_ALL_REGS = 0x08,
+} SCSIPrType;
+
+typedef enum {
+ SCSI_PR_LU_SCOPE = 0x00,
+} SCSIPrScope;
+
+typedef enum {
+ SCSI_PR_OUT_REGISTER = 0x0,
+ SCSI_PR_OUT_RESERVE = 0x1,
+ SCSI_PR_OUT_RELEASE = 0x2,
+ SCSI_PR_OUT_CLEAR = 0x3,
+ SCSI_PR_OUT_PREEMPT = 0x4,
+ SCSI_PR_OUT_PREEMPT_AND_ABORT = 0x5,
+ SCSI_PR_OUT_REG_AND_IGNORE_KEY = 0x6,
+ SCSI_PR_OUT_REG_AND_MOVE = 0x7,
+} SCSIPrOutAction;
+
+typedef enum {
+ SCSI_PR_IN_READ_KEYS = 0x0,
+ SCSI_PR_IN_READ_RESERVATION = 0x1,
+} SCSIPrInAction;
+
#endif
--
2.20.1
- Re: [PATCH 4/9] scsi/util: add helper functions for persistent reservation types conversion, (continued)
- [PATCH 7/9] hw/nvme: add helper functions for converting reservation types, Changqi Lu, 2024/05/08
- [PATCH 9/9] block/iscsi: add persistent reservation in/out driver, Changqi Lu, 2024/05/08
- [PATCH 1/9] block: add persistent reservation in/out api, Changqi Lu, 2024/05/08
- [PATCH 5/9] hw/scsi: add persistent reservation in/out api for scsi device, Changqi Lu, 2024/05/08
- [PATCH 3/9] scsi/constant: add persistent reservation in/out protocol constants,
Changqi Lu <=
- [PATCH 6/9] block/nvme: add reservation command protocol constants, Changqi Lu, 2024/05/08
- [PATCH 8/9] hw/nvme: add reservation protocal command, Changqi Lu, 2024/05/08
- Re: [PATCH 0/9] Support persistent reservation operations, Stefan Hajnoczi, 2024/05/09