Hello everyone.
This is the support for default single-device configuration.
Subvolumes are _allowed_. Transparent compression is not
allowed. Leafsize != 4K is not allowed. Nodesize != 4K is
not allowed. Grub-0.97+btrfs doesn''t understand exotic things
like preallocated extents (e.g. files composed by fallocate(2),
posix_fallocate(3)). Also grub-0.97 doesn''t check btrfs
checksums. In such configurations btrfs_stage1_5 doesn''t
exceed 62 sectors in size and can be installed to the boot
area.
Technical overview:
Things are complicated because of logical/physical block
translations. We can not afford to maintain a long cache,
so grub will search like a mad. The main search routine
aux_tree_lookup() is recursive with depth 2. On the upper
level we traverse the chunk tree and scroll the system
array for a translation map. We have 3 different pools for
search so that logical threads (e.g. name resolution,
updating fs_root, looking for translation map) won''t step
on each other. Every such pool is represented by structure
btrfs_path, which has one "sliding" 4K-buffer.
btrfs_mount() looks through super versions and pick up the
most recent one. Then chunk_root and tree_root are installed
to the global structure btrfs_fs_info. At the end we pick
up and install the latest version of fs_tree.
btrfs_dir() updates the fs_tree during path walk every time
when we jump to another subvolume.
This stuff can be easily adjusted for other grub versions.
Attached is the patch against the package
grub-0.97-38.fc10.src.rpm that can be found on the fedora
mirrors, for example here:
http://ucho.ignum.cz/fedora/linux/releases/10/Fedora/source/SRPMS/grub-0.97-38.fc10.src.rpm
All comments, bugreports, etc. are welcome as usual.
Thanks,
Edward.