Re: [PATCH 1/3] ext4: different maxbytes functions for bitmap & extent files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andreas Dilger wrote:
> On Dec 04, 2007  09:58 -0600, Eric Sandeen wrote:
>> +static loff_t ext4_max_size(int blkbits)
>> +{
>> +	loff_t res;
>> +	loff_t upper_limit = MAX_LFS_FILESIZE;
>> +
>> +	/* small i_blocks in vfs inode? */
>> +	if (sizeof(blkcnt_t) < sizeof(u64)) {
> 
> It would probably be more future-proof by having a struct inode here and
> using "if (sizeof(inode->i_blocks) < sizeof(__u64))".

Ok.  Honestly these were both just lifted from the original max_size
function for bitmap files :)

-Eric

>> +		upper_limit = (1LL << 32) - 1;
>> +
>> +		/* total blocks in file system block size */
>> +		upper_limit >>= (blkbits - 9);
>> +		upper_limit <<= blkbits;
> 
> There is probably a cleaner way to do this, maybe:

> 		upper_limit = (1LL << (32 + 9) - 1) & ~((1 << blkbits) - 1);
> 
> Cheers, Andreas
> --
> Andreas Dilger
> Sr. Staff Engineer, Lustre Group
> Sun Microsystems of Canada, Inc.
> 

-
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux