Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
4c150f6c
Commit
4c150f6c
authored
Oct 04, 2008
by
Alexey Dobriyan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proc: move /proc/stram to m68k-specific code
Signed-off-by:
Alexey Dobriyan
<
adobriyan@gmail.com
>
parent
813dcf7a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
19 deletions
+22
-19
arch/m68k/atari/stram.c
arch/m68k/atari/stram.c
+22
-6
fs/proc/proc_misc.c
fs/proc/proc_misc.c
+0
-13
No files found.
arch/m68k/atari/stram.c
View file @
4c150f6c
...
...
@@ -42,6 +42,7 @@
/* abbrev for the && above... */
#define DO_PROC
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#endif
/*
...
...
@@ -323,19 +324,16 @@ static int remove_region( BLOCK *block )
#ifdef DO_PROC
#define PRINT_PROC(fmt,args...)
len += sprintf( buf+len
, fmt, ##args )
#define PRINT_PROC(fmt,args...)
seq_printf( m
, fmt, ##args )
int
get_stram_list
(
char
*
buf
)
static
int
stram_proc_show
(
struct
seq_file
*
m
,
void
*
v
)
{
int
len
=
0
;
BLOCK
*
p
;
PRINT_PROC
(
"Total ST-RAM: %8u kB
\n
"
,
(
stram_end
-
stram_start
)
>>
10
);
PRINT_PROC
(
"Allocated regions:
\n
"
);
for
(
p
=
alloc_list
;
p
;
p
=
p
->
next
)
{
if
(
len
+
50
>=
PAGE_SIZE
)
break
;
PRINT_PROC
(
"0x%08lx-0x%08lx: %s ("
,
virt_to_phys
(
p
->
start
),
virt_to_phys
(
p
->
start
+
p
->
size
-
1
),
...
...
@@ -346,9 +344,27 @@ int get_stram_list( char *buf )
PRINT_PROC
(
"??)
\n
"
);
}
return
(
len
);
return
0
;
}
static
int
stram_proc_open
(
struct
inode
*
inode
,
struct
file
*
file
)
{
return
single_open
(
file
,
stram_proc_show
,
NULL
);
}
static
const
struct
file_operations
stram_proc_fops
=
{
.
open
=
stram_proc_open
,
.
read
=
seq_read
,
.
llseek
=
seq_lseek
,
.
release
=
single_release
,
};
static
int
__init
proc_stram_init
(
void
)
{
proc_create
(
"stram"
,
0
,
NULL
,
&
stram_proc_fops
);
return
0
;
}
module_init
(
proc_stram_init
);
#endif
...
...
fs/proc/proc_misc.c
View file @
4c150f6c
...
...
@@ -63,7 +63,6 @@
* have a way to deal with that gracefully. Right now I used straightforward
* wrappers, but this needs further analysis wrt potential overflows.
*/
extern
int
get_stram_list
(
char
*
);
extern
int
get_exec_domain_list
(
char
*
);
static
int
proc_calc_metrics
(
char
*
page
,
char
**
start
,
off_t
off
,
...
...
@@ -197,15 +196,6 @@ static const struct file_operations proc_vmstat_file_operations = {
.
release
=
seq_release
,
};
#ifdef CONFIG_STRAM_PROC
static
int
stram_read_proc
(
char
*
page
,
char
**
start
,
off_t
off
,
int
count
,
int
*
eof
,
void
*
data
)
{
int
len
=
get_stram_list
(
page
);
return
proc_calc_metrics
(
page
,
start
,
off
,
count
,
eof
,
len
);
}
#endif
#ifdef CONFIG_BLOCK
static
int
partitions_open
(
struct
inode
*
inode
,
struct
file
*
file
)
{
...
...
@@ -658,9 +648,6 @@ void __init proc_misc_init(void)
char
*
name
;
int
(
*
read_proc
)(
char
*
,
char
**
,
off_t
,
int
,
int
*
,
void
*
);
}
*
p
,
simple_ones
[]
=
{
#ifdef CONFIG_STRAM_PROC
{
"stram"
,
stram_read_proc
},
#endif
{
"filesystems"
,
filesystems_read_proc
},
{
"cmdline"
,
cmdline_read_proc
},
{
"execdomains"
,
execdomains_read_proc
},
...
...
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