Commit 777eda2c5b84d6f3543f4aecbf4cd1f29b222a81
1 parent
b1bc6d7f16
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
new helper: iter_is_iovec()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Showing 3 changed files with 7 additions and 2 deletions Side-by-side Diff
include/linux/uio.h
... | ... | @@ -101,6 +101,11 @@ |
101 | 101 | return i->count; |
102 | 102 | } |
103 | 103 | |
104 | +static inline bool iter_is_iovec(struct iov_iter *i) | |
105 | +{ | |
106 | + return !(i->type & (ITER_BVEC | ITER_KVEC)); | |
107 | +} | |
108 | + | |
104 | 109 | /* |
105 | 110 | * Cap the iov_iter by given limit; note that the second argument is |
106 | 111 | * *not* the new size - it's upper limit for such. Passing it a value |
mm/filemap.c
mm/shmem.c
... | ... | @@ -1536,7 +1536,7 @@ |
1536 | 1536 | * holes of a sparse file, we actually need to allocate those pages, |
1537 | 1537 | * and even mark them dirty, so it cannot exceed the max_blocks limit. |
1538 | 1538 | */ |
1539 | - if (segment_eq(get_fs(), KERNEL_DS)) | |
1539 | + if (!iter_is_iovec(to)) | |
1540 | 1540 | sgp = SGP_DIRTY; |
1541 | 1541 | |
1542 | 1542 | index = *ppos >> PAGE_CACHE_SHIFT; |