Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

new helper: iov_iter_rw()

Get either READ or WRITE out of iter->type.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

authored by

Omar Sandoval and committed by
Al Viro
bd8e0ff9 84363182

+8
+8
include/linux/uio.h
··· 112 112 } 113 113 114 114 /* 115 + * Get one of READ or WRITE out of iter->type without any other flags OR'd in 116 + * with it. 117 + * 118 + * The ?: is just for type safety. 119 + */ 120 + #define iov_iter_rw(i) ((0 ? (struct iov_iter *)0 : (i))->type & RW_MASK) 121 + 122 + /* 115 123 * Cap the iov_iter by given limit; note that the second argument is 116 124 * *not* the new size - it's upper limit for such. Passing it a value 117 125 * greater than the amount of data in iov_iter is fine - it'll just do