]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: sysfs: add bdi link to the fsid directory
authorNikolay Borisov <nborisov@suse.com>
Fri, 3 Jul 2020 08:13:15 +0000 (11:13 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 27 Jul 2020 10:55:41 +0000 (12:55 +0200)
commit3a3281e13af58cbd372791212470355ef3cf79b5
treed8dd0541d3816ca6bee745dd0273ab5140df14cf
parent29a66238d7387dbcc281bdff11133acc0a7ee63c
btrfs: sysfs: add bdi link to the fsid directory

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: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/sysfs.c