Commit 777eda2c5b84d6f3543f4aecbf4cd1f29b222a81

Authored by Al Viro
1 parent b1bc6d7f16

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

... ... @@ -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
... ... @@ -2464,7 +2464,7 @@
2464 2464 /*
2465 2465 * Copies from kernel address space cannot fail (NFSD is a big user).
2466 2466 */
2467   - if (segment_eq(get_fs(), KERNEL_DS))
  2467 + if (!iter_is_iovec(i))
2468 2468 flags |= AOP_FLAG_UNINTERRUPTIBLE;
2469 2469  
2470 2470 do {
... ... @@ -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;