aboutsummaryrefslogtreecommitdiffstats
path: root/block/genhd.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/genhd.c')
-rw-r--r--block/genhd.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/block/genhd.c b/block/genhd.c
index 15f4d2b12c48..4e5e7493f676 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1005,15 +1005,28 @@ static int diskstats_show(struct seq_file *seqf, void *v)
1005 return 0; 1005 return 0;
1006} 1006}
1007 1007
1008const struct seq_operations diskstats_op = { 1008static const struct seq_operations diskstats_op = {
1009 .start = disk_seqf_start, 1009 .start = disk_seqf_start,
1010 .next = disk_seqf_next, 1010 .next = disk_seqf_next,
1011 .stop = disk_seqf_stop, 1011 .stop = disk_seqf_stop,
1012 .show = diskstats_show 1012 .show = diskstats_show
1013}; 1013};
1014 1014
1015static int diskstats_open(struct inode *inode, struct file *file)
1016{
1017 return seq_open(file, &diskstats_op);
1018}
1019
1020static const struct file_operations proc_diskstats_operations = {
1021 .open = diskstats_open,
1022 .read = seq_read,
1023 .llseek = seq_lseek,
1024 .release = seq_release,
1025};
1026
1015static int __init proc_genhd_init(void) 1027static int __init proc_genhd_init(void)
1016{ 1028{
1029 proc_create("diskstats", 0, NULL, &proc_diskstats_operations);
1017 proc_create("partitions", 0, NULL, &proc_partitions_operations); 1030 proc_create("partitions", 0, NULL, &proc_partitions_operations);
1018 return 0; 1031 return 0;
1019} 1032}