public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* confused on different inode size
@ 2007-04-08  6:39 coly
  2007-04-08 17:52 ` Theodore Tso
  0 siblings, 1 reply; 5+ messages in thread
From: coly @ 2007-04-08  6:39 UTC (permalink / raw)
  To: linux-ext4

Hi, list:

I find size of struct ext4_inode is 152 bytes, but from the dumpe2fs, it
tells me the inode size is 128 bytes.

I am confused that, the ext4_inode is the on-disk inode format, so how
can dumpe2fs tells the inode size is 128 bytes.

Further more, when I use sb_bread() to read inode from inode table (with
152 bytes inode size), I can not read proper data from the bh->b_data.
Once I use 128 bytes inode size, I can read what I want from the
bh->b_data.

I believe there is something I missed, can anybody give me some points ?

Thanks in advance.

Coly

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

* Re: confused on different inode size
  2007-04-08  6:39 confused on different inode size coly
@ 2007-04-08 17:52 ` Theodore Tso
  2007-04-09  2:33   ` coly
  0 siblings, 1 reply; 5+ messages in thread
From: Theodore Tso @ 2007-04-08 17:52 UTC (permalink / raw)
  To: coly; +Cc: linux-ext4

On Sun, Apr 08, 2007 at 02:39:03PM +0800, coly wrote:
> Hi, list:
> 
> I find size of struct ext4_inode is 152 bytes, but from the dumpe2fs, it
> tells me the inode size is 128 bytes.
> 
> I am confused that, the ext4_inode is the on-disk inode format, so how
> can dumpe2fs tells the inode size is 128 bytes.
> 
> Further more, when I use sb_bread() to read inode from inode table (with
> 152 bytes inode size), I can not read proper data from the bh->b_data.
> Once I use 128 bytes inode size, I can read what I want from the
> bh->b_data.

The inode size for ext4 filesystems can be multiple sizes; the
traditional ext2/ext3 inode size is 128 bytes.  If so, then you won't
have any of the features that require inode fields starting at
i_extra_isize.  If you use an inode size of 256 bytes, then you will
be able to use nanosecond granularity timestamps, and the extra space
(256-152 bytes) can be used for fast access to extended attributes.
If there is an expectation that the filesystem will need a larger
amount of space for extended attributes, the filesystem can be
formatted with 512, 1024, or even larger sizes (so long as it is a
power of two >= 128 bytes).

					- Ted

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

* Re: confused on different inode size
  2007-04-08 17:52 ` Theodore Tso
@ 2007-04-09  2:33   ` coly
  2007-04-09 15:26     ` Theodore Tso
  0 siblings, 1 reply; 5+ messages in thread
From: coly @ 2007-04-09  2:33 UTC (permalink / raw)
  To: Theodore Tso; +Cc: linux-ext4

Theodore:

Thanks for your replying. 

Can I understand this way:
* Though sizeof(struct ext4_inode) is 152, the real inode size on disk
still depends on mount options.
* If use old inode size, the on disk inode will be 128 bytes.
* If use new inode size(e.g. extent option in mount), the on disk inode
will be 256, or more bytes.
* If on disk inode size is 128 bytes, only first 128 bytes of struct
ext4_inode take effects.

Best regards.

Coly

在 2007-04-08日的 13:52 -0400,Theodore Tso写道:
> On Sun, Apr 08, 2007 at 02:39:03PM +0800, coly wrote:
> > Hi, list:
> > 
> > I find size of struct ext4_inode is 152 bytes, but from the dumpe2fs, it
> > tells me the inode size is 128 bytes.
> > 
> > I am confused that, the ext4_inode is the on-disk inode format, so how
> > can dumpe2fs tells the inode size is 128 bytes.
> > 
> > Further more, when I use sb_bread() to read inode from inode table (with
> > 152 bytes inode size), I can not read proper data from the bh->b_data.
> > Once I use 128 bytes inode size, I can read what I want from the
> > bh->b_data.
> 
> The inode size for ext4 filesystems can be multiple sizes; the
> traditional ext2/ext3 inode size is 128 bytes.  If so, then you won't
> have any of the features that require inode fields starting at
> i_extra_isize.  If you use an inode size of 256 bytes, then you will
> be able to use nanosecond granularity timestamps, and the extra space
> (256-152 bytes) can be used for fast access to extended attributes.
> If there is an expectation that the filesystem will need a larger
> amount of space for extended attributes, the filesystem can be
> formatted with 512, 1024, or even larger sizes (so long as it is a
> power of two >= 128 bytes).
> 
> 					- Ted

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

* Re: confused on different inode size
  2007-04-09  2:33   ` coly
@ 2007-04-09 15:26     ` Theodore Tso
  2007-04-09 15:58       ` coly
  0 siblings, 1 reply; 5+ messages in thread
From: Theodore Tso @ 2007-04-09 15:26 UTC (permalink / raw)
  To: coly; +Cc: linux-ext4

On Mon, Apr 09, 2007 at 10:33:13AM +0800, coly wrote:
> Theodore:
> 
> Thanks for your replying. 
> 
> Can I understand this way:
> * Though sizeof(struct ext4_inode) is 152, the real inode size on disk
> still depends on mount options.

Not mount options, but how the filesystem is formatted.  So substitute
"mount" with "mke2fs", and that would be correct.

> * If use old inode size, the on disk inode will be 128 bytes.
> * If use new inode size(e.g. extent option in mount), the on disk inode
> will be 256, or more bytes.

s/mount/mke2fs/

And the on-disk inode size is 256, 512, or some greater power of two,
up to the filesystem blocksize.

> * If on disk inode size is 128 bytes, only first 128 bytes of struct
> ext4_inode take effects.

Well, there's no space to store the fields beyond the first 128, so
any features that require the extra inode fields can't be used.

						- Ted

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

* Re: confused on different inode size
  2007-04-09 15:26     ` Theodore Tso
@ 2007-04-09 15:58       ` coly
  0 siblings, 0 replies; 5+ messages in thread
From: coly @ 2007-04-09 15:58 UTC (permalink / raw)
  To: Theodore Tso; +Cc: linux-ext4

Theodore:

Thanks for your explaining. I ignored this detail before, it is more
clear to me now.

Best regards.

Coly

在 2007-04-09一的 11:26 -0400,Theodore Tso写道:
> On Mon, Apr 09, 2007 at 10:33:13AM +0800, coly wrote:
> > Theodore:
> > 
> > Thanks for your replying. 
> > 
> > Can I understand this way:
> > * Though sizeof(struct ext4_inode) is 152, the real inode size on disk
> > still depends on mount options.
> 
> Not mount options, but how the filesystem is formatted.  So substitute
> "mount" with "mke2fs", and that would be correct.
> 
> > * If use old inode size, the on disk inode will be 128 bytes.
> > * If use new inode size(e.g. extent option in mount), the on disk inode
> > will be 256, or more bytes.
> 
> s/mount/mke2fs/
> 
> And the on-disk inode size is 256, 512, or some greater power of two,
> up to the filesystem blocksize.
> 
> > * If on disk inode size is 128 bytes, only first 128 bytes of struct
> > ext4_inode take effects.
> 
> Well, there's no space to store the fields beyond the first 128, so
> any features that require the extra inode fields can't be used.
> 
> 						- Ted

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

end of thread, other threads:[~2007-04-09 15:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-08  6:39 confused on different inode size coly
2007-04-08 17:52 ` Theodore Tso
2007-04-09  2:33   ` coly
2007-04-09 15:26     ` Theodore Tso
2007-04-09 15:58       ` coly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox