All of lore.kernel.org
 help / color / mirror / Atom feed
* Question on huge_file
@ 2009-07-10 15:32 Curt Wohlgemuth
  2009-07-10 15:39 ` Eric Sandeen
  2009-07-10 17:47 ` Andreas Dilger
  0 siblings, 2 replies; 4+ messages in thread
From: Curt Wohlgemuth @ 2009-07-10 15:32 UTC (permalink / raw)
  To: ext4 development

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.

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?

Am I missing something?

Thanks,
Curt

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question on huge_file
  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
  1 sibling, 1 reply; 4+ messages in thread
From: Eric Sandeen @ 2009-07-10 15:39 UTC (permalink / raw)
  To: Curt Wohlgemuth; +Cc: ext4 development

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.
> 
> 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?
> 
> Am I missing something?

i_size_lo/hi is in bytes, ee_block is in .... blocks.

so 2^32 blocks is a lot more than 2^32 bytes, and i_size_hi/lo are
needed to contain it.  I think.  :)

-Eric

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question on huge_file
  2009-07-10 15:39 ` Eric Sandeen
@ 2009-07-10 16:31   ` Curt Wohlgemuth
  0 siblings, 0 replies; 4+ messages in thread
From: Curt Wohlgemuth @ 2009-07-10 16:31 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: ext4 development

Hi Eric:

On Fri, Jul 10, 2009 at 8:39 AM, Eric Sandeen<sandeen@redhat.com> wrote:
> 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.
>>
>> 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?
>>
>> Am I missing something?
>
> i_size_lo/hi is in bytes, ee_block is in .... blocks.
>
> so 2^32 blocks is a lot more than 2^32 bytes, and i_size_hi/lo are
> needed to contain it.  I think.  :)

Oops.  Of course.  I knew it had to be something simple.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question on huge_file
  2009-07-10 15:32 Question on huge_file Curt Wohlgemuth
  2009-07-10 15:39 ` Eric Sandeen
@ 2009-07-10 17:47 ` Andreas Dilger
  1 sibling, 0 replies; 4+ messages in thread
From: Andreas Dilger @ 2009-07-10 17:47 UTC (permalink / raw)
  To: Curt Wohlgemuth; +Cc: ext4 development

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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-07-10 17:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.