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
2ec3a12a
Commit
2ec3a12a
authored
Aug 19, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cachefiles_write_page(): switch to __kernel_write()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
59482291
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
29 deletions
+21
-29
fs/cachefiles/rdwr.c
fs/cachefiles/rdwr.c
+19
-29
fs/read_write.c
fs/read_write.c
+2
-0
No files found.
fs/cachefiles/rdwr.c
View file @
2ec3a12a
...
...
@@ -880,7 +880,6 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
{
struct
cachefiles_object
*
object
;
struct
cachefiles_cache
*
cache
;
mm_segment_t
old_fs
;
struct
file
*
file
;
struct
path
path
;
loff_t
pos
,
eof
;
...
...
@@ -914,36 +913,27 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
if
(
IS_ERR
(
file
))
{
ret
=
PTR_ERR
(
file
);
}
else
{
ret
=
-
EIO
;
if
(
file
->
f_op
->
write
)
{
pos
=
(
loff_t
)
page
->
index
<<
PAGE_SHIFT
;
/* we mustn't write more data than we have, so we have
* to beware of a partial page at EOF */
eof
=
object
->
fscache
.
store_limit_l
;
len
=
PAGE_SIZE
;
if
(
eof
&
~
PAGE_MASK
)
{
ASSERTCMP
(
pos
,
<
,
eof
);
if
(
eof
-
pos
<
PAGE_SIZE
)
{
_debug
(
"cut short %llx to %llx"
,
pos
,
eof
);
len
=
eof
-
pos
;
ASSERTCMP
(
pos
+
len
,
==
,
eof
);
}
pos
=
(
loff_t
)
page
->
index
<<
PAGE_SHIFT
;
/* we mustn't write more data than we have, so we have
* to beware of a partial page at EOF */
eof
=
object
->
fscache
.
store_limit_l
;
len
=
PAGE_SIZE
;
if
(
eof
&
~
PAGE_MASK
)
{
ASSERTCMP
(
pos
,
<
,
eof
);
if
(
eof
-
pos
<
PAGE_SIZE
)
{
_debug
(
"cut short %llx to %llx"
,
pos
,
eof
);
len
=
eof
-
pos
;
ASSERTCMP
(
pos
+
len
,
==
,
eof
);
}
data
=
kmap
(
page
);
file_start_write
(
file
);
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
ret
=
file
->
f_op
->
write
(
file
,
(
const
void
__user
*
)
data
,
len
,
&
pos
);
set_fs
(
old_fs
);
kunmap
(
page
);
file_end_write
(
file
);
if
(
ret
!=
len
)
ret
=
-
EIO
;
}
data
=
kmap
(
page
);
ret
=
__kernel_write
(
file
,
data
,
len
,
&
pos
);
kunmap
(
page
);
if
(
ret
!=
len
)
ret
=
-
EIO
;
fput
(
file
);
}
...
...
fs/read_write.c
View file @
2ec3a12a
...
...
@@ -513,6 +513,8 @@ ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t
return
ret
;
}
EXPORT_SYMBOL
(
__kernel_write
);
ssize_t
vfs_write
(
struct
file
*
file
,
const
char
__user
*
buf
,
size_t
count
,
loff_t
*
pos
)
{
ssize_t
ret
;
...
...
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