Skip to content

Commit

Permalink
mm/slab: Sharing s_next and s_stop between slab and slub
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wanpeng Li authored and Pekka Enberg committed Jul 7, 2013
1 parent 0fa8103 commit e25839f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
10 changes: 0 additions & 10 deletions mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -4438,16 +4438,6 @@ static int leaks_show(struct seq_file *m, void *p)
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 = {
.start = leaks_start,
.next = s_next,
Expand Down
3 changes: 3 additions & 0 deletions mm/slab.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,6 @@ struct kmem_cache_node {
#endif

};

void *s_next(struct seq_file *m, void *p, loff_t *pos);
void s_stop(struct seq_file *m, void *p);
4 changes: 2 additions & 2 deletions mm/slab_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,12 +529,12 @@ static void *s_start(struct seq_file *m, loff_t *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);
}

static void s_stop(struct seq_file *m, void *p)
void s_stop(struct seq_file *m, void *p)
{
mutex_unlock(&slab_mutex);
}
Expand Down

0 comments on commit e25839f

Please sign in to comment.