@@ -4373,6 +4373,10 @@ void lustre_assert_wire_constants(void)
(long long)LAYOUT_INTENT_RELEASE);
LASSERTF(LAYOUT_INTENT_RESTORE == 6, "found %lld\n",
(long long)LAYOUT_INTENT_RESTORE);
+ LASSERTF(LAYOUT_INTENT_PCCRO_SET == 7, "found %lld\n",
+ (long long)LAYOUT_INTENT_PCCRO_SET);
+ LASSERTF(LAYOUT_INTENT_PCCRO_CLEAR == 8, "found %lld\n",
+ (long long)LAYOUT_INTENT_PCCRO_CLEAR);
/* Checks for struct hsm_action_item */
LASSERTF((int)sizeof(struct hsm_action_item) == 72, "found %lld\n",
@@ -2835,7 +2835,9 @@ enum layout_intent_opc {
LAYOUT_INTENT_GLIMPSE = 3, /** not used */
LAYOUT_INTENT_TRUNC = 4, /** truncate file, for comp layout */
LAYOUT_INTENT_RELEASE = 5, /** reserved for HSM release */
- LAYOUT_INTENT_RESTORE = 6 /** reserved for HSM restore */
+ LAYOUT_INTENT_RESTORE = 6, /** reserved for HSM restore */
+ LAYOUT_INTENT_PCCRO_SET = 7, /** set read-only layout for PCC */
+ LAYOUT_INTENT_PCCRO_CLEAR = 8, /** clear read-only layout */
};
/* enqueue layout lock with intent */
@@ -373,6 +373,7 @@ struct ll_ioc_lease_id {
#define LL_IOC_LADVISE _IOR('f', 250, struct llapi_lu_ladvise)
#define LL_IOC_HEAT_GET _IOWR('f', 251, struct lu_heat)
#define LL_IOC_HEAT_SET _IOW('f', 251, __u64)
+#define LL_IOC_PCC_ATTACH _IOW('f', 252, struct lu_pcc_attach)
#define LL_IOC_PCC_DETACH _IOW('f', 252, struct lu_pcc_detach)
#define LL_IOC_PCC_DETACH_BY_FID _IOW('f', 252, struct lu_pcc_detach_fid)
#define LL_IOC_PCC_STATE _IOR('f', 252, struct lu_pcc_state)
@@ -830,9 +831,18 @@ struct lustre_foreign_type {
**/
enum lustre_foreign_types {
LU_FOREIGN_TYPE_NONE = 0,
+ /* HSM copytool lhsm_posix */
+ LU_FOREIGN_TYPE_POSIX = 1,
+ /* Used for PCC-RW. PCCRW components are local to a single archive. */
+ LU_FOREIGN_TYPE_PCCRW = 2,
+ /* Used for PCC-RO. PCCRO components may be shared between archives. */
+ LU_FOREIGN_TYPE_PCCRO = 3,
+ /* Used for S3 */
+ LU_FOREIGN_TYPE_S3 = 4,
+ /* Used for DAOS */
LU_FOREIGN_TYPE_SYMLINK = 0xda05,
/* must be the max/last one */
- LU_FOREIGN_TYPE_UNKNOWN = 0xffffffff,
+ LU_FOREIGN_TYPE_UNKNOWN = 0xffffffff,
};
extern struct lustre_foreign_type lu_foreign_types[];
@@ -1928,6 +1938,8 @@ enum hsm_states {
HS_NORELEASE = 0x00000010,
HS_NOARCHIVE = 0x00000020,
HS_LOST = 0x00000040,
+ HS_PCCRW = 0x00000080,
+ HS_PCCRO = 0x00000100,
};
/* HSM user-setable flags. */
@@ -2356,6 +2368,7 @@ enum lu_pcc_type {
LU_PCC_READWRITE = 0x01,
LU_PCC_READONLY = 0x02,
LU_PCC_TYPE_MASK = LU_PCC_READWRITE | LU_PCC_READONLY,
+ LU_PCC_FL_ASYNC = 0x10,
LU_PCC_MAX
};
@@ -2399,6 +2412,8 @@ enum lu_pcc_state_flags {
PCC_STATE_FL_ATTR_VALID = 0x01,
/* The file is being attached into PCC */
PCC_STATE_FL_ATTACHING = 0x02,
+ /* The PCC copy is unlinked */
+ PCC_STATE_FL_UNLINKED = 0x04,
};
struct lu_pcc_state {