btrfs: factor out sysfs code for sending device uevent
The device uevent belongs to the sysfs API. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
@@ -913,6 +913,17 @@ int btrfs_sysfs_add_device_link(struct btrfs_fs_devices *fs_devices,
|
||||
return error;
|
||||
}
|
||||
|
||||
void btrfs_kobject_uevent(struct block_device *bdev, enum kobject_action action)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, action);
|
||||
if (ret)
|
||||
pr_warn("BTRFS: Sending event '%d' to kobject: '%s' (%p): failed\n",
|
||||
action, kobject_name(&disk_to_dev(bdev->bd_disk)->kobj),
|
||||
&disk_to_dev(bdev->bd_disk)->kobj);
|
||||
}
|
||||
|
||||
/* /sys/fs/btrfs/ entry */
|
||||
static struct kset *btrfs_kset;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user