include/jbd: add missing ifdef CONFIG_BLOCK
PATCH 1/1 include/jbd: add missing ifdef CONFIG_BLOCK
From: Xiong Zhou <[email protected]>
In jbd{2}.h, BH_PrivateStart is used in the define of enum jbd_state_bits, which is defined in buffer_head.h under ifdef CONFIG_BLOCK. In these two headers, BUFFER_FNS and TAS_BUFFER_FNS and jbd_common.h refer to enum jbd_state_bits, so they should under ifdef CONFIG_BLOCK.
--- include/linux/jbd.h | 2 ++ include/linux/jbd2.h | 2 ++ 2 files changed, 4 insertions(+)
include/linux/jbd.h +2 -0
@@ -244,6 +244,7 @@ typedef struct journal_superblock_s#include <linux/fs.h> #include <linux/sched.h> +#ifdef CONFIG_BLOCK enum jbd_state_bits {BH_JBD /* Has an attached ext3 journal_head */ = BH_PrivateStart,
@@ -269,6 +270,7 @@ TAS_BUFFER_FNS(RevokeValid, revokevalid) BUFFER_FNS(Freed, freed)#include <linux/jbd_common.h> +#endif #define J_ASSERT (assert) BUG_ON(!(assert))
include/linux/jbd2.h +2 -0
@@ -298,6 +298,7 @@ typedef struct journal_superblock_s#include <linux/fs.h> #include <linux/sched.h> +#ifdef CONFIG_BLOCK enum jbd_state_bits {BH_JBD /* Has an attached ext3 journal_head */ = BH_PrivateStart,
@@ -326,6 +327,7 @@ BUFFER_FNS(Shadow, shadow) BUFFER_FNS(Verified, verified)#include <linux/jbd_common.h> +#endif #define J_ASSERT (assert) BUG_ON(!(assert))
Quoted 6 lines · Xiong Zhou
From: Xiong Zhou <[email protected]>
In jbd{2}.h,
BH_PrivateStartis used in the define of enumjbd_state_bits, which is defined inbuffer_head.hunder ifdefCONFIG_BLOCK. In these two headers,BUFFER_FNSandTAS_BUFFER_FNSandjbd_common.hrefer to enumjbd_state_bits, so they should under ifdefCONFIG_BLOCK.
What exactly is it you are trying to solve here? I 1st thought perhaps some pointless randconfig build fail, but even if you try to hand craft a .config with "# CONFIG_BLOCK is not set" you still can't get to ext2/3/4 options because fs/Kconfig has this:
---------------
if BLOCK
source "fs/ext2/Kconfig"
source "fs/ext3/Kconfig"
source "fs/ext4/Kconfig"
----------
The help text for CONFIG_BLOCK is explicit in saying this too.
I don't see value in adding more #ifdef noise that doesn't do anything.
Thanks,
Paul.
--
Quoted 48 lines
Signed-off-by Xiong Zhou <[email protected]>--- include/linux/jbd.h | 2 ++ include/linux/jbd2.h | 2 ++ 2 files changed, 4 insertions(+)include/linux/jbd.h +2
-0@@ -244,6 +244,7 @@ typedef struct journal_superblock_s#include <linux/fs.h> #include <linux/sched.h> +#ifdef CONFIG_BLOCK enum jbd_state_bits {BH_JBD /* Has an attached ext3 journal_head */ = BH_PrivateStart,@@ -269,6 +270,7 @@ TAS_BUFFER_FNS(RevokeValid, revokevalid) BUFFER_FNS(Freed, freed)#include <linux/jbd_common.h> +#endif #define J_ASSERT (assert) BUG_ON(!(assert))include/linux/jbd2.h +2
-0@@ -298,6 +298,7 @@ typedef struct journal_superblock_s#include <linux/fs.h> #include <linux/sched.h> +#ifdef CONFIG_BLOCK enum jbd_state_bits {BH_JBD /* Has an attached ext3 journal_head */ = BH_PrivateStart,@@ -326,6 +327,7 @@ BUFFER_FNS(Shadow, shadow) BUFFER_FNS(Verified, verified)#include <linux/jbd_common.h> +#endif #define J_ASSERT (assert) BUG_ON(!(assert))