All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@sun.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: ext4 development <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH 1/3] ext4: different maxbytes functions for bitmap & extent files
Date: Wed, 5 Dec 2007 16:18:04 -0700	[thread overview]
Message-ID: <20071205231804.GA3604@webber.adilger.int> (raw)
In-Reply-To: <47557913.3090208@redhat.com>

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

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

  reply	other threads:[~2007-12-05 23:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-04 15:55 [PATCH 0/3] ext4: Handle different max offsets for bitmap & extent-based files Eric Sandeen
2007-12-04 15:58 ` [PATCH 1/3] ext4: different maxbytes functions for bitmap & extent files Eric Sandeen
2007-12-05 23:18   ` Andreas Dilger [this message]
2007-12-05 23:22     ` Eric Sandeen
2007-12-04 15:59 ` [PATCH 2/3] ext4: export iov_shorten from kernel for ext4's use Eric Sandeen
2007-12-04 16:00 ` [PATCH 3/3] ext4: store maxbytes for bitmapped files and return EFBIG as appropriate Eric Sandeen
2007-12-04 19:31   ` [PATCH 3/3] ext4: (V2) " Eric Sandeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071205231804.GA3604@webber.adilger.int \
    --to=adilger@sun.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.