Re: 2.1GB File Size Limit

Alexander Kjeldaas (astor@fast.no)
Fri, 19 Feb 1999 17:03:25 +0100


On Fri, Feb 19, 1999 at 08:50:47AM -0600, yocum@fnal.gov wrote:
>
> Hello all,
>
> This is "sort of" a kernel related question as well as a ext2fs
> question: Is anyone working on the 32-bit addressing problem which
> limits file size to 2.1GB?
>
> (I hear screams of anguish - "Who has files larger than 2GB?!??"
> We do. Gotta love that high energy physics!)
>
> Will 64-bit file system addressing appear only in the kernel for
> 64-bit chips (SPARC, Alpha, Merced, etc.) or can we expect this
> sometime in the future for the "lowly" i386 machines?

I have a system which works for simple programs. I haven't tested
mmap, statfs etc.

I use Matti Aarnio's patch available from

Fetch ftp://mea.tmt.tele.fi/linux/LFS/

with the modification that I use the following stat64 structure (in
linux/include/asm-i386/stat.h). The kernel and glibc have
incompatible structures and instead of translating, I changed the
kernel structure:

struct stat64 {
unsigned long long st_dev;
unsigned short __pad1;
unsigned long st_ino;
unsigned int st_mode;
unsigned int st_nlink;
unsigned int st_uid;
unsigned int st_gid;
unsigned long long st_rdev;
unsigned short __pad2;
unsigned long long st_size;
unsigned long st_blksize;
unsigned long long st_blocks;
unsigned long st_atime;
unsigned long __unused1;
unsigned long st_mtime;
unsigned long __unused2;
unsigned long st_ctime;
unsigned long __unused3;
unsigned long __unused4;
unsigned long __unused5;
};

Then, you have to use glibc-2.1 (available from cygnus). I use the
following one-liner to get stat64 working:

diff -ur glibc-2.1/sysdeps/unix/sysv/linux/xstat64.c glibc-2.1-test/sysdeps/unix
/sysv/linux/xstat64.c
--- glibc-2.1/sysdeps/unix/sysv/linux/xstat64.c Tue Oct 20 20:14:15 1998
+++ glibc-2.1-test/sysdeps/unix/sysv/linux/xstat64.c Sat Feb 13 00:44:40 1999
@@ -36,7 +36,7 @@
struct kernel_stat kbuf;
int result;

- result = INLINE_SYSCALL (stat, 2, name, &kbuf);
+ result = INLINE_SYSCALL (stat64, 2, name, &kbuf);
if (result == 0)
result = xstat64_conv (vers, &kbuf, buf);

More patches to glibc are needed for the rest of the system calls, but
the above should get you going.

Compile as usual on a LSF system (-D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64).

Remember to make your ext2-filesystem with a block-size larger than 1k
(which is the default)! 4k should suffice for most applications, but
check the documentation in the LFS patch.

astor

-- 
 Alexander Kjeldaas, Fast Search & Transfer, Trondheim, Norway

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/