public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] include/jbd: add missing ifdef CONFIG_BLOCK
@ 2013-07-30  0:31 Xiong Zhou
  2013-07-30 13:17 ` Paul Gortmaker
  0 siblings, 1 reply; 2+ messages in thread
From: Xiong Zhou @ 2013-07-30  0:31 UTC (permalink / raw)
  To: Theodore Ts'o, Andrew Morton; +Cc: Paul Gortmaker, linux-ext4, linux-kernel

From: Xiong Zhou <jencce.kernel@gmail.com>

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.

Signed-off-by: Xiong Zhou <jencce.kernel@gmail.com>
---
 include/linux/jbd.h  |    2 ++
 include/linux/jbd2.h |    2 ++
 2 files changed, 4 insertions(+)

diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 8685d1b..e9dcf47 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -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))
 
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index d5b50a1..6214b80 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -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))
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] include/jbd: add missing ifdef CONFIG_BLOCK
  2013-07-30  0:31 [PATCH] include/jbd: add missing ifdef CONFIG_BLOCK Xiong Zhou
@ 2013-07-30 13:17 ` Paul Gortmaker
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Gortmaker @ 2013-07-30 13:17 UTC (permalink / raw)
  To: Xiong Zhou; +Cc: Theodore Ts'o, Andrew Morton, linux-ext4, linux-kernel

On 13-07-29 08:31 PM, Xiong Zhou wrote:
> From: Xiong Zhou <jencce.kernel@gmail.com>
> 
> 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.

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.
--

> 
> Signed-off-by: Xiong Zhou <jencce.kernel@gmail.com>
> ---
>  include/linux/jbd.h  |    2 ++
>  include/linux/jbd2.h |    2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/include/linux/jbd.h b/include/linux/jbd.h
> index 8685d1b..e9dcf47 100644
> --- a/include/linux/jbd.h
> +++ b/include/linux/jbd.h
> @@ -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))
>  
> diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
> index d5b50a1..6214b80 100644
> --- a/include/linux/jbd2.h
> +++ b/include/linux/jbd2.h
> @@ -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))
>  
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-07-30 13:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-30  0:31 [PATCH] include/jbd: add missing ifdef CONFIG_BLOCK Xiong Zhou
2013-07-30 13:17 ` Paul Gortmaker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox