summaryrefslogtreecommitdiffstats
path: root/mm/vmalloc.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-04-13 19:44:18 +0200
committerChristoph Hellwig <hch@lst.de>2018-05-16 07:23:35 +0200
commitfddda2b7b521185f3aa018f9559eb33b0aee53a9 (patch)
treeece18b3d82822f8eaefd8b0afa2f93307e83b253 /mm/vmalloc.c
parentproc: add a proc_create_reg helper (diff)
downloadlinux-fddda2b7b521185f3aa018f9559eb33b0aee53a9.tar.xz
linux-fddda2b7b521185f3aa018f9559eb33b0aee53a9.zip
proc: introduce proc_create_seq{,_data}
Variants of proc_create{,_data} that directly take a struct seq_operations argument and drastically reduces the boilerplate code in the callers. All trivial callers converted over. Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'mm/vmalloc.c')
-rw-r--r--mm/vmalloc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index ebff729cc956..bc43c7838778 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -2753,11 +2753,8 @@ static const struct seq_operations vmalloc_op = {
static int vmalloc_open(struct inode *inode, struct file *file)
{
- if (IS_ENABLED(CONFIG_NUMA))
- return seq_open_private(file, &vmalloc_op,
+ return seq_open_private(file, &vmalloc_op,
nr_node_ids * sizeof(unsigned int));
- else
- return seq_open(file, &vmalloc_op);
}
static const struct file_operations proc_vmalloc_operations = {
@@ -2769,7 +2766,11 @@ static const struct file_operations proc_vmalloc_operations = {
static int __init proc_vmalloc_init(void)
{
- proc_create("vmallocinfo", S_IRUSR, NULL, &proc_vmalloc_operations);
+ if (IS_ENABLED(CONFIG_NUMA))
+ proc_create("vmallocinfo", S_IRUSR, NULL,
+ &proc_vmalloc_operations);
+ else
+ proc_create_seq("vmallocinfo", S_IRUSR, NULL, &vmalloc_op);
return 0;
}
module_init(proc_vmalloc_init);