mm/slab: Sharing s_next and s_stop between slab and slub
This patch shares s_next and s_stop between slab and slub. Acked-by: Christoph Lameter <cl@linux.com> Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
parent
0fa8103be4
commit
e25839f679
3 changed files with 5 additions and 12 deletions
10
mm/slab.c
10
mm/slab.c
|
@ -4438,16 +4438,6 @@ static int leaks_show(struct seq_file *m, void *p)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *s_next(struct seq_file *m, void *p, loff_t *pos)
|
|
||||||
{
|
|
||||||
return seq_list_next(p, &slab_caches, pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void s_stop(struct seq_file *m, void *p)
|
|
||||||
{
|
|
||||||
mutex_unlock(&slab_mutex);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct seq_operations slabstats_op = {
|
static const struct seq_operations slabstats_op = {
|
||||||
.start = leaks_start,
|
.start = leaks_start,
|
||||||
.next = s_next,
|
.next = s_next,
|
||||||
|
|
|
@ -271,3 +271,6 @@ struct kmem_cache_node {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void *s_next(struct seq_file *m, void *p, loff_t *pos);
|
||||||
|
void s_stop(struct seq_file *m, void *p);
|
||||||
|
|
|
@ -529,12 +529,12 @@ static void *s_start(struct seq_file *m, loff_t *pos)
|
||||||
return seq_list_start(&slab_caches, *pos);
|
return seq_list_start(&slab_caches, *pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *s_next(struct seq_file *m, void *p, loff_t *pos)
|
void *s_next(struct seq_file *m, void *p, loff_t *pos)
|
||||||
{
|
{
|
||||||
return seq_list_next(p, &slab_caches, pos);
|
return seq_list_next(p, &slab_caches, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void s_stop(struct seq_file *m, void *p)
|
void s_stop(struct seq_file *m, void *p)
|
||||||
{
|
{
|
||||||
mutex_unlock(&slab_mutex);
|
mutex_unlock(&slab_mutex);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue