summaryrefslogtreecommitdiff
path: root/fs/btrfs/sysfs.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2019-08-01 19:50:16 +0300
committerDavid Sterba <dsterba@suse.com>2019-09-09 15:59:07 +0300
commit5b28692e0c4ffb7266d359f0d54155156cdfe0a2 (patch)
tree317a0b91c521c47587459e9dac1afbf3a6b2aefa /fs/btrfs/sysfs.c
parentf10152bcc962cae6e78ae4eecfa22270f481c0ff (diff)
downloadlinux-5b28692e0c4ffb7266d359f0d54155156cdfe0a2.tar.xz
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>
Diffstat (limited to 'fs/btrfs/sysfs.c')
-rw-r--r--fs/btrfs/sysfs.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index c7c29e5b38a0..5562ce1f7090 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -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;