Blob Blame History Raw
From 87790b65343932411af43bc9b218f086ecebd6a5 Mon Sep 17 00:00:00 2001
From: Kari Argillander <kari.argillander@gmail.com>
Date: Mon, 16 Aug 2021 15:01:56 +0300
Subject: [Backport 87790b653439] src: Add ifndef + define to all header
 files

Add guards so that compiler will only include header files once.

Signed-off-by: Kari Argillander <kari.argillander@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
---
 src/debug.h   | 5 +++++
 src/ntfs.h    | 3 +++
 src/ntfs_fs.h | 5 +++++
 3 files changed, 13 insertions(+)

diff --git a/src/debug.h b/src/debug.h
index 15ac42185e5b39525ec7ead599975946d9d0b679..357d9f4dfba78792b443e05318d189c9167db1f8 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -7,6 +7,9 @@
  */
 
 // clang-format off
+#ifndef _LINUX_NTFS3_DEBUG_H
+#define _LINUX_NTFS3_DEBUG_H
+
 #ifndef Add2Ptr
 #define Add2Ptr(P, I)		((void *)((u8 *)(P) + (I)))
 #define PtrOffset(B, O)		((size_t)((size_t)(O) - (size_t)(B)))
@@ -61,4 +64,6 @@ void ntfs_inode_printk(struct inode *inode, const char *fmt, ...)
 #define ntfs_free(p)		kfree(p)
 #define ntfs_vfree(p)		kvfree(p)
 #define ntfs_memdup(src, len)	kmemdup(src, len, GFP_NOFS)
+
+#endif /* _LINUX_NTFS3_DEBUG_H */
 // clang-format on
diff --git a/src/ntfs.h b/src/ntfs.h
index 40398e6c39c9383de1f917f6ef29d4d0238df7d7..16da514af124695bf751459672adb009301a9cdc 100644
--- a/src/ntfs.h
+++ b/src/ntfs.h
@@ -7,6 +7,8 @@
  */
 
 // clang-format off
+#ifndef _LINUX_NTFS3_NTFS_H
+#define _LINUX_NTFS3_NTFS_H
 
 /* TODO:
  * - Check 4K mft record and 512 bytes cluster
@@ -1235,4 +1237,5 @@ struct SID {
 };
 static_assert(offsetof(struct SID, SubAuthority) == 8);
 
+#endif /* _LINUX_NTFS3_NTFS_H */
 // clang-format on
diff --git a/src/ntfs_fs.h b/src/ntfs_fs.h
index c8ea6dd38c213bf9ef5dd52aa46ae3cb3e8cd43b..b5da2f06f7cbd087a3de12e0767fa2e5755033f9 100644
--- a/src/ntfs_fs.h
+++ b/src/ntfs_fs.h
@@ -6,6 +6,9 @@
  */
 
 // clang-format off
+#ifndef _LINUX_NTFS3_NTFS_FS_H
+#define _LINUX_NTFS3_NTFS_FS_H
+
 #define MINUS_ONE_T			((size_t)(-1))
 /* Biggest MFT / smallest cluster */
 #define MAXIMUM_BYTES_PER_MFT		4096
@@ -1085,3 +1088,5 @@ static inline void le64_sub_cpu(__le64 *var, u64 val)
 {
 	*var = cpu_to_le64(le64_to_cpu(*var) - val);
 }
+
+#endif /* _LINUX_NTFS3_NTFS_FS_H */
-- 
2.31.1