[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <475732B1.1090809@redhat.com>
Date: Wed, 05 Dec 2007 17:22:25 -0600
From: Eric Sandeen <sandeen@...hat.com>
To: Eric Sandeen <sandeen@...hat.com>,
ext4 development <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH 1/3] ext4: different maxbytes functions for bitmap & extent
files
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists