On Fri, Apr 26, 2019 at 06:45:21PM +0800, Ming Lei wrote: > static inline enum iter_type iov_iter_type(const struct iov_iter *i) > { > - return i->type & ~(READ | WRITE); > + return i->type & ~(READ | WRITE | ITER_BVEC_FLAG_NO_REF); The way we handle i->type is a complete mess. I think we need three different values: .rw (can be READ or WRITE) .type (ITER_IOVEC, ITER_KVEC, ITER_BVEC, ITER_PIPE, ITER_DISCARD) .flags (ITER_BVEC_FLAG_NO_REF) .type seems to be worth an u8 on its own. And at least as long as we have space rw and flags should probably be their own u8 aswell, although we could use accessors to fold them.