From: Andreas Dilger <adilger@sun.com>
To: Curt Wohlgemuth <curtw@google.com>
Cc: ext4 development <linux-ext4@vger.kernel.org>
Subject: Re: Question on huge_file
Date: Fri, 10 Jul 2009 11:47:52 -0600 [thread overview]
Message-ID: <20090710174752.GE12939@webber.adilger.int> (raw)
In-Reply-To: <6601abe90907100832q6ab886f2r7fc8e3be2a79e8e5@mail.gmail.com>
On Jul 10, 2009 08:32 -0700, Curt Wohlgemuth wrote:
> I apologize if this is a dumb question, but I'm having trouble
> understanding the huge_file superblock flag.
>
> I see how, if this flag is set, that the inode can have a size > 2**32
> bytes, using the i_size_lo/i_size_high fields.
Actually, it is RO_COMPAT_LARGE_FILE that indicates support for size larger
than 2^32 _bytes_. The RO_COMPAT_HUGE_FILE indicates support for blocks
more than 2^32 512-byte _sectors_ (2TB).
> But since an ext4_extent only uses 32-bits for for its ee_block field
> to represent the logical block, how can an extent describe any block
> range of a file past the 4GiB boundary?
There are two different mechanisms used with HUGE_FILE. It allows
storing a high word of data (2^48 sectors) and it ALSO changes the
units to be in terms of filesystem blocksize instead of 512-byte sectors.
While both of these mechanisms are not strictly necessary with the
current extent format, which only handles 2^32 filesystem blocks,
there were some good reasons to make both changes:
- having the inode i_blocks field be in 512-byte sectors was confusing
to many coders and wasted 3 bits (for 4kB blocks) of dynamic range.
- if we ever implement a new extent format that handles more than 2^32
filesystem blocks, or use larger filesystem blocks we don't need to
rework this code again.
Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.
prev parent reply other threads:[~2009-07-10 17:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-10 15:32 Question on huge_file Curt Wohlgemuth
2009-07-10 15:39 ` Eric Sandeen
2009-07-10 16:31 ` Curt Wohlgemuth
2009-07-10 17:47 ` Andreas Dilger [this message]
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=20090710174752.GE12939@webber.adilger.int \
--to=adilger@sun.com \
--cc=curtw@google.com \
--cc=linux-ext4@vger.kernel.org \
/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.