new helper: iter_is_iovec()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
b1bc6d7f16
commit
777eda2c5b
|
@ -101,6 +101,11 @@ static inline size_t iov_iter_count(struct iov_iter *i)
|
||||||
return i->count;
|
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
|
* 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
|
* *not* the new size - it's upper limit for such. Passing it a value
|
||||||
|
|
|
@ -2464,7 +2464,7 @@ ssize_t generic_perform_write(struct file *file,
|
||||||
/*
|
/*
|
||||||
* Copies from kernel address space cannot fail (NFSD is a big user).
|
* 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;
|
flags |= AOP_FLAG_UNINTERRUPTIBLE;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
|
|
@ -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,
|
* 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.
|
* 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;
|
sgp = SGP_DIRTY;
|
||||||
|
|
||||||
index = *ppos >> PAGE_CACHE_SHIFT;
|
index = *ppos >> PAGE_CACHE_SHIFT;
|
||||||
|
|
Loading…
Reference in New Issue