Skip to contentSkip to conversation

fscrypt: explicitly include <linux/export.h>

PATCH Applied Eric Biggers 1 participant 2 messages Jun 14, 2025 – Jun 17, 2025 fscrypt: file system level encryption support

lore
Share & tools
lore

Eric Biggers

author maintainer
#0 lore raw

PATCH 1/1 fscrypt: explicitly include <linux/export.h>

From: Eric Biggers <[email protected]>

Fix build warnings with W=1 that started appearing after commit a934a57a42f6 ("scripts/misc-check: check missing #include <linux/export.h> when W=1").

While at it, also sort the include lists alphabetically.

---

This patch applies to v6.16-rc1 and is targeting fscrypt/for-next.

 fs/crypto/bio.c          | 6 ++++--
 fs/crypto/crypto.c       | 8 +++++---
 fs/crypto/fname.c        | 6 ++++--
 fs/crypto/hkdf.c         | 2 +-
 fs/crypto/hooks.c        | 2 ++
 fs/crypto/inline_crypt.c | 1 +
 fs/crypto/keyring.c      | 5 +++--
 fs/crypto/keysetup.c     | 1 +
 fs/crypto/policy.c       | 4 +++-
 9 files changed, 24 insertions(+), 11 deletions(-)
fs/crypto/bio.c +4 -2
index 0ad8c30b8fa50..13ad2dd771b64 100644
@@ -5,14 +5,16 @@
  *
  * Copyright (C) 2015, Google, Inc.
  * Copyright (C) 2015, Motorola Mobility
  */
 
-#include <linux/pagemap.h>
-#include <linux/module.h>
 #include <linux/bio.h>
+#include <linux/export.h>
+#include <linux/module.h>
 #include <linux/namei.h>
+#include <linux/pagemap.h>
+
 #include "fscrypt_private.h"
 
 /**
  * fscrypt_decrypt_bio() - decrypt the contents of a bio
  * @bio: the bio to decrypt
fs/crypto/crypto.c +5 -3
index b74b5937e695c..ddf6991d46da2 100644
@@ -18,16 +18,18 @@
  *
  * The usage of AES-XTS should conform to recommendations in NIST
  * Special Publication 800-38E and IEEE P1619/D16.
  */
 
-#include <linux/pagemap.h>
+#include <crypto/skcipher.h>
+#include <linux/export.h>
 #include <linux/mempool.h>
 #include <linux/module.h>
-#include <linux/scatterlist.h>
+#include <linux/pagemap.h>
 #include <linux/ratelimit.h>
-#include <crypto/skcipher.h>
+#include <linux/scatterlist.h>
+
 #include "fscrypt_private.h"
 
 static unsigned int num_prealloc_crypto_pages = 32;
 
 module_param(num_prealloc_crypto_pages, uint, 0444);
fs/crypto/fname.c +4 -2
index 010f9c0a4c2f1..fb01dde0f2e55 100644
@@ -9,15 +9,17 @@
  * Modified by Jaegeuk Kim, 2015.
  *
  * This has not yet undergone a rigorous security audit.
  */
 
-#include <linux/namei.h>
-#include <linux/scatterlist.h>
 #include <crypto/hash.h>
 #include <crypto/sha2.h>
 #include <crypto/skcipher.h>
+#include <linux/export.h>
+#include <linux/namei.h>
+#include <linux/scatterlist.h>
+
 #include "fscrypt_private.h"
 
 /*
  * The minimum message length (input and output length), in bytes, for all
  * filenames encryption modes.  Filenames shorter than this will be zero-padded
fs/crypto/hkdf.c +1 -1
index 0f3028adc9c72..5c095c8aa3b5a 100644
@@ -6,12 +6,12 @@
  *
  * Copyright 2019 Google LLC
  */
 
 #include <crypto/hash.h>
-#include <crypto/sha2.h>
 #include <crypto/hkdf.h>
+#include <crypto/sha2.h>
 
 #include "fscrypt_private.h"
 
 /*
  * HKDF supports any unkeyed cryptographic hash algorithm, but fscrypt uses
fs/crypto/hooks.c +2 -0
index d8d5049b8fe1f..e0b32ac841f76 100644
@@ -3,10 +3,12 @@
  * fs/crypto/hooks.c
  *
  * Encryption hooks for higher-level filesystem operations.
  */
 
+#include <linux/export.h>
+
 #include "fscrypt_private.h"
 
 /**
  * fscrypt_file_open() - prepare to open a possibly-encrypted regular file
  * @inode: the inode being opened
fs/crypto/inline_crypt.c +1 -0
index 1d008c440cb69..caaff809765b2 100644
@@ -13,10 +13,11 @@
  */
 
 #include <linux/blk-crypto.h>
 #include <linux/blkdev.h>
 #include <linux/buffer_head.h>
+#include <linux/export.h>
 #include <linux/sched/mm.h>
 #include <linux/slab.h>
 #include <linux/uio.h>
 
 #include "fscrypt_private.h"
fs/crypto/keyring.c +3 -2
index ace369f130683..7557f6a88b8f3 100644
@@ -16,16 +16,17 @@
  *
  * See the "User API" section of Documentation/filesystems/fscrypt.rst for more
  * information about these ioctls.
  */
 
-#include <linux/unaligned.h>
 #include <crypto/skcipher.h>
+#include <linux/export.h>
 #include <linux/key-type.h>
-#include <linux/random.h>
 #include <linux/once.h>
+#include <linux/random.h>
 #include <linux/seq_file.h>
+#include <linux/unaligned.h>
 
 #include "fscrypt_private.h"
 
 /* The master encryption keys for a filesystem (->s_master_keys) */
 struct fscrypt_keyring {
fs/crypto/keysetup.c +1 -0
index 0d71843af9469..a67e20d126c9b 100644
@@ -7,10 +7,11 @@
  * Originally written by Michael Halcrow, Ildar Muslukhov, and Uday Savagaonkar.
  * Heavily modified since then.
  */
 
 #include <crypto/skcipher.h>
+#include <linux/export.h>
 #include <linux/random.h>
 
 #include "fscrypt_private.h"
 
 struct fscrypt_mode fscrypt_modes[] = {
fs/crypto/policy.c +3 -1
index 701259991277e..6ad30ae07c065 100644
@@ -8,15 +8,17 @@
  * Originally written by Michael Halcrow, 2015.
  * Modified by Jaegeuk Kim, 2015.
  * Modified by Eric Biggers, 2019 for v2 policy support.
  */
 
+#include <linux/export.h>
 #include <linux/fs_context.h>
+#include <linux/mount.h>
 #include <linux/random.h>
 #include <linux/seq_file.h>
 #include <linux/string.h>
-#include <linux/mount.h>
+
 #include "fscrypt_private.h"
 
 /**
  * fscrypt_policies_equal() - check whether two encryption policies are the same
  * @policy1: the first policy

base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494

Signature · 1 line
2.49.0
author maintainer Applied
#1 lore raw
Quoted 6 lines · Eric Biggers

From: Eric Biggers <[email protected]>

Fix build warnings with W=1 that started appearing after commit a934a57a42f6 ("scripts/misc-check: check missing #include <linux/export.h> when W=1").

Quoted 6 lines

While at it, also sort the include lists alphabetically.

---

This patch applies to v6.16-rc1 and is targeting fscrypt/for-next.

Applied to https://git.kernel.org/pub/scm/fs/fscrypt/linux.git/log/?h=for-next

- Eric