Skip to contentSkip to conversation

Unify CONFIG_LBD and CONFIG_LSF handling

PATCH In review Matthew Wilcox 4 participants 10 messages Jun 19, 2006 – Jun 22, 2006 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Unify CONFIG_LBD and CONFIG_LSF handling

CONFIG_LBD and CONFIG_LSF are spread into asm/types.h for no particularly good reason. Centralising the definition in linux/types.h means that arch maintainers don't need to bother adding it, as well as fixing the problem with x86-64 users being asked to make a decision that has absolutely no effect. The H8/300 porters seem particularly confused since I'm not aware of any microcontrollers that need to support 2TB filesystems these days.

Index: ./block/Kconfig
===================================================================
RCS file: /var/cvs/linux-2.6/block/Kconfig,v
retrieving revision 1.4

block/Kconfig +2 -4
diff -u -p -r1.4 Kconfig
@@ -1,11 +1,9 @@
 #
 # Block layer core configuration
 #
-#XXX - it makes sense to enable this only for 32-bit subarch's, not for x86_64
-#for instance.
 config LBD
 	bool "Support for Large Block Devices"
-	depends on X86 || (MIPS && 32BIT) || PPC32 || (S390 && !64BIT) || SUPERH || UML
+	depends on !64BIT
 	help
 	  Say Y here if you want to attach large (bigger than 2TB) discs to
 	  your machine, or if you want to have a raid or loopback device
@@ -26,7 +24,7 @@ config BLK_DEV_IO_TRACE
 
 config LSF
 	bool "Support for Large Single Files"
-	depends on X86 || (MIPS && 32BIT) || PPC32 || ARCH_S390_31 || SUPERH || UML
+	depends on !64BIT
 	help
 	  Say Y here if you want to be able to handle very large files (bigger
 	  than 2TB), otherwise say N.

Index: ./include/asm-h8300/types.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/asm-h8300/types.h,v retrieving revision 1.5

include/asm-h8300/types.h +0 -6
diff -u -p -r1.5 types.h
@@ -55,12 +55,6 @@ typedef unsigned long long u64;
 
 typedef u32 dma_addr_t;
 
-#define HAVE_SECTOR_T
-typedef u64 sector_t;
-
-#define HAVE_BLKCNT_T
-typedef u64 blkcnt_t;
-
 #endif /* __KERNEL__ */
 
 #endif /* __ASSEMBLY__ */

Index: ./include/asm-i386/types.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/asm-i386/types.h,v retrieving revision 1.4

include/asm-i386/types.h +0 -10
diff -u -p -r1.4 types.h
@@ -58,16 +58,6 @@ typedef u32 dma_addr_t;
 #endif
 typedef u64 dma64_addr_t;
 
-#ifdef CONFIG_LBD
-typedef u64 sector_t;
-#define HAVE_SECTOR_T
-#endif
-
-#ifdef CONFIG_LSF
-typedef u64 blkcnt_t;
-#define HAVE_BLKCNT_T
-#endif
-
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */

Index: ./include/asm-mips/types.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/asm-mips/types.h,v retrieving revision 1.6

include/asm-mips/types.h +0 -10
diff -u -p -r1.6 types.h
@@ -94,16 +94,6 @@ typedef unsigned long long phys_t;
 typedef unsigned long phys_t;
 #endif
 
-#ifdef CONFIG_LBD
-typedef u64 sector_t;
-#define HAVE_SECTOR_T
-#endif
-
-#ifdef CONFIG_LSF
-typedef u64 blkcnt_t;
-#define HAVE_BLKCNT_T
-#endif
-
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */

Index: ./include/asm-powerpc/types.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/asm-powerpc/types.h,v retrieving revision 1.3

include/asm-powerpc/types.h +0 -10
diff -u -p -r1.3 types.h
@@ -98,16 +98,6 @@ typedef struct {
 	unsigned long env;
 } func_descr_t;
 
-#ifdef CONFIG_LBD
-typedef u64 sector_t;
-#define HAVE_SECTOR_T
-#endif
-
-#ifdef CONFIG_LSF
-typedef u64 blkcnt_t;
-#define HAVE_BLKCNT_T
-#endif
-
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */

Index: ./include/asm-s390/types.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/asm-s390/types.h,v retrieving revision 1.6

include/asm-s390/types.h +0 -10
diff -u -p -r1.6 types.h
@@ -88,16 +88,6 @@ typedef union {
 	} subreg;
 } register_pair;
 
-#ifdef CONFIG_LBD
-typedef u64 sector_t;
-#define HAVE_SECTOR_T
-#endif
-
-#ifdef CONFIG_LSF
-typedef u64 blkcnt_t;
-#define HAVE_BLKCNT_T
-#endif
-
 #endif /* ! __s390x__   */
 #endif /* __ASSEMBLY__  */
 #endif /* __KERNEL__    */

Index: ./include/asm-sh/types.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/asm-sh/types.h,v retrieving revision 1.5

include/asm-sh/types.h +0 -10
diff -u -p -r1.5 types.h
@@ -53,16 +53,6 @@ typedef unsigned long long u64;
 
 typedef u32 dma_addr_t;
 
-#ifdef CONFIG_LBD
-typedef u64 sector_t;
-#define HAVE_SECTOR_T
-#endif
-
-#ifdef CONFIG_LSF
-typedef u64 blkcnt_t;
-#define HAVE_BLKCNT_T
-#endif
-
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */

Index: ./include/asm-x86_64/types.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/asm-x86_64/types.h,v retrieving revision 1.5

include/asm-x86_64/types.h +0 -3
diff -u -p -r1.5 types.h
@@ -48,9 +48,6 @@ typedef unsigned long long u64;
 typedef u64 dma64_addr_t;
 typedef u64 dma_addr_t;
 
-typedef u64 sector_t;
-#define HAVE_SECTOR_T
-
 #endif /* __ASSEMBLY__ */
 
 #endif /* __KERNEL__ */

Index: ./include/linux/types.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/linux/types.h,v retrieving revision 1.11

include/linux/types.h +9 -4
diff -u -p -r1.11 types.h
@@ -130,14 +130,19 @@ typedef		__s64		int64_t;
 
 /*
  * The type used for indexing onto a disc or disc partition.
- * If required, asm/types.h can override it and define
- * HAVE_SECTOR_T
  */
-#ifndef HAVE_SECTOR_T
+#ifdef CONFIG_LBD
+typedef u64 sector_t;
+#else
 typedef unsigned long sector_t;
 #endif
 
-#ifndef HAVE_BLKCNT_T
+/*
+ * The type of the inode's block count.
+ */
+#ifdef CONFIG_LSF
+typedef u64 blkcnt_t;
+#else
 typedef unsigned long blkcnt_t;
 #endif
 
#1 lore raw

Hi,

Quoted 21 lines · Matthew Wilcox

Index: ./block/Kconfig
===================================================================
RCS file: /var/cvs/linux-2.6/block/Kconfig,v
retrieving revision 1.4
diff -u -p -r1.4 Kconfig

block/Kconfig +1 -3
@@ -1,11 +1,9 @@
 #
 # Block layer core configuration
 #
-#XXX - it makes sense to enable this only for 32-bit subarch's, not for x86_64
-#for instance.
 config LBD
 	bool "Support for Large Block Devices"
-	depends on X86 || (MIPS && 32BIT) || PPC32 || (S390 && !64BIT) || SUPERH || UML
+	depends on !64BIT
 	help
 	  Say Y here if you want to attach large (bigger than 2TB) discs to
 	  your machine, or if you want to have a raid or loopback device

block/Kconfig config BLK_DEV_IO_TRACE · line 30

Quoted 8 lines
block/Kconfig +1 -1
@@ -26,7 +24,7 @@ config BLK_DEV_IO_TRACE
 
 config LSF
 	bool "Support for Large Single Files"
-	depends on X86 || (MIPS && 32BIT) || PPC32 || ARCH_S390_31 || SUPERH || UML
+	depends on !64BIT
 	help
 	  Say Y here if you want to be able to handle very large files (bigger
 	  than 2TB), otherwise say N.

While you're at it, could you please take care of bug #6719 and fix the LSF help text?
Thanks.

bye, Roman

#2 lore raw
Quoted 14 lines · Roman Zippel

Hi,

block/Kconfig config BLK_DEV_IO_TRACE · line 30

Quoted 7 lines · Matthew Wilcox

config LSF

block/Kconfig +1 -1
 	bool "Support for Large Single Files"
-	depends on X86 || (MIPS && 32BIT) || PPC32 || ARCH_S390_31 || SUPERH || UML
+	depends on !64BIT
 	help
 	  Say Y here if you want to be able to handle very large files (bigger
 	  than 2TB), otherwise say N.

While you're at it, could you please take care of bug #6719 and fix the LSF help text?
Thanks.

I don't really understand the complaint. If <rare condition applies>, say Y, otherwise say N. If unsure, say Y. The default is N. Perhaps all that's needed is to spell out the implications of saying Y? How about:

This option allows 32-bit systems to support files larger than 2 Terabytes, at a cost of increased kernel memory usage. Most people do not need the overhead and should answer N to this question, but if you do not understand this question, answering Y is safest.

Or is that too verbose?

NB: Anyone suggesting that we should say "Tibibytes" instead of Terabytes there will be hunted down and brutally slain. That is all.

#3 lore raw

Hi,

Quoted 21 lines · Matthew Wilcox
Quoted 14 lines · Roman Zippel

Hi,

block/Kconfig config BLK_DEV_IO_TRACE · line 30

Quoted 7 lines · Matthew Wilcox

config LSF

block/Kconfig +1 -1
 	bool "Support for Large Single Files"
-	depends on X86 || (MIPS && 32BIT) || PPC32 || ARCH_S390_31 || SUPERH || UML
+	depends on !64BIT
 	help
 	  Say Y here if you want to be able to handle very large files (bigger
 	  than 2TB), otherwise say N.

While you're at it, could you please take care of bug #6719 and fix the LSF help text?
Thanks.

I don't really understand the complaint. If <rare condition applies>, say Y, otherwise say N. If unsure, say Y. The default is N. Perhaps all that's needed is to spell out the implications of saying Y? How about:

Quoted 7 lines

This option allows 32-bit systems to support files larger than 2 Terabytes, at a cost of increased kernel memory usage. Most people do not need the overhead and should answer N to this question, but if you do not understand this question, answering Y is safest.

Or is that too verbose?

How likely is it that someone who doesn't understand the question needs this option? I think N is a safe answer here.

bye, Roman

#4 lore raw
Quoted 4 lines · Matthew Wilcox
Quoted 2 lines · Roman Zippel

[snip]

Quoted 12 lines
Quoted 12 lines

I don't really understand the complaint. If <rare condition applies>, say Y, otherwise say N. If unsure, say Y. The default is N. Perhaps all that's needed is to spell out the implications of saying Y? How about:

This option allows 32-bit systems to support files larger than 2 Terabytes, at a cost of increased kernel memory usage. Most people do not need the overhead and should answer N to this question, but if you do not understand this question, answering Y is safest.

Quoted 6 lines
Quoted 1 line

Or is that too verbose?

How likely is it that someone who doesn't understand the question needs this option? I think N is a safe answer here.

bye, Roman

This is the impression I had as well. Even if you disagree though, I was equally confused by the fact that if we say to answer Y as default, why is the kconfig default already N?

-
Matt LaPlante

#5 lore raw
Quoted 6 lines · Matt LaPlante
Quoted 2 lines

How likely is it that someone who doesn't understand the question needs this option? I think N is a safe answer here.

This is the impression I had as well. Even if you disagree though, I was equally confused by the fact that if we say to answer Y as default, why is the kconfig default already N?

The *default* is N as that's the answer most people want. The *safe* answer is Y as it won't prevent you from getting access to your data. Makes sense?

#6 lore raw

Hi,

Quoted 11 lines · Matthew Wilcox
Quoted 6 lines · Matt LaPlante
Quoted 2 lines

How likely is it that someone who doesn't understand the question needs this option? I think N is a safe answer here.

This is the impression I had as well. Even if you disagree though, I was equally confused by the fact that if we say to answer Y as default, why is the kconfig default already N?

The *default* is N as that's the answer most people want. The *safe* answer is Y as it won't prevent you from getting access to your data. Makes sense?

This would imply that most people with 32bit systems have 2TB files, which I think is rather unlikely. Distributions can turn this option on, but I think people who compile their own kernel, either understand this option or don't need it.

bye, Roman

#7 lore raw
Quoted 11 lines · Roman Zippel

Hi,

Quoted 3 lines · Matthew Wilcox

The *default* is N as that's the answer most people want. The *safe* answer is Y as it won't prevent you from getting access to your data. Makes sense?

This would imply that most people with 32bit systems have 2TB files, which I think is rather unlikely. Distributions can turn this option on, but I think people who compile their own kernel, either understand this option or don't need it.

I think it implies exactly the opposite.

In any case, the length of this thread answers your question from earlier:
No, I won't fix bug 6719 as part of this patch. It's a completely unrelated issue and the problem is ill-defined. It's also something that's infinitely arguable.

The original patch is simple and fixes one problem: that architecture people are supposed to learn about LSF and LBD when it really has no effect on their architecture.

#8 lore raw
In reply to Roman Zippel
Quoted 5 lines
Quoted 2 lines

Or is that too verbose?

How likely is it that someone who doesn't understand the question needs this option? I think N is a safe answer here.

N is not the safe answer; Y is. If you set it to N you can't read all your files (if there is a big one) etc etc.
The safe-but-a-bit-slower answer really is Y.

#9 lore raw
Quoted 9 lines

-----Original Message-----
From: Arjan van de Ven [mailto:[email protected]]
Sent: Tuesday, June 20, 2006 11:59 AM
To: Roman Zippel
Cc: Matthew Wilcox; Linus Torvalds; [email protected]; [email protected]
Subject: Re: [PATCH] Unify CONFIG_LBD and CONFIG_LSF handling

Quoted 9 lines
Quoted 4 lines
Quoted 1 line

Or is that too verbose?

How likely is it that someone who doesn't understand the question needs this option? I think N is a safe answer here.

N is not the safe answer; Y is. If you set it to N you can't read all your files (if there is a big one) etc etc.
The safe-but-a-bit-slower answer really is Y.

So should default be changed to Y? It's currently N for kconfig, despite the recommendation to the contrary.