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
639a93a5
Commit
639a93a5
authored
Apr 13, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generic_file_direct_write(): make use of iov_iter_revert()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
c63ed807
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
mm/filemap.c
mm/filemap.c
+3
-4
No files found.
mm/filemap.c
View file @
639a93a5
...
...
@@ -2704,7 +2704,6 @@ generic_file_direct_write(struct kiocb *iocb, struct iov_iter *from)
ssize_t
written
;
size_t
write_len
;
pgoff_t
end
;
struct
iov_iter
data
;
write_len
=
iov_iter_count
(
from
);
end
=
(
pos
+
write_len
-
1
)
>>
PAGE_SHIFT
;
...
...
@@ -2733,8 +2732,7 @@ generic_file_direct_write(struct kiocb *iocb, struct iov_iter *from)
}
}
data
=
*
from
;
written
=
mapping
->
a_ops
->
direct_IO
(
iocb
,
&
data
);
written
=
mapping
->
a_ops
->
direct_IO
(
iocb
,
from
);
/*
* Finally, try again to invalidate clean pages which might have been
...
...
@@ -2751,13 +2749,14 @@ generic_file_direct_write(struct kiocb *iocb, struct iov_iter *from)
if
(
written
>
0
)
{
pos
+=
written
;
iov_iter_advance
(
from
,
written
)
;
write_len
-=
written
;
if
(
pos
>
i_size_read
(
inode
)
&&
!
S_ISBLK
(
inode
->
i_mode
))
{
i_size_write
(
inode
,
pos
);
mark_inode_dirty
(
inode
);
}
iocb
->
ki_pos
=
pos
;
}
iov_iter_revert
(
from
,
write_len
-
iov_iter_count
(
from
));
out:
return
written
;
}
...
...
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