summaryrefslogtreecommitdiffstats
path: root/block/genhd.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2023-01-18 11:56:01 +0100
committerIngo Molnar <mingo@kernel.org>2023-01-18 11:56:57 +0100
commit65adf3a57c0c2e79c5c2b72a4bdcabcab9e99ec1 (patch)
treeee08845127f4cd8d6fc816fbaf0e5f6f4330bc58 /block/genhd.c
parentx86/kprobes: Use switch-case for 0xFF opcodes in prepare_emulation (diff)
parentLinux 6.2-rc4 (diff)
downloadlinux-65adf3a57c0c2e79c5c2b72a4bdcabcab9e99ec1.tar.xz
linux-65adf3a57c0c2e79c5c2b72a4bdcabcab9e99ec1.zip
Merge tag 'v6.2-rc4' into perf/core, to pick up fixes
Move from the -rc1 base to the fresher -rc4 kernel that has various fixes included, before applying a larger patchset. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'block/genhd.c')
-rw-r--r--block/genhd.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/block/genhd.c b/block/genhd.c
index ab3cbe44196f..23cf83b3331c 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1201,10 +1201,21 @@ struct class block_class = {
.dev_uevent = block_uevent,
};
+static char *block_devnode(struct device *dev, umode_t *mode,
+ kuid_t *uid, kgid_t *gid)
+{
+ struct gendisk *disk = dev_to_disk(dev);
+
+ if (disk->fops->devnode)
+ return disk->fops->devnode(disk, mode);
+ return NULL;
+}
+
const struct device_type disk_type = {
.name = "disk",
.groups = disk_attr_groups,
.release = disk_release,
+ .devnode = block_devnode,
};
#ifdef CONFIG_PROC_FS