• Nikolay Borisov's avatar
    btrfs: sysfs: add bdi link to the fsid directory · 3092c68f
    Nikolay Borisov authored
    Since BTRFS uses a private bdi it makes sense to create a link to this
    bdi under /sys/fs/btrfs/<UUID>/bdi. This allows size of read ahead to
    be controlled. Without this patch it's not possible to uniquely identify
    which bdi pertains to which btrfs filesystem in the case of multiple
    btrfs filesystems.
    
    It's fine to simply call sysfs_remove_link without checking if the
    link indeed has been created. The call path
    
    sysfs_remove_link
     kernfs_remove_by_name
      kernfs_remove_by_name_ns
    
    will simply return -ENOENT in case it doesn't exist.
    Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    3092c68f
sysfs.c 44.8 KB