Blame SOURCES/0046-fs-ntfs3-Add-missing-headers-and-forward-declaration.patch

Kmods SIG 8b815c
From f239b3a95dd4f7daba26ea17f339a5b19a7d40a1 Mon Sep 17 00:00:00 2001
Kmods SIG 8b815c
From: Kari Argillander <kari.argillander@gmail.com>
Kmods SIG 8b815c
Date: Thu, 2 Sep 2021 19:15:23 +0300
Kmods SIG 8b815c
Subject: [Backport f239b3a95dd4] src: Add missing headers and forward
Kmods SIG 8b815c
 declarations to ntfs_fs.h
Kmods SIG 8b815c
Kmods SIG 8b815c
We do not have headers at all in this file. We should have them so that
Kmods SIG 8b815c
not every .c file needs to include all of the stuff which this file need
Kmods SIG 8b815c
for building. This way we can remove some headers from other files and
Kmods SIG 8b815c
get better picture what is needed. This can save some compilation time.
Kmods SIG 8b815c
And this can help if we sometimes want to separate this one big header.
Kmods SIG 8b815c
Kmods SIG 8b815c
Also use forward declarations for structs and enums when it not included
Kmods SIG 8b815c
straight with include and it is used in function declarations input.
Kmods SIG 8b815c
This will prevent possible compiler warning:
Kmods SIG 8b815c
  xxx declared inside parameter list will not be visible
Kmods SIG 8b815c
  outside of this definition or declaration
Kmods SIG 8b815c
Kmods SIG 8b815c
Here is list which I made when parsing this. There is not necessarily
Kmods SIG 8b815c
all example from this header file, but this just proofs we need it.
Kmods SIG 8b815c
Kmods SIG 8b815c
<linux/blkdev.h> SECTOR_SHIFT
Kmods SIG 8b815c
<linux/buffer_head.h> sb_bread(), put_bh
Kmods SIG 8b815c
<linux/cleancache.h> put_page()
Kmods SIG 8b815c
<linux/fs.h> struct inode (Just struct ntfs_inode need it)
Kmods SIG 8b815c
<linux/highmem.h> kunmap(), kmap()
Kmods SIG 8b815c
<linux/kernel.h> cpu_to_leXX() ALIGN
Kmods SIG 8b815c
<linux/mm.h> kvfree()
Kmods SIG 8b815c
<linux/mutex.h> struct mutex, mutex_(un/try)lock()
Kmods SIG 8b815c
<linux/page-flags.h> PageError()
Kmods SIG 8b815c
<linux/pagemap.h> read_mapping_page()
Kmods SIG 8b815c
<linux/rbtree.h> struct rb_root
Kmods SIG 8b815c
<linux/rwsem.h> struct rw_semaphore
Kmods SIG 8b815c
<linux/slab.h> krfree(), kzalloc()
Kmods SIG 8b815c
<linux/string.h> memset()
Kmods SIG 8b815c
<linux/time64.h> struct timespec64
Kmods SIG 8b815c
<linux/types.h> uXX, __leXX
Kmods SIG 8b815c
<linux/uidgid.h> kuid_t, kgid_t
Kmods SIG 8b815c
<asm/div64.h> do_div()
Kmods SIG 8b815c
<asm/page.h> PAGE_SIZE
Kmods SIG 8b815c
Kmods SIG 8b815c
"debug.h" ntfs_err() (Just one entry. Maybe we can drop this)
Kmods SIG 8b815c
"ntfs.h" Do you even ask?
Kmods SIG 8b815c
Kmods SIG 8b815c
Signed-off-by: Kari Argillander <kari.argillander@gmail.com>
Kmods SIG 8b815c
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Kmods SIG 8b815c
---
Kmods SIG 8b815c
 src/ntfs_fs.h | 31 +++++++++++++++++++++++++++++++
Kmods SIG 8b815c
 1 file changed, 31 insertions(+)
Kmods SIG 8b815c
Kmods SIG 8b815c
diff --git a/src/ntfs_fs.h b/src/ntfs_fs.h
Kmods SIG 8b815c
index 372cda697dd4c587a82ed6381a1dd512b700d5c1..dae6dd4ac6198fe735749b8e1405e110da4ddd62 100644
Kmods SIG 8b815c
--- a/src/ntfs_fs.h
Kmods SIG 8b815c
+++ b/src/ntfs_fs.h
Kmods SIG 8b815c
@@ -9,6 +9,37 @@
Kmods SIG 8b815c
 #ifndef _LINUX_NTFS3_NTFS_FS_H
Kmods SIG 8b815c
 #define _LINUX_NTFS3_NTFS_FS_H
Kmods SIG 8b815c
 
Kmods SIG 8b815c
+#include <linux/blkdev.h>
Kmods SIG 8b815c
+#include <linux/buffer_head.h>
Kmods SIG 8b815c
+#include <linux/cleancache.h>
Kmods SIG 8b815c
+#include <linux/fs.h>
Kmods SIG 8b815c
+#include <linux/highmem.h>
Kmods SIG 8b815c
+#include <linux/kernel.h>
Kmods SIG 8b815c
+#include <linux/mm.h>
Kmods SIG 8b815c
+#include <linux/mutex.h>
Kmods SIG 8b815c
+#include <linux/page-flags.h>
Kmods SIG 8b815c
+#include <linux/pagemap.h>
Kmods SIG 8b815c
+#include <linux/rbtree.h>
Kmods SIG 8b815c
+#include <linux/rwsem.h>
Kmods SIG 8b815c
+#include <linux/slab.h>
Kmods SIG 8b815c
+#include <linux/string.h>
Kmods SIG 8b815c
+#include <linux/time64.h>
Kmods SIG 8b815c
+#include <linux/types.h>
Kmods SIG 8b815c
+#include <linux/uidgid.h>
Kmods SIG 8b815c
+#include <asm/div64.h>
Kmods SIG 8b815c
+#include <asm/page.h>
Kmods SIG 8b815c
+
Kmods SIG 8b815c
+#include "debug.h"
Kmods SIG 8b815c
+#include "ntfs.h"
Kmods SIG 8b815c
+
Kmods SIG 8b815c
+struct dentry;
Kmods SIG 8b815c
+struct fiemap_extent_info;
Kmods SIG 8b815c
+struct user_namespace;
Kmods SIG 8b815c
+struct page;
Kmods SIG 8b815c
+struct writeback_control;
Kmods SIG 8b815c
+enum utf16_endian;
Kmods SIG 8b815c
+
Kmods SIG 8b815c
+
Kmods SIG 8b815c
 #define MINUS_ONE_T			((size_t)(-1))
Kmods SIG 8b815c
 /* Biggest MFT / smallest cluster */
Kmods SIG 8b815c
 #define MAXIMUM_BYTES_PER_MFT		4096
Kmods SIG 8b815c
-- 
Kmods SIG 8b815c
2.31.1
Kmods SIG 8b815c