David pointed out that gup_fast() does exactly what the new
raw_seqcount_try_begin() does -- use it.
Suggested-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
return 0;
if (gup_flags & FOLL_PIN) {
- seq = raw_read_seqcount(¤t->mm->write_protect_seq);
- if (seq & 1)
+ if (!raw_seqcount_try_begin(¤t->mm->write_protect_seq, seq))
return 0;
}