提交 bd8e0ff9 编写于 作者: O Omar Sandoval 提交者: Al Viro

new helper: iov_iter_rw()

Get either READ or WRITE out of iter->type.
Signed-off-by: NOmar Sandoval <osandov@osandov.com>
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 84363182
......@@ -111,6 +111,14 @@ static inline bool iter_is_iovec(struct iov_iter *i)
return !(i->type & (ITER_BVEC | ITER_KVEC));
}
/*
* Get one of READ or WRITE out of iter->type without any other flags OR'd in
* with it.
*
* The ?: is just for type safety.
*/
#define iov_iter_rw(i) ((0 ? (struct iov_iter *)0 : (i))->type & RW_MASK)
/*
* 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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册