[mcgrof-next:20211118-sysctl-cleanups-set-04-v2 26/36] fs/inode.c:137:60: error: macro "register_sysctl_init" passed 3 arguments, but takes just 2

From: kernel test robot
Date: Fri Nov 19 2021 - 00:42:44 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git 20211118-sysctl-cleanups-set-04-v2
head: 3110d41a56792588bd2f64621080948b0fceb6ab
commit: e5b91a6c1f321683c8f1363e70bcc5c9bf6dbd9a [26/36] fs: move inode sysctls to its own file
config: nds32-allnoconfig (attached as .config)
compiler: nds32le-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git/commit/?id=e5b91a6c1f321683c8f1363e70bcc5c9bf6dbd9a
git remote add mcgrof-next https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git
git fetch --no-tags mcgrof-next 20211118-sysctl-cleanups-set-04-v2
git checkout e5b91a6c1f321683c8f1363e70bcc5c9bf6dbd9a
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=nds32 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

fs/inode.c: In function 'init_fs_inode_sysctls':
>> fs/inode.c:137:60: error: macro "register_sysctl_init" passed 3 arguments, but takes just 2
137 | register_sysctl_init("fs", inodes_sysctls, "inodes");
| ^
In file included from include/linux/key.h:17,
from include/linux/cred.h:13,
from include/linux/sched/signal.h:10,
from include/linux/rcuwait.h:6,
from include/linux/percpu-rwsem.h:7,
from include/linux/fs.h:33,
from fs/inode.c:7:
include/linux/sysctl.h:216: note: macro "register_sysctl_init" defined here
216 | #define register_sysctl_init(path, table) __register_sysctl_init(path, table, #table)
|
>> fs/inode.c:137:9: error: 'register_sysctl_init' undeclared (first use in this function); did you mean 'register_sysctl_paths'?
137 | register_sysctl_init("fs", inodes_sysctls, "inodes");
| ^~~~~~~~~~~~~~~~~~~~
| register_sysctl_paths
fs/inode.c:137:9: note: each undeclared identifier is reported only once for each function it appears in
At top level:
fs/inode.c:117:25: warning: 'inodes_sysctls' defined but not used [-Wunused-variable]
117 | static struct ctl_table inodes_sysctls[] = {
| ^~~~~~~~~~~~~~


vim +/register_sysctl_init +137 fs/inode.c

> 7 #include <linux/fs.h>
8 #include <linux/mm.h>
9 #include <linux/backing-dev.h>
10 #include <linux/hash.h>
11 #include <linux/swap.h>
12 #include <linux/security.h>
13 #include <linux/cdev.h>
14 #include <linux/memblock.h>
15 #include <linux/fsnotify.h>
16 #include <linux/mount.h>
17 #include <linux/posix_acl.h>
18 #include <linux/prefetch.h>
19 #include <linux/buffer_head.h> /* for inode_has_buffers */
20 #include <linux/ratelimit.h>
21 #include <linux/list_lru.h>
22 #include <linux/iversion.h>
23 #include <trace/events/writeback.h>
24 #include "internal.h"
25
26 /*
27 * Inode locking rules:
28 *
29 * inode->i_lock protects:
30 * inode->i_state, inode->i_hash, __iget()
31 * Inode LRU list locks protect:
32 * inode->i_sb->s_inode_lru, inode->i_lru
33 * inode->i_sb->s_inode_list_lock protects:
34 * inode->i_sb->s_inodes, inode->i_sb_list
35 * bdi->wb.list_lock protects:
36 * bdi->wb.b_{dirty,io,more_io,dirty_time}, inode->i_io_list
37 * inode_hash_lock protects:
38 * inode_hashtable, inode->i_hash
39 *
40 * Lock ordering:
41 *
42 * inode->i_sb->s_inode_list_lock
43 * inode->i_lock
44 * Inode LRU list locks
45 *
46 * bdi->wb.list_lock
47 * inode->i_lock
48 *
49 * inode_hash_lock
50 * inode->i_sb->s_inode_list_lock
51 * inode->i_lock
52 *
53 * iunique_lock
54 * inode_hash_lock
55 */
56
57 static unsigned int i_hash_mask __read_mostly;
58 static unsigned int i_hash_shift __read_mostly;
59 static struct hlist_head *inode_hashtable __read_mostly;
60 static __cacheline_aligned_in_smp DEFINE_SPINLOCK(inode_hash_lock);
61
62 /*
63 * Empty aops. Can be used for the cases where the user does not
64 * define any of the address_space operations.
65 */
66 const struct address_space_operations empty_aops = {
67 };
68 EXPORT_SYMBOL(empty_aops);
69
70 /*
71 * Statistics gathering..
72 */
73 struct inodes_stat_t inodes_stat;
74
75 static DEFINE_PER_CPU(unsigned long, nr_inodes);
76 static DEFINE_PER_CPU(unsigned long, nr_unused);
77
78 static struct kmem_cache *inode_cachep __read_mostly;
79
80 static long get_nr_inodes(void)
81 {
82 int i;
83 long sum = 0;
84 for_each_possible_cpu(i)
85 sum += per_cpu(nr_inodes, i);
86 return sum < 0 ? 0 : sum;
87 }
88
89 static inline long get_nr_inodes_unused(void)
90 {
91 int i;
92 long sum = 0;
93 for_each_possible_cpu(i)
94 sum += per_cpu(nr_unused, i);
95 return sum < 0 ? 0 : sum;
96 }
97
98 long get_nr_dirty_inodes(void)
99 {
100 /* not actually dirty inodes, but a wild approximation */
101 long nr_dirty = get_nr_inodes() - get_nr_inodes_unused();
102 return nr_dirty > 0 ? nr_dirty : 0;
103 }
104
105 /*
106 * Handle nr_inode sysctl
107 */
108 #ifdef CONFIG_SYSCTL
109 static int proc_nr_inodes(struct ctl_table *table, int write, void *buffer,
110 size_t *lenp, loff_t *ppos)
111 {
112 inodes_stat.nr_inodes = get_nr_inodes();
113 inodes_stat.nr_unused = get_nr_inodes_unused();
114 return proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
115 }
116
117 static struct ctl_table inodes_sysctls[] = {
118 {
119 .procname = "inode-nr",
120 .data = &inodes_stat,
121 .maxlen = 2*sizeof(long),
122 .mode = 0444,
123 .proc_handler = proc_nr_inodes,
124 },
125 {
126 .procname = "inode-state",
127 .data = &inodes_stat,
128 .maxlen = 7*sizeof(long),
129 .mode = 0444,
130 .proc_handler = proc_nr_inodes,
131 },
132 { }
133 };
134
135 static int __init init_fs_inode_sysctls(void)
136 {
> 137 register_sysctl_init("fs", inodes_sysctls, "inodes");
138 return 0;
139 }
140 early_initcall(init_fs_inode_sysctls);
141 #endif
142

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip