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)
...
@@ -880,7 +880,6 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
{
{
struct
cachefiles_object
*
object
;
struct
cachefiles_object
*
object
;
struct
cachefiles_cache
*
cache
;
struct
cachefiles_cache
*
cache
;
mm_segment_t
old_fs
;
struct
file
*
file
;
struct
file
*
file
;
struct
path
path
;
struct
path
path
;
loff_t
pos
,
eof
;
loff_t
pos
,
eof
;
...
@@ -914,36 +913,27 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
...
@@ -914,36 +913,27 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
if
(
IS_ERR
(
file
))
{
if
(
IS_ERR
(
file
))
{
ret
=
PTR_ERR
(
file
);
ret
=
PTR_ERR
(
file
);
}
else
{
}
else
{
ret
=
-
EIO
;
pos
=
(
loff_t
)
page
->
index
<<
PAGE_SHIFT
;
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 */
/* we mustn't write more data than we have, so we have
eof
=
object
->
fscache
.
store_limit_l
;
* to beware of a partial page at EOF */
len
=
PAGE_SIZE
;
eof
=
object
->
fscache
.
store_limit_l
;
if
(
eof
&
~
PAGE_MASK
)
{
len
=
PAGE_SIZE
;
ASSERTCMP
(
pos
,
<
,
eof
);
if
(
eof
&
~
PAGE_MASK
)
{
if
(
eof
-
pos
<
PAGE_SIZE
)
{
ASSERTCMP
(
pos
,
<
,
eof
);
_debug
(
"cut short %llx to %llx"
,
if
(
eof
-
pos
<
PAGE_SIZE
)
{
pos
,
eof
);
_debug
(
"cut short %llx to %llx"
,
len
=
eof
-
pos
;
pos
,
eof
);
ASSERTCMP
(
pos
+
len
,
==
,
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
);
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
...
@@ -513,6 +513,8 @@ ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t
return
ret
;
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
vfs_write
(
struct
file
*
file
,
const
char
__user
*
buf
,
size_t
count
,
loff_t
*
pos
)
{
{
ssize_t
ret
;
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