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

Badari Pulavarty <[email protected]>
Newsgroups gmane.comp.file-systems.ext2.devel
Message-ID <[email protected]>
On Fri, 2006-05-19 at 09:42 -0700, Mingming Cao wrote:
> On Fri, 2006-05-19 at 09:15 -0700, Badari Pulavarty wrote:
> > On Fri, 2006-05-19 at 11:10 -0500, Dave Kleikamp wrote:
> > > On Fri, 2006-05-19 at 08:57 -0700, Badari Pulavarty wrote:
> > > > While I agree, that its better to add SECTOR_FMT for clarity sake -
> > > > but wondering if following would work ..
> > > > 
> > > > #if (BITS_PER_LONG == 32) 
> > > > 
> > > > #ifdef HAVE_SECTOR_T
> > > > #define E3FSBLK "%llu"
> > > > #else 
> > > > #define E3FSBLK "%lu"
> > > > #endif
> > > > 
> > > > #else
> > > > #define E3FSBLK "%lu"
> > > > #endif
> > > 
> 
> I almost think this will work, it seems on 32 bit if HAVE_SECTOR_T
> defined, the sector_t type is always unsigned long long.
> 
> But checking the rest of 64 bit arch where sector_t is defined, found
> previous assumption not always true: about on 64 bit machine
> sector_t/u64 is always unsigned long. At least, cscope shows asm-sh
> arch, BITS_PER_LONG is 64, while, u64/sector_t is unsigned long long, so
> this won't work for this case.

It should work on 64-bit machines also as "long long" is equal to "long"
(64-bit) on these machines (verified it atleast on x86-64, ppc64)

Thanks,
Badari



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