[Btrfs-devel] Layout of sysfs

Chris Mason chris.mason at oracle.com
Wed Aug 15 13:06:26 PDT 2007


On Wed, 15 Aug 2007 16:01:17 -0400
Josef Bacik <jbacik at redhat.com> wrote:

> Hello,
> 
> How do you want me to do this?  I started writing stuff and then
> realized I've got two options
> 
> 1) for every superblock we create a directory inside /sys/fs/btrfs
> with the sb->s_id (so the device name), and then in there we have the
> random info like blocks_used, total_blocks, etc.  Then for every
> subvol/snapshot created inside that super block (ie every btrfs_root
> item associated with that super_block) we have another sysfs
> directory, with all of its individual information, and do something
> ugly like root->inode->i_dentry->d_name.name for the name of the
> directory.  The only problem I'm having with this is where to store
> the kobj for the super_block.  I could keep a running list of the
> super_block kobj's within the sysfs code, or change btrfs_super_block
> into btrfs_super_block_item and make a seperate btrfs_super_block
> struct for the in memory superblock.

I think option #1 would be the easiest to use.  You can put the kobject
for the super block in struct btrfs_fs_info, which is basically the
stuff global to the FS.

> 
> P.S. is there a public IRC channel/AIM/gtalk/anything I can reach you
> on so I don't have to send all these quick question emails?
> 

I'm on #linuxfs on irc.oftc.net, it's a good place for these kinds of
discussions I think.

Thanks,
Chris



More information about the Btrfs-devel mailing list