History

block: sed-opal: add ioctl for done-mark of shadow mbr

Enable users to mark the shadow mbr as done without completely deactivating the shadow mbr feature. This may be useful on reboots, when the power to the disk is not disconnected in between and the shadow mbr stores the required boot files. Of course, this saves also the (few) commands required to enable the feature if it is already enabled and one only wants to mark the shadow mbr as done.

Jonas Rabenstein committed 7 years ago

Commit c9888441 parent b6207433 files · +40 −0Browse files

Showing the changes to include/uapi/linux (1 of 3 files). Show all

Unified · Split

include/uapi/linux/sed-opal.h+12−0
@@ -20,6 +20,11 @@ enum opal_mbr { · 19 unmodified lines
2020 OPAL_MBR_DISABLE = 0x01,
2121 };
2222
23+enum opal_mbr_done_flag {
24+ OPAL_MBR_NOT_DONE = 0x0,
25+ OPAL_MBR_DONE = 0x01
26+};
27+
2328 enum opal_user {
2429 OPAL_ADMIN1 = 0x0,
2530 OPAL_USER1 = 0x01,
@@ -95,6 +100,12 @@ struct opal_mbr_data { · 69 unmodified lines
95100 __u8 __align[7];
96101 };
97102
103+struct opal_mbr_done {
104+ struct opal_key key;
105+ __u8 done_flag;
106+ __u8 __align[7];
107+};
108+
98109 #define IOC_OPAL_SAVE _IOW('p', 220, struct opal_lock_unlock)
99110 #define IOC_OPAL_LOCK_UNLOCK _IOW('p', 221, struct opal_lock_unlock)
100111 #define IOC_OPAL_TAKE_OWNERSHIP _IOW('p', 222, struct opal_key)
@@ -108,5 +119,6 @@ struct opal_mbr_data { · 7 unmodified lines
108119 #define IOC_OPAL_ERASE_LR _IOW('p', 230, struct opal_session_info)
109120 #define IOC_OPAL_SECURE_ERASE_LR _IOW('p', 231, struct opal_session_info)
110121 #define IOC_OPAL_PSID_REVERT_TPR _IOW('p', 232, struct opal_key)
122+#define IOC_OPAL_MBR_DONE _IOW('p', 233, struct opal_mbr_done)
111123
112124 #endif /* _UAPI_SED_OPAL_H */