Message ID | 20210711175415.80173-3-mcroce@linux.microsoft.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | block: add a sequence number to disks | expand |
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
diff --git a/block/genhd.c b/block/genhd.c index b7fca2102aa3..3d9c9d189ff7 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -1101,8 +1101,17 @@ static void disk_release(struct device *dev) blk_put_queue(disk->queue); kfree(disk); } + +static int block_uevent(struct device *dev, struct kobj_uevent_env *env) +{ + struct gendisk *disk = dev_to_disk(dev); + + return add_uevent_var(env, "DISKSEQ=%llu", disk->diskseq); +} + struct class block_class = { .name = "block", + .dev_uevent = block_uevent, }; static char *block_devnode(struct device *dev, umode_t *mode,