[haiku-development] Re: Questions regarding btrfs

  • From: "Alexander von Gluck IV" <kallisti5@xxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 18 Mar 2019 13:39:48 +0000

March 18, 2019 2:26 AM, "Bharathi Ramana Joshi" <joshibharathiramana@xxxxxxxxx> 
wrote:

Hi,

I was comparing src/add-ons/kernel/file_systems/btrfs/btrfs.h (referred to 
here after as
"implementation") with btrfs wiki (referred to here after as "wiki") and have 
a few questions.

1. There are few naming conflicts between the wiki and the implementation. 
Specifically, we have
the following

implementation -> wiki

btrfs_inode -> btrfs_inode_item

btrfs_root -> btrfs_root_item
btrfs_dir_entry -> btrfs_dir_item
btrfs_extent_data -> btrfs_file_extent_item
btrfs_block_group -> btrfs_block_group_item
btrfs_extent -> btrfs_extent_item

btrfs_device -> DEV_ITEM

Is there any specific reason for this?
Naming conflicts, especially in the absence of documentation for the 
implementation, cause
significant confusion.

This is actually *extremely* common in the programming world. These were
developed using the BTRFS specification as a reference, however, our code is 
our own.
(aka, all of our code is written by Haiku developers cleanly to ensure MIT 
license
 compliance). The author likely used the Linux / FreeBSD drivers for reference.

I like our wording on those, it omits a lot of un-needed name complexity.


2. There are some data structures in the implementation for which I was 
unable to find
documentation on the wiki. Specifically, I was unable to find documentation 
for
btrfs_backup_roots
btrfs_index
btrfs_entry
btrfs_stream
Where can I find documentation for these?

A lot of this stuff likely used the actual FreeBSD or Linux btrfs drivers as a 
reference
since reference documentation doesn't really exist (as far as I know). I'd 
start in
these drivers to understand what some of these might mean.

index, entry, roots, these are all common terms around filesystem design.

 -- Alex

Other related posts: