Results 1 to 2 of 2

Thread: get btrfs filesystem id from kernel module

  1. #1

    Default get btrfs filesystem id from kernel module

    I was wondering regarding to fetching the correct fsid on btrfs.
    fsid returned from stats give: 36h/54d
    and fsid returned from kernel code is 52.
    On kernel 11.3 3.0.101-0.47.71-default in order to get it, I do the
    following: convert inode struct to btrfs_inode struct (use btrfsInode
    = BTRFS_I(inode)), then from btrfs_inode struct i go to root field,
    and from root i take anon_dev or anon_super.s_dev.
    struct btrfs_inode *btrfsInode;
    btrfsInode = BTRFS_I(inode);
    btrfsInode->root->anon_super.s_dev or
    btrfsInode->root->anon_dev - depend on kernel.

    But in kernel 3.12.28-4-default in order to get the fsid, i need to go
    to the inode -> superblock -> device id (inode->i_sb->s_dev)

    And is there a proper way to get it ?

  2. #2

    Default Re: get btrfs filesystem id from kernel module

    Thanks to btrfs mailing list,
    the proper way to get fsid is via: BTRFS_I(inode)->root->fs_info->fsid

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts