From: "Takashi Sato" Add blkcnt_t as the type of inode.i_blocks. This enables you to make the size of blkcnt_t either 4 bytes or 8 bytes on 32 bits architecture with CONFIG_LSF. - CONFIG_LSF Add new configuration parameter. - blkcnt_t On h8300, i386, mips, powerpc, s390 and sh that define sector_t, blkcnt_t is defined as u64 if CONFIG_LSF is enabled; otherwise it is defined as unsigned long. On other architectures, it is defined as unsigned long. - inode.i_blocks Change the type from sector_t to blkcnt_t. Signed-off-by: Takashi Sato Signed-off-by: Andrew Morton --- block/Kconfig | 9 +++++++++ include/asm-h8300/types.h | 3 +++ include/asm-i386/types.h | 5 +++++ include/asm-mips/types.h | 5 +++++ include/asm-powerpc/types.h | 5 +++++ include/asm-s390/types.h | 5 +++++ include/asm-sh/types.h | 5 +++++ include/linux/fs.h | 2 +- include/linux/types.h | 4 ++++ 9 files changed, 42 insertions(+), 1 deletion(-) diff -puN block/Kconfig~2tb-files-add-blkcnt_t block/Kconfig --- devel/block/Kconfig~2tb-files-add-blkcnt_t 2006-02-27 20:58:36.000000000 -0800 +++ devel-akpm/block/Kconfig 2006-02-27 20:58:36.000000000 -0800 @@ -23,4 +23,13 @@ config BLK_DEV_IO_TRACE git://brick.kernel.dk/data/git/blktrace.git +config LSF + bool "Support for Large Single Files" + depends on X86 || (MIPS && 32BIT) || PPC32 || ARCH_S390_31 || SUPERH || UML + default n + help + When CONFIG_LBD is disabled, say Y here if you want to + handle large file(bigger than 2TB), otherwise say N. + When CONFIG_LBD is enabled, Y is set automatically. + source block/Kconfig.iosched diff -puN include/asm-h8300/types.h~2tb-files-add-blkcnt_t include/asm-h8300/types.h --- devel/include/asm-h8300/types.h~2tb-files-add-blkcnt_t 2006-02-27 20:58:36.000000000 -0800 +++ devel-akpm/include/asm-h8300/types.h 2006-02-27 20:58:36.000000000 -0800 @@ -58,6 +58,9 @@ 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__ */ diff -puN include/asm-i386/types.h~2tb-files-add-blkcnt_t include/asm-i386/types.h --- devel/include/asm-i386/types.h~2tb-files-add-blkcnt_t 2006-02-27 20:58:36.000000000 -0800 +++ devel-akpm/include/asm-i386/types.h 2006-02-27 20:58:36.000000000 -0800 @@ -63,6 +63,11 @@ 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__ */ diff -puN include/asm-mips/types.h~2tb-files-add-blkcnt_t include/asm-mips/types.h --- devel/include/asm-mips/types.h~2tb-files-add-blkcnt_t 2006-02-27 20:58:36.000000000 -0800 +++ devel-akpm/include/asm-mips/types.h 2006-02-27 20:58:36.000000000 -0800 @@ -99,6 +99,11 @@ 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__ */ diff -puN include/asm-powerpc/types.h~2tb-files-add-blkcnt_t include/asm-powerpc/types.h --- devel/include/asm-powerpc/types.h~2tb-files-add-blkcnt_t 2006-02-27 20:58:36.000000000 -0800 +++ devel-akpm/include/asm-powerpc/types.h 2006-02-27 20:58:36.000000000 -0800 @@ -103,6 +103,11 @@ 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__ */ diff -puN include/asm-s390/types.h~2tb-files-add-blkcnt_t include/asm-s390/types.h --- devel/include/asm-s390/types.h~2tb-files-add-blkcnt_t 2006-02-27 20:58:36.000000000 -0800 +++ devel-akpm/include/asm-s390/types.h 2006-02-27 20:58:36.000000000 -0800 @@ -93,6 +93,11 @@ 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__ */ diff -puN include/asm-sh/types.h~2tb-files-add-blkcnt_t include/asm-sh/types.h --- devel/include/asm-sh/types.h~2tb-files-add-blkcnt_t 2006-02-27 20:58:36.000000000 -0800 +++ devel-akpm/include/asm-sh/types.h 2006-02-27 20:58:36.000000000 -0800 @@ -58,6 +58,11 @@ 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__ */ diff -puN include/linux/fs.h~2tb-files-add-blkcnt_t include/linux/fs.h --- devel/include/linux/fs.h~2tb-files-add-blkcnt_t 2006-02-27 20:58:36.000000000 -0800 +++ devel-akpm/include/linux/fs.h 2006-02-27 20:58:36.000000000 -0800 @@ -488,7 +488,7 @@ struct inode { unsigned int i_blkbits; unsigned long i_blksize; unsigned long i_version; - sector_t i_blocks; + blkcnt_t i_blocks; unsigned short i_bytes; spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ struct mutex i_mutex; diff -puN include/linux/types.h~2tb-files-add-blkcnt_t include/linux/types.h --- devel/include/linux/types.h~2tb-files-add-blkcnt_t 2006-02-27 20:58:36.000000000 -0800 +++ devel-akpm/include/linux/types.h 2006-02-27 20:58:36.000000000 -0800 @@ -137,6 +137,10 @@ typedef __s64 int64_t; typedef unsigned long sector_t; #endif +#ifndef HAVE_BLKCNT_T +typedef unsigned long blkcnt_t; +#endif + /* * The type of an index into the pagecache. Use a #define so asm/types.h * can override it. _