summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2021-02-23 17:28:55 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-11 14:04:59 +0100
commit1bf6a186c4524e62c4e46d2c9f28a70fb45f9e8b (patch)
tree4c5d80cb3cc8c67ce9534dd8675060134cf2b6a5 /include
parente21a0a2a46c61036e460ff2986d2f08c09a6092b (diff)
downloadlinux-stable-1bf6a186c4524e62c4e46d2c9f28a70fb45f9e8b.tar.gz
linux-stable-1bf6a186c4524e62c4e46d2c9f28a70fb45f9e8b.tar.bz2
linux-stable-1bf6a186c4524e62c4e46d2c9f28a70fb45f9e8b.zip
block: genhd: add 'groups' argument to device_add_disk
commit fef912bf860e8e7e48a2bfb978a356bba743a8b7 upstream. Update device_add_disk() to take an 'groups' argument so that individual drivers can register a device with additional sysfs attributes. This avoids race condition the driver would otherwise have if these groups were to be created with sysfs_add_groups(). Signed-off-by: Martin Wilck <martin.wilck@suse.com> Signed-off-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/genhd.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index f993bc86f3ba..a488098f8638 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -402,10 +402,11 @@ static inline void free_part_info(struct hd_struct *part)
extern void part_round_stats(struct request_queue *q, int cpu, struct hd_struct *part);
/* block/genhd.c */
-extern void device_add_disk(struct device *parent, struct gendisk *disk);
+extern void device_add_disk(struct device *parent, struct gendisk *disk,
+ const struct attribute_group **groups);
static inline void add_disk(struct gendisk *disk)
{
- device_add_disk(NULL, disk);
+ device_add_disk(NULL, disk, NULL);
}
extern void device_add_disk_no_queue_reg(struct device *parent, struct gendisk *disk);
static inline void add_disk_no_queue_reg(struct gendisk *disk)