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
a096638b
Commit
a096638b
authored
Sep 08, 2003
by
Andries E. Brouwer
Committed by
Linus Torvalds
Sep 08, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sparse fix for proc/generic
parent
0dac851a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
fs/proc/generic.c
fs/proc/generic.c
+12
-11
No files found.
fs/proc/generic.c
View file @
a096638b
...
...
@@ -18,13 +18,13 @@
#include <asm/uaccess.h>
#include <asm/bitops.h>
static
ssize_t
proc_file_read
(
struct
file
*
file
,
char
*
buf
,
static
ssize_t
proc_file_read
(
struct
file
*
file
,
char
__user
*
buf
,
size_t
nbytes
,
loff_t
*
ppos
);
static
ssize_t
proc_file_write
(
struct
file
*
file
,
const
char
*
buffer
,
static
ssize_t
proc_file_write
(
struct
file
*
file
,
const
char
__user
*
buffer
,
size_t
count
,
loff_t
*
ppos
);
static
loff_t
proc_file_lseek
(
struct
file
*
,
loff_t
,
int
);
int
proc_match
(
int
len
,
const
char
*
name
,
struct
proc_dir_entry
*
de
)
int
proc_match
(
int
len
,
const
char
*
name
,
struct
proc_dir_entry
*
de
)
{
if
(
de
->
namelen
!=
len
)
return
0
;
...
...
@@ -45,7 +45,8 @@ static struct file_operations proc_file_operations = {
#define PROC_BLOCK_SIZE (PAGE_SIZE - 1024)
static
ssize_t
proc_file_read
(
struct
file
*
file
,
char
*
buf
,
size_t
nbytes
,
loff_t
*
ppos
)
proc_file_read
(
struct
file
*
file
,
char
__user
*
buf
,
size_t
nbytes
,
loff_t
*
ppos
)
{
struct
inode
*
inode
=
file
->
f_dentry
->
d_inode
;
char
*
page
;
...
...
@@ -59,8 +60,7 @@ proc_file_read(struct file * file, char * buf, size_t nbytes, loff_t *ppos)
if
(
!
(
page
=
(
char
*
)
__get_free_page
(
GFP_KERNEL
)))
return
-
ENOMEM
;
while
((
nbytes
>
0
)
&&
!
eof
)
{
while
((
nbytes
>
0
)
&&
!
eof
)
{
count
=
MIN
(
PROC_BLOCK_SIZE
,
nbytes
);
start
=
NULL
;
...
...
@@ -184,7 +184,7 @@ proc_file_read(struct file * file, char * buf, size_t nbytes, loff_t *ppos)
}
static
ssize_t
proc_file_write
(
struct
file
*
file
,
const
char
*
buffer
,
proc_file_write
(
struct
file
*
file
,
const
char
__user
*
buffer
,
size_t
count
,
loff_t
*
ppos
)
{
struct
inode
*
inode
=
file
->
f_dentry
->
d_inode
;
...
...
@@ -201,7 +201,7 @@ proc_file_write(struct file * file, const char * buffer,
static
loff_t
proc_file_lseek
(
struct
file
*
file
,
loff_t
offset
,
int
orig
)
proc_file_lseek
(
struct
file
*
file
,
loff_t
offset
,
int
orig
)
{
lock_kernel
();
...
...
@@ -299,15 +299,16 @@ static int make_inode_number(void)
return
i
;
}
static
int
proc_readlink
(
struct
dentry
*
dentry
,
char
*
buffer
,
int
buflen
)
static
int
proc_readlink
(
struct
dentry
*
dentry
,
char
__user
*
buffer
,
int
buflen
)
{
char
*
s
=
PDE
(
dentry
->
d_inode
)
->
data
;
char
*
s
=
PDE
(
dentry
->
d_inode
)
->
data
;
return
vfs_readlink
(
dentry
,
buffer
,
buflen
,
s
);
}
static
int
proc_follow_link
(
struct
dentry
*
dentry
,
struct
nameidata
*
nd
)
{
char
*
s
=
PDE
(
dentry
->
d_inode
)
->
data
;
char
*
s
=
PDE
(
dentry
->
d_inode
)
->
data
;
return
vfs_follow_link
(
nd
,
s
);
}
...
...
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