Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 117659
b: refs/heads/master
c: 7b3c3a5
h: refs/heads/master
i:
  117657: 6e734f5
  117655: 9322e5b
v: v3
  • Loading branch information
Alexey Dobriyan committed Oct 23, 2008
1 parent 2a5fbc4 commit b47faf6
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 33 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a0ec95a8e69792e4ad642daac037c9b01ea3e2cd
refs/heads/master: 7b3c3a50a3e0ea46815150d420fa276ac254572b
17 changes: 0 additions & 17 deletions trunk/fs/proc/proc_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,6 @@ static const struct file_operations proc_modules_operations = {
};
#endif

#ifdef CONFIG_SLABINFO
static int slabinfo_open(struct inode *inode, struct file *file)
{
return seq_open(file, &slabinfo_op);
}
static const struct file_operations proc_slabinfo_operations = {
.open = slabinfo_open,
.read = seq_read,
.write = slabinfo_write,
.llseek = seq_lseek,
.release = seq_release,
};
#endif

#ifdef CONFIG_MMU
static int vmalloc_open(struct inode *inode, struct file *file)
{
Expand Down Expand Up @@ -309,9 +295,6 @@ void __init proc_misc_init(void)
proc_symlink("mounts", NULL, "self/mounts");

/* And now for trickier ones */
#ifdef CONFIG_SLABINFO
proc_create("slabinfo",S_IWUSR|S_IRUGO,NULL,&proc_slabinfo_operations);
#endif
#ifdef CONFIG_MMU
proc_create("vmallocinfo", S_IRUSR, NULL, &proc_vmalloc_operations);
#endif
Expand Down
5 changes: 0 additions & 5 deletions trunk/include/linux/slab.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,4 @@ static inline void *kzalloc_node(size_t size, gfp_t flags, int node)
return kmalloc_node(size, flags | __GFP_ZERO, node);
}

#ifdef CONFIG_SLABINFO
extern const struct seq_operations slabinfo_op;
ssize_t slabinfo_write(struct file *, const char __user *, size_t, loff_t *);
#endif

#endif /* _LINUX_SLAB_H */
16 changes: 15 additions & 1 deletion trunk/mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -4259,7 +4259,7 @@ static int s_show(struct seq_file *m, void *p)
* + further values on SMP and with statistics enabled
*/

const struct seq_operations slabinfo_op = {
static const struct seq_operations slabinfo_op = {
.start = s_start,
.next = s_next,
.stop = s_stop,
Expand Down Expand Up @@ -4316,6 +4316,19 @@ ssize_t slabinfo_write(struct file *file, const char __user * buffer,
return res;
}

static int slabinfo_open(struct inode *inode, struct file *file)
{
return seq_open(file, &slabinfo_op);
}

static const struct file_operations proc_slabinfo_operations = {
.open = slabinfo_open,
.read = seq_read,
.write = slabinfo_write,
.llseek = seq_lseek,
.release = seq_release,
};

#ifdef CONFIG_DEBUG_SLAB_LEAK

static void *leaks_start(struct seq_file *m, loff_t *pos)
Expand Down Expand Up @@ -4478,6 +4491,7 @@ static const struct file_operations proc_slabstats_operations = {

static int __init slab_proc_init(void)
{
proc_create("slabinfo",S_IWUSR|S_IRUGO,NULL,&proc_slabinfo_operations);
#ifdef CONFIG_DEBUG_SLAB_LEAK
proc_create("slab_allocators", 0, NULL, &proc_slabstats_operations);
#endif
Expand Down
29 changes: 20 additions & 9 deletions trunk/mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/interrupt.h>
#include <linux/bitops.h>
#include <linux/slab.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/cpu.h>
#include <linux/cpuset.h>
Expand Down Expand Up @@ -4417,14 +4418,6 @@ __initcall(slab_sysfs_init);
* The /proc/slabinfo ABI
*/
#ifdef CONFIG_SLABINFO

ssize_t slabinfo_write(struct file *file, const char __user *buffer,
size_t count, loff_t *ppos)
{
return -EINVAL;
}


static void print_slabinfo_header(struct seq_file *m)
{
seq_puts(m, "slabinfo - version: 2.1\n");
Expand Down Expand Up @@ -4492,11 +4485,29 @@ static int s_show(struct seq_file *m, void *p)
return 0;
}

const struct seq_operations slabinfo_op = {
static const struct seq_operations slabinfo_op = {
.start = s_start,
.next = s_next,
.stop = s_stop,
.show = s_show,
};

static int slabinfo_open(struct inode *inode, struct file *file)
{
return seq_open(file, &slabinfo_op);
}

static const struct file_operations proc_slabinfo_operations = {
.open = slabinfo_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};

static int __init slab_proc_init(void)
{
proc_create("slabinfo",S_IWUSR|S_IRUGO,NULL,&proc_slabinfo_operations);
return 0;
}
module_init(slab_proc_init);
#endif /* CONFIG_SLABINFO */

0 comments on commit b47faf6

Please sign in to comment.