Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xcap-capability-linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xcap
xcap-capability-linux
Commits
97ce5d6d
Commit
97ce5d6d
authored
Oct 06, 2008
by
Alexey Dobriyan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proc: move all /proc/kcore stuff to fs/proc/kcore.c
Signed-off-by:
Alexey Dobriyan
<
adobriyan@gmail.com
>
parent
b5aadf7f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
fs/proc/kcore.c
fs/proc/kcore.c
+13
-1
fs/proc/proc_misc.c
fs/proc/proc_misc.c
+0
-8
include/linux/proc_fs.h
include/linux/proc_fs.h
+0
-4
No files found.
fs/proc/kcore.c
View file @
97ce5d6d
...
...
@@ -27,6 +27,8 @@
#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
;
...
...
@@ -34,7 +36,7 @@ static int open_kcore(struct inode * inode, struct file * filp)
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
,
};
...
...
@@ -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
);
fs/proc/proc_misc.c
View file @
97ce5d6d
...
...
@@ -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
);
...
...
include/linux/proc_fs.h
View file @
97ce5d6d
...
...
@@ -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
);
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment