• N
    btrfs: sysfs: add bdi link to the fsid directory · 3092c68f
    Nikolay Borisov 提交于
    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: NNikolay Borisov <nborisov@suse.com>
    Reviewed-by: NDavid Sterba <dsterba@suse.com>
    Signed-off-by: NDavid Sterba <dsterba@suse.com>
    3092c68f
sysfs.c 44.8 KB