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
nexedi
linux
Commits
775802c0
Commit
775802c0
authored
May 08, 2020
by
Christoph Hellwig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs: remove __vfs_read
Fold it into the two callers. Signed-off-by:
Christoph Hellwig
<
hch@lst.de
>
parent
6209dd91
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
23 deletions
+21
-23
fs/read_write.c
fs/read_write.c
+21
-22
include/linux/fs.h
include/linux/fs.h
+0
-1
No files found.
fs/read_write.c
View file @
775802c0
...
...
@@ -419,17 +419,6 @@ static ssize_t new_sync_read(struct file *filp, char __user *buf, size_t len, lo
return
ret
;
}
ssize_t
__vfs_read
(
struct
file
*
file
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
pos
)
{
if
(
file
->
f_op
->
read
)
return
file
->
f_op
->
read
(
file
,
buf
,
count
,
pos
);
else
if
(
file
->
f_op
->
read_iter
)
return
new_sync_read
(
file
,
buf
,
count
,
pos
);
else
return
-
EINVAL
;
}
ssize_t
__kernel_read
(
struct
file
*
file
,
void
*
buf
,
size_t
count
,
loff_t
*
pos
)
{
mm_segment_t
old_fs
=
get_fs
();
...
...
@@ -443,7 +432,12 @@ ssize_t __kernel_read(struct file *file, void *buf, size_t count, loff_t *pos)
if
(
count
>
MAX_RW_COUNT
)
count
=
MAX_RW_COUNT
;
set_fs
(
KERNEL_DS
);
ret
=
__vfs_read
(
file
,
(
void
__user
*
)
buf
,
count
,
pos
);
if
(
file
->
f_op
->
read
)
ret
=
file
->
f_op
->
read
(
file
,
(
void
__user
*
)
buf
,
count
,
pos
);
else
if
(
file
->
f_op
->
read_iter
)
ret
=
new_sync_read
(
file
,
(
void
__user
*
)
buf
,
count
,
pos
);
else
ret
=
-
EINVAL
;
set_fs
(
old_fs
);
if
(
ret
>
0
)
{
fsnotify_access
(
file
);
...
...
@@ -476,17 +470,22 @@ ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos)
return
-
EFAULT
;
ret
=
rw_verify_area
(
READ
,
file
,
pos
,
count
);
if
(
!
ret
)
{
if
(
count
>
MAX_RW_COUNT
)
count
=
MAX_RW_COUNT
;
ret
=
__vfs_read
(
file
,
buf
,
count
,
pos
);
if
(
ret
>
0
)
{
fsnotify_access
(
file
);
add_rchar
(
current
,
ret
);
}
inc_syscr
(
current
);
}
if
(
ret
)
return
ret
;
if
(
count
>
MAX_RW_COUNT
)
count
=
MAX_RW_COUNT
;
if
(
file
->
f_op
->
read
)
ret
=
file
->
f_op
->
read
(
file
,
buf
,
count
,
pos
);
else
if
(
file
->
f_op
->
read_iter
)
ret
=
new_sync_read
(
file
,
buf
,
count
,
pos
);
else
ret
=
-
EINVAL
;
if
(
ret
>
0
)
{
fsnotify_access
(
file
);
add_rchar
(
current
,
ret
);
}
inc_syscr
(
current
);
return
ret
;
}
...
...
include/linux/fs.h
View file @
775802c0
...
...
@@ -1917,7 +1917,6 @@ ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
struct
iovec
*
fast_pointer
,
struct
iovec
**
ret_pointer
);
extern
ssize_t
__vfs_read
(
struct
file
*
,
char
__user
*
,
size_t
,
loff_t
*
);
extern
ssize_t
vfs_read
(
struct
file
*
,
char
__user
*
,
size_t
,
loff_t
*
);
extern
ssize_t
vfs_write
(
struct
file
*
,
const
char
__user
*
,
size_t
,
loff_t
*
);
extern
ssize_t
vfs_readv
(
struct
file
*
,
const
struct
iovec
__user
*
,
...
...
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