projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8436318
)
new helper: iov_iter_rw()
author
Omar Sandoval
<
[email protected]
>
Tue, 17 Mar 2015 21:04:02 +0000
(14:04 -0700)
committer
Al Viro
<
[email protected]
>
Sun, 12 Apr 2015 02:29:44 +0000
(22:29 -0400)
Get either READ or WRITE out of iter->type.
Signed-off-by: Omar Sandoval <
[email protected]
>
Signed-off-by: Al Viro <
[email protected]
>
include/linux/uio.h
patch
|
blob
|
history
diff --git
a/include/linux/uio.h
b/include/linux/uio.h
index 15f11fb9fff6feb5197f9501777e018f172dda4b..8b01e1c3c6146623759f122b72ff6b3b869a0617 100644
(file)
--- a/
include/linux/uio.h
+++ b/
include/linux/uio.h
@@
-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