aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slab.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2008-10-05 18:42:17 -0400
committerAlexey Dobriyan <adobriyan@gmail.com>2008-10-23 07:20:06 -0400
commit7b3c3a50a3e0ea46815150d420fa276ac254572b (patch)
treea49118d99ae5bac99b660d8a44c20df2b15a7037 /mm/slab.c
parenta0ec95a8e69792e4ad642daac037c9b01ea3e2cd (diff)
proc: move /proc/slabinfo boilerplate to mm/slub.c, mm/slab.c
Lose dummy ->write hook in case of SLUB, it's possible now. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Diffstat (limited to 'mm/slab.c')
-rw-r--r--mm/slab.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/mm/slab.c b/mm/slab.c
index d53ac9c26ab7..09187517f9dc 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -4259,7 +4259,7 @@ static int s_show(struct seq_file *m, void *p)
4259 * + further values on SMP and with statistics enabled 4259 * + further values on SMP and with statistics enabled
4260 */ 4260 */
4261 4261
4262const struct seq_operations slabinfo_op = { 4262static const struct seq_operations slabinfo_op = {
4263 .start = s_start, 4263 .start = s_start,
4264 .next = s_next, 4264 .next = s_next,
4265 .stop = s_stop, 4265 .stop = s_stop,
@@ -4316,6 +4316,19 @@ ssize_t slabinfo_write(struct file *file, const char __user * buffer,
4316 return res; 4316 return res;
4317} 4317}
4318 4318
4319static int slabinfo_open(struct inode *inode, struct file *file)
4320{
4321 return seq_open(file, &slabinfo_op);
4322}
4323
4324static const struct file_operations proc_slabinfo_operations = {
4325 .open = slabinfo_open,
4326 .read = seq_read,
4327 .write = slabinfo_write,
4328 .llseek = seq_lseek,
4329 .release = seq_release,
4330};
4331
4319#ifdef CONFIG_DEBUG_SLAB_LEAK 4332#ifdef CONFIG_DEBUG_SLAB_LEAK
4320 4333
4321static void *leaks_start(struct seq_file *m, loff_t *pos) 4334static void *leaks_start(struct seq_file *m, loff_t *pos)
@@ -4478,6 +4491,7 @@ static const struct file_operations proc_slabstats_operations = {
4478 4491
4479static int __init slab_proc_init(void) 4492static int __init slab_proc_init(void)
4480{ 4493{
4494 proc_create("slabinfo",S_IWUSR|S_IRUGO,NULL,&proc_slabinfo_operations);
4481#ifdef CONFIG_DEBUG_SLAB_LEAK 4495#ifdef CONFIG_DEBUG_SLAB_LEAK
4482 proc_create("slab_allocators", 0, NULL, &proc_slabstats_operations); 4496 proc_create("slab_allocators", 0, NULL, &proc_slabstats_operations);
4483#endif 4497#endif