]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - include/linux/blkdev.h
blk-mq: Remove generation seqeunce
[linux.git] / include / linux / blkdev.h
index f3999719f8280d2444aea07bffb758c0b6e7f40a..a1c05e85a44340b71ebd62f6dc6ea563cc2c8a9a 100644 (file)
@@ -125,15 +125,22 @@ typedef __u32 __bitwise req_flags_t;
 #define RQF_SPECIAL_PAYLOAD    ((__force req_flags_t)(1 << 18))
 /* The per-zone write lock is held for this request */
 #define RQF_ZONE_WRITE_LOCKED  ((__force req_flags_t)(1 << 19))
-/* timeout is expired */
-#define RQF_MQ_TIMEOUT_EXPIRED ((__force req_flags_t)(1 << 20))
 /* already slept for hybrid poll */
-#define RQF_MQ_POLL_SLEPT      ((__force req_flags_t)(1 << 21))
+#define RQF_MQ_POLL_SLEPT      ((__force req_flags_t)(1 << 20))
 
 /* flags that prevent us from merging requests: */
 #define RQF_NOMERGE_FLAGS \
        (RQF_STARTED | RQF_SOFTBARRIER | RQF_FLUSH_SEQ | RQF_SPECIAL_PAYLOAD)
 
+/*
+ * Request state for blk-mq.
+ */
+enum mq_rq_state {
+       MQ_RQ_IDLE              = 0,
+       MQ_RQ_IN_FLIGHT         = 1,
+       MQ_RQ_COMPLETE          = 2,
+};
+
 /*
  * Try to put the fields that are referenced together in the same cacheline.
  *
@@ -236,26 +243,8 @@ struct request {
 
        unsigned int extra_len; /* length of alignment and padding */
 
-       /*
-        * On blk-mq, the lower bits of ->gstate (generation number and
-        * state) carry the MQ_RQ_* state value and the upper bits the
-        * generation number which is monotonically incremented and used to
-        * distinguish the reuse instances.
-        *
-        * ->gstate_seq allows updates to ->gstate and other fields
-        * (currently ->deadline) during request start to be read
-        * atomically from the timeout path, so that it can operate on a
-        * coherent set of information.
-        */
-       seqcount_t gstate_seq;
-       u64 gstate;
-
-       /*
-        * ->aborted_gstate is used by the timeout to claim a specific
-        * recycle instance of this request.  See blk_mq_timeout_work().
-        */
-       struct u64_stats_sync aborted_gstate_sync;
-       u64 aborted_gstate;
+       enum mq_rq_state state;
+       refcount_t ref;
 
        /* access through blk_rq_set_deadline, blk_rq_deadline */
        unsigned long __deadline;