iov_iter: Derive user-backedness from the iterator type
authorDavid Howells <dhowells@redhat.com>
Mon, 25 Sep 2023 12:03:03 +0000 (13:03 +0100)
committerChristian Brauner <brauner@kernel.org>
Mon, 25 Sep 2023 12:30:28 +0000 (14:30 +0200)
commitf1b4cb650b9a0eeba206d8f069fcdc532bfbcd74
treef41e8cb629e39e1250c8b507d1c4380c4d8a8908
parent7d9e44a6ad8a22135e6308d330da29271f41a98a
iov_iter: Derive user-backedness from the iterator type

Use the iterator type to determine whether an iterator is user-backed or
not rather than using a special flag for it.  Now that ITER_UBUF and
ITER_IOVEC are 0 and 1, they can be checked with a single comparison.

Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/r/20230925120309.1731676-7-dhowells@redhat.com
cc: Alexander Viro <viro@zeniv.linux.org.uk>
cc: Jens Axboe <axboe@kernel.dk>
cc: Christoph Hellwig <hch@lst.de>
cc: Christian Brauner <christian@brauner.io>
cc: Matthew Wilcox <willy@infradead.org>
cc: Linus Torvalds <torvalds@linux-foundation.org>
cc: David Laight <David.Laight@ACULAB.COM>
cc: linux-block@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
cc: linux-mm@kvack.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
include/linux/uio.h
lib/iov_iter.c