Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 117668
b: refs/heads/master
c: 97ce5d6
h: refs/heads/master
v: v3
  • Loading branch information
Alexey Dobriyan committed Oct 23, 2008
1 parent 2529333 commit 77f8751
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 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: b5aadf7f14c1acc94956aa257e018e9de3881f41
refs/heads/master: 97ce5d6dcb07c403c0fc6001b755aacc38b5d7ff
14 changes: 13 additions & 1 deletion trunk/fs/proc/kcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@
#define ELF_CORE_EFLAGS 0
#endif

static struct proc_dir_entry *proc_root_kcore;

static int open_kcore(struct inode * inode, struct file * filp)
{
return capable(CAP_SYS_RAWIO) ? 0 : -EPERM;
}

static ssize_t read_kcore(struct file *, char __user *, size_t, loff_t *);

const struct file_operations proc_kcore_operations = {
static const struct file_operations proc_kcore_operations = {
.read = read_kcore,
.open = open_kcore,
};
Expand Down Expand Up @@ -399,3 +401,13 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)

return acc;
}

static int __init proc_kcore_init(void)
{
proc_root_kcore = proc_create("kcore", S_IRUSR, NULL, &proc_kcore_operations);
if (proc_root_kcore)
proc_root_kcore->size =
(size_t)high_memory - PAGE_OFFSET + PAGE_SIZE;
return 0;
}
module_init(proc_kcore_init);
8 changes: 0 additions & 8 deletions trunk/fs/proc/proc_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,19 +188,11 @@ static struct file_operations proc_kpageflags_operations = {
};
#endif /* CONFIG_PROC_PAGE_MONITOR */

struct proc_dir_entry *proc_root_kcore;

void __init proc_misc_init(void)
{
proc_symlink("mounts", NULL, "self/mounts");

/* And now for trickier ones */
#ifdef CONFIG_PROC_KCORE
proc_root_kcore = proc_create("kcore", S_IRUSR, NULL, &proc_kcore_operations);
if (proc_root_kcore)
proc_root_kcore->size =
(size_t)high_memory - PAGE_OFFSET + PAGE_SIZE;
#endif
#ifdef CONFIG_PROC_PAGE_MONITOR
proc_create("kpagecount", S_IRUSR, NULL, &proc_kpagecount_operations);
proc_create("kpageflags", S_IRUSR, NULL, &proc_kpageflags_operations);
Expand Down
4 changes: 0 additions & 4 deletions trunk/include/linux/proc_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@ struct vmcore {

#ifdef CONFIG_PROC_FS

extern struct proc_dir_entry *proc_root_kcore;

extern spinlock_t proc_subdir_lock;

extern void proc_root_init(void);
Expand Down Expand Up @@ -138,8 +136,6 @@ extern struct inode *proc_get_inode(struct super_block *, unsigned int, struct p
extern int proc_readdir(struct file *, void *, filldir_t);
extern struct dentry *proc_lookup(struct inode *, struct dentry *, struct nameidata *);

extern const struct file_operations proc_kcore_operations;

extern int pid_ns_prepare_proc(struct pid_namespace *ns);
extern void pid_ns_release_proc(struct pid_namespace *ns);

Expand Down

0 comments on commit 77f8751

Please sign in to comment.