All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phillip Susi <psusi@cfl.rr.com>
To: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Where's the superblock allocation?
Date: Wed, 26 Oct 2011 18:30:48 -0400	[thread overview]
Message-ID: <4EA88A18.3040508@cfl.rr.com> (raw)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

After a fresh mkfs.btrfs, I'm trying to understand the data structures,
and I'm a little confused about what keeps the boot sector from being
allocated to a file.

According to the device tree, the first 4mb of the disk are mapped
directly to the first 4mb of the chunk space:

item 0 key (1 DEV_EXTENT 0) itemoff 3947 itemsize 48
	dev extent chunk_tree 3
	chunk objectid 256 chunk offset 0 length 4194304

And the chunk tree seems to agree:

item 1 key (FIRST_CHUNK_TREE CHUNK_ITEM 0) itemoff 3817 itemsize 80
	chunk length 4194304 owner 2 type 2 num_stripes 1
		stripe 0 devid 1 offset 0

But the only entry I find in the extent tree for offset 0 is:

item 0 key (0 BLOCK_GROUP_ITEM 4194304) itemoff 3971 itemsize 24
	block group used 0 chunk_objectid 256 flags 2

So it appears that the first 4mb of the disk are part of a block group,
and up for allocation whenever needed.  Why isn't there an entry in the
extent tree marking the first few kb as reserved for the superblock, or
alternatively, the chunk map starting at a non zero disk offset?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6oihUACgkQJ4UciIs+XuJ0EwCfYrWbAQRy7BP2Ogmvrn/pBW0y
D/wAnibm4TqPV1PyqLi2H0Vain1ftW5Q
=miI9
-----END PGP SIGNATURE-----

                 reply	other threads:[~2011-10-26 22:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4EA88A18.3040508@cfl.rr.com \
    --to=psusi@cfl.rr.com \
    --cc=linux-btrfs@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.