64bit issues in filesystems (was Re: Filesystem questions.)

From: Steve Dodd (steved@loth.demon.co.uk)
Date: Tue Mar 28 2000 - 01:44:13 EST


On Tue, Mar 28, 2000 at 12:05:59AM +0100, Dave Jones wrote:

> I've spent a while this evening hacking on the 2.3.99 AFFS driver.
> I've rewritten the file_write routines, and got it into a state where
> it compiles, which is a start, but now I have unsolved symbols when I
> try to insert the module.
>
> __divdi3
> __moddi3
>
> At first I thought these were gcc builtins.

They're helper functions in libgcc, I think. Whatever they are, gcc emits
references to them when you try to do division on 64bit quantities on IA32
(and presumably any 32bit arch). Some architectures seem to link libgcc, for
others (e.g. i386), it seems to be have been decreed that doing so is a bad
idea.

Rummage in your code for division and modulo on 64bit quantities (or
expressions that the compiler promotes to 64bit).. In the (sssh!) work I'm
doing on the NTFS driver, I do a whole load of tests in read_super to ensure
that the block number will fit in an unsigned long, and that the inode number
will fit in an ino_t, etc. The idea being that it's probably not worth trying
to support huge filesystems and huge files on a 32bit arch (at least, not yet),
but that it should work fine on 64bit ones. Anyway, those tests for me were
the ones that needed rewriting to avoid divisions..

-- 
"Friends help you move.  Real friends help you move bodies."

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



This archive was generated by hypermail 2b29 : Fri Mar 31 2000 - 21:00:21 EST