This commit fixes #888. The 2 scripts run the same check, and now run
basically the same code to do it.
Tested on 4.10-rc2.
* test, and maintenance burden.
*/
#ifdef REQ_WRITE
-if (req->cmd_flags & REQ_WRITE) {
+ data.rwflag = !!(req->cmd_flags & REQ_WRITE);
+#elif defined(REQ_OP_SHIFT)
+ data.rwflag = !!((req->cmd_flags >> REQ_OP_SHIFT) == REQ_OP_WRITE);
#else
-if ((req->cmd_flags >> REQ_OP_SHIFT) == REQ_OP_WRITE) {
+ data.rwflag = !!((req->cmd_flags & REQ_OP_MASK) == REQ_OP_WRITE);
#endif
- data.rwflag = 1;
- } else {
- data.rwflag = 0;
- }
events.perf_submit(ctx, &data, sizeof(data));
start.delete(&req);
*/
#ifdef REQ_WRITE
info.rwflag = !!(req->cmd_flags & REQ_WRITE);
-#else
+#elif defined(REQ_OP_SHIFT)
info.rwflag = !!((req->cmd_flags >> REQ_OP_SHIFT) == REQ_OP_WRITE);
+#else
+ info.rwflag = !!((req->cmd_flags & REQ_OP_MASK) == REQ_OP_WRITE);
#endif
whop = whobyreq.lookup(&req);