LKML Archive on
help / color / mirror / Atom feed
From: Kari Argillander <>
To: Konstantin Komarov <>,
Cc: Kari Argillander <>,
Subject: [PATCH 2/7] fs/ntfs3: Add missing headers and forward declarations to ntfs_fs.h
Date: Tue, 31 Aug 2021 17:14:29 +0300	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

We do not have headers at all in this file. We should have them so that
not every .c file needs to include all of the stuff which this file need
for building. This way we can remove some headers from other files and
get better picture what is needed. This can save some compilation time.
And this can help if we sometimes want to separate this one big header.

Also use forward declarations for structs and enums when it not included
straight with include and it is used in function declarations input.
This will prevent possible compiler warning:
  xxx declared inside parameter list will not be visible
  outside of this definition or declaration

Here is list which I made when parsing this. There is not necessarily
all example from this header file, but this just proofs we need it.

<linux/blkdev.h> SECTOR_SHIFT
<linux/buffer_head.h> sb_bread(), put_bh
<linux/cleancache.h> put_page()
<linux/fs.h> struct inode (Just struct ntfs_inode need it)
<linux/highmem.h> kunmap(), kmap()
<linux/kernel.h> cpu_to_leXX() ALIGN
<linux/mm.h> kvfree()
<linux/mutex.h> struct mutex, mutex_(un/try)lock()
<linux/page-flags.h> PageError()
<linux/pagemap.h> read_mapping_page()
<linux/rbtree.h> struct rb_root
<linux/rwsem.h> struct rw_semaphore
<linux/slab.h> krfree(), kzalloc()
<linux/string.h> memset()
<linux/time64.h> struct timespec64
<linux/types.h> uXX, __leXX
<linux/uidgid.h> kuid_t, kgid_t
<asm/div64.h> do_div()
<asm/page.h> PAGE_SIZE

"debug.h" ntfs_err() (Just one entry. Maybe we can drop this)
"ntfs.h" Do you even ask?

Signed-off-by: Kari Argillander <>
 fs/ntfs3/ntfs_fs.h | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/fs/ntfs3/ntfs_fs.h b/fs/ntfs3/ntfs_fs.h
index 64ef92e16363..a39055cf9822 100644
--- a/fs/ntfs3/ntfs_fs.h
+++ b/fs/ntfs3/ntfs_fs.h
@@ -9,6 +9,37 @@
+#include <linux/blkdev.h>
+#include <linux/buffer_head.h>
+#include <linux/cleancache.h>
+#include <linux/fs.h>
+#include <linux/highmem.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/mutex.h>
+#include <linux/page-flags.h>
+#include <linux/pagemap.h>
+#include <linux/rbtree.h>
+#include <linux/rwsem.h>
+#include <linux/slab.h>
+#include <linux/string.h>
+#include <linux/time64.h>
+#include <linux/types.h>
+#include <linux/uidgid.h>
+#include <asm/div64.h>
+#include <asm/page.h>
+#include "debug.h"
+#include "ntfs.h"
+struct dentry;
+struct fiemap_extent_info;
+struct user_namespace;
+struct page;
+struct writeback_control;
+enum utf16_endian;
 #define MINUS_ONE_T			((size_t)(-1))
 /* Biggest MFT / smallest cluster */
 #define MAXIMUM_BYTES_PER_MFT		4096

  parent reply	other threads:[~2021-08-31 14:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31 14:14 [PATCH 0/7] fs/ntfs3: Refactor header includes Kari Argillander
2021-08-31 14:14 ` [PATCH 1/7] fs/ntfs3: Add missing header files to ntfs.h Kari Argillander
2021-08-31 14:14 ` Kari Argillander [this message]
2021-08-31 14:14 ` [PATCH 3/7] fs/ntfs3: Add missing header and guards to lib/ headers Kari Argillander
2021-08-31 14:14 ` [PATCH 4/7] fs/ntfs3: Change right headers to bitfunc.c Kari Argillander
2021-08-31 14:14 ` [PATCH 5/7] fs/ntfs3: Change right headers to upcase.c Kari Argillander
2021-08-31 14:14 ` [PATCH 6/7] fs/ntfs3: Change right headers to lznt.c Kari Argillander
2021-08-31 17:54   ` kernel test robot
2021-08-31 18:43     ` Kari Argillander
2021-09-01  0:45   ` kernel test robot
2021-08-31 14:14 ` [PATCH 7/7] fs/ntfs3: Remove unneeded header files from c files Kari Argillander

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \
    --subject='Re: [PATCH 2/7] fs/ntfs3: Add missing headers and forward declarations to ntfs_fs.h' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).