提交 708f4b52 编写于 作者: P Pavel Emelianov 提交者: Linus Torvalds

Make /proc/modules use seq_list_xxx helpers

Here there is not need even in .show callback altering.  The original code
passes list_head in *v.
Signed-off-by: NPavel Emelianov <xemul@openvz.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 46c65b71
......@@ -2232,26 +2232,13 @@ unsigned long module_kallsyms_lookup_name(const char *name)
/* Called by the /proc file system to return a list of modules. */
static void *m_start(struct seq_file *m, loff_t *pos)
{
struct list_head *i;
loff_t n = 0;
mutex_lock(&module_mutex);
list_for_each(i, &modules) {
if (n++ == *pos)
break;
}
if (i == &modules)
return NULL;
return i;
return seq_list_start(&modules, *pos);
}
static void *m_next(struct seq_file *m, void *p, loff_t *pos)
{
struct list_head *i = p;
(*pos)++;
if (i->next == &modules)
return NULL;
return i->next;
return seq_list_next(p, &modules, pos);
}
static void m_stop(struct seq_file *m, void *p)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册