Blame SOURCES/cryptsetup-2.3.7-Move-requirement-helpers-for-later-changes.patch

33f49e
From 4e98b65c04b624888b39216c81da17b2d0aedfb8 Mon Sep 17 00:00:00 2001
33f49e
From: Ondrej Kozina <okozina@redhat.com>
33f49e
Date: Thu, 6 Jan 2022 14:28:36 +0100
33f49e
Subject: [PATCH 15/28] Move requirement helpers for later changes.
33f49e
33f49e
---
33f49e
 lib/luks2/luks2_json_metadata.c | 30 +++++++++++++++---------------
33f49e
 1 file changed, 15 insertions(+), 15 deletions(-)
33f49e
33f49e
diff --git a/lib/luks2/luks2_json_metadata.c b/lib/luks2/luks2_json_metadata.c
33f49e
index 6071b077..e45a9739 100644
33f49e
--- a/lib/luks2/luks2_json_metadata.c
33f49e
+++ b/lib/luks2/luks2_json_metadata.c
33f49e
@@ -591,6 +591,21 @@ static bool validate_segment_intervals(struct crypt_device *cd,
33f49e
 	return true;
33f49e
 }
33f49e
 
33f49e
+static int reqs_unknown(uint32_t reqs)
33f49e
+{
33f49e
+	return reqs & CRYPT_REQUIREMENT_UNKNOWN;
33f49e
+}
33f49e
+
33f49e
+static int reqs_reencrypt(uint32_t reqs)
33f49e
+{
33f49e
+	return reqs & CRYPT_REQUIREMENT_OFFLINE_REENCRYPT;
33f49e
+}
33f49e
+
33f49e
+static int reqs_reencrypt_online(uint32_t reqs)
33f49e
+{
33f49e
+	return reqs & CRYPT_REQUIREMENT_ONLINE_REENCRYPT;
33f49e
+}
33f49e
+
33f49e
 static int hdr_validate_segments(struct crypt_device *cd, json_object *hdr_jobj)
33f49e
 {
33f49e
 	json_object *jobj_segments, *jobj_digests, *jobj_offset, *jobj_size, *jobj_type, *jobj_flags, *jobj;
33f49e
@@ -1138,21 +1153,6 @@ int LUKS2_hdr_backup(struct crypt_device *cd, struct luks2_hdr *hdr,
33f49e
 	return r;
33f49e
 }
33f49e
 
33f49e
-static int reqs_unknown(uint32_t reqs)
33f49e
-{
33f49e
-	return reqs & CRYPT_REQUIREMENT_UNKNOWN;
33f49e
-}
33f49e
-
33f49e
-static int reqs_reencrypt(uint32_t reqs)
33f49e
-{
33f49e
-	return reqs & CRYPT_REQUIREMENT_OFFLINE_REENCRYPT;
33f49e
-}
33f49e
-
33f49e
-static int reqs_reencrypt_online(uint32_t reqs)
33f49e
-{
33f49e
-	return reqs & CRYPT_REQUIREMENT_ONLINE_REENCRYPT;
33f49e
-}
33f49e
-
33f49e
 int LUKS2_hdr_restore(struct crypt_device *cd, struct luks2_hdr *hdr,
33f49e
 		     const char *backup_file)
33f49e
 {
33f49e
-- 
33f49e
2.27.0
33f49e