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
777eda2c
Commit
777eda2c
authored
Dec 17, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new helper: iter_is_iovec()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
b1bc6d7f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
2 deletions
+7
-2
include/linux/uio.h
include/linux/uio.h
+5
-0
mm/filemap.c
mm/filemap.c
+1
-1
mm/shmem.c
mm/shmem.c
+1
-1
No files found.
include/linux/uio.h
View file @
777eda2c
...
...
@@ -101,6 +101,11 @@ static inline size_t iov_iter_count(struct iov_iter *i)
return
i
->
count
;
}
static
inline
bool
iter_is_iovec
(
struct
iov_iter
*
i
)
{
return
!
(
i
->
type
&
(
ITER_BVEC
|
ITER_KVEC
));
}
/*
* Cap the iov_iter by given limit; note that the second argument is
* *not* the new size - it's upper limit for such. Passing it a value
...
...
mm/filemap.c
View file @
777eda2c
...
...
@@ -2464,7 +2464,7 @@ ssize_t generic_perform_write(struct file *file,
/*
* Copies from kernel address space cannot fail (NFSD is a big user).
*/
if
(
segment_eq
(
get_fs
(),
KERNEL_DS
))
if
(
!
iter_is_iovec
(
i
))
flags
|=
AOP_FLAG_UNINTERRUPTIBLE
;
do
{
...
...
mm/shmem.c
View file @
777eda2c
...
...
@@ -1536,7 +1536,7 @@ static ssize_t shmem_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
* holes of a sparse file, we actually need to allocate those pages,
* and even mark them dirty, so it cannot exceed the max_blocks limit.
*/
if
(
segment_eq
(
get_fs
(),
KERNEL_DS
))
if
(
!
iter_is_iovec
(
to
))
sgp
=
SGP_DIRTY
;
index
=
*
ppos
>>
PAGE_CACHE_SHIFT
;
...
...
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