Re: [RFC 7/7] ext3 blocks: convert ext3_fsblk_t to sector_t

"Stephen C. Tweedie" <[email protected]>
Newsgroups gmane.comp.file-systems.ext2.devel
Message-ID <[email protected]>
Hi,

On Thu, 2006-05-18 at 17:38 -0700, Mingming Cao wrote:

> if sector_t is defined, it's u64 type, otherwise it's unsigned long
> 
> #ifndef HAVE_SECTOR_T
> typedef unsigned long sector_t;
> 
> It seems u64 on 32 bit is defined as unsigned long long, while on 64 bit
> architectures, it's defined as unsigned long.

Nope: 

        $ grep "typedef.*u64;"  include/asm-*/types*
        include/asm-x86_64/types.h:typedef unsigned long long  __u64;

> So, on 64 bit machine, it's always unsigned long, 

Unfortunately sector_t, which is u64 on x86_64, is unsigned long long.

> I think the following will work, thoughts?
> 
> #if (BITS_PER_LONG == 32 && sizeof(ext3_fsblk_t) > 4)

Does sizeof() work in #if?

--Stephen




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.