Lines Matching full:request
22 typedef enum rq_end_io_ret (rq_end_io_fn)(struct request *, blk_status_t);
25 * request flags */
32 /* request for flush sequence */
48 /* runtime pm request */
57 /* The per-zone write lock is held for this request */
83 struct request { struct
105 struct request *rq_next; argument
110 /* Time that the first bio started allocating this request. */ argument
113 /* Time that this request was allocated for this IO. */ argument
153 * request reaches the dispatch list. The ipi_list is only used argument
154 * to queue the request for softirq completion, which is long
155 * after the request has been unhashed (and even removed from
206 static inline enum req_op req_op(const struct request *req) in req_op() argument
211 static inline bool blk_rq_is_passthrough(struct request *rq) in blk_rq_is_passthrough()
216 static inline unsigned short req_get_ioprio(struct request *req) in req_get_ioprio()
233 struct request *__req = NULL; \
243 struct request *__req = NULL; \
257 #define rq_list_empty(list) ((list) == (struct request *) NULL)
260 * rq_list_move() - move a struct request from one list to another
263 * @rq: The request to move
264 * @prev: The request preceding @rq in @src (NULL if @rq is the head)
266 static inline void rq_list_move(struct request **src, struct request **dst, in rq_list_move()
267 struct request *rq, struct request *prev) in rq_list_move()
280 * @BLK_EH_RESET_TIMER: Reset the request timer and continue waiting for the
281 * request to complete.
335 * @sched_data: Pointer owned by the IO scheduler attached to a request
340 * @queue: Pointer to the request queue that owns this hardware context.
354 * pending request in that software queue.
393 * assigned when a request is dispatched from a hardware queue.
398 * scheduler associated with a request queue, a tag is assigned when
399 * that request is allocated. Else, this member is not used.
415 * shared across request queues.
419 /** @cpuhp_online: List to store request if CPU is going to die */
421 /** @cpuhp_dead: List to store request if some CPU die. */
475 * struct blk_mq_tag_set - tag set that can be shared between request queues
489 * @cmd_size: Number of additional bytes to allocate per request. The block
492 * @timeout: Request processing timeout in jiffies.
502 * @tag_list: List of the request queues that use this tag set. See also
527 * struct blk_mq_queue_data - Data about a request inserted in a queue
529 * @rq: Request pointer.
530 * @last: If it is the last request in the queue.
533 struct request *rq;
537 typedef bool (busy_tag_iter_fn)(struct request *, void *);
545 * @queue_rq: Queue a new request from block IO.
554 * purpose of kicking the hardware (which the last request otherwise
561 * that each request belongs to the same queue. If the driver doesn't
565 void (*queue_rqs)(struct request **rqlist);
568 * @get_budget: Reserve budget before queue request, once .queue_rq is
583 void (*set_rq_budget_token)(struct request *, int);
587 int (*get_rq_budget_token)(struct request *);
590 * @timeout: Called on request timeout.
592 enum blk_eh_timer_return (*timeout)(struct request *);
600 * @complete: Mark the request as complete.
602 void (*complete)(struct request *);
620 * flush request.
622 int (*init_request)(struct blk_mq_tag_set *set, struct request *,
627 void (*exit_request)(struct blk_mq_tag_set *set, struct request *,
631 * @cleanup_rq: Called before freeing one request which isn't completed
634 void (*cleanup_rq)(struct request *);
650 * information about a request.
652 void (*show_rq)(struct seq_file *m, struct request *rq);
717 void blk_mq_free_request(struct request *rq);
730 struct request *blk_mq_alloc_request(struct request_queue *q, blk_opf_t opf,
732 struct request *blk_mq_alloc_request_hctx(struct request_queue *q,
748 struct request **rqs;
749 struct request **static_rqs;
753 * used to clear request reference in rqs[] before freeing one
754 * request pool
759 static inline struct request *blk_mq_tag_to_rq(struct blk_mq_tags *tags, in blk_mq_tag_to_rq()
775 u32 blk_mq_unique_tag(struct request *rq);
788 * blk_mq_rq_state() - read the current MQ_RQ_* state of a request
789 * @rq: target request.
791 static inline enum mq_rq_state blk_mq_rq_state(struct request *rq) in blk_mq_rq_state()
796 static inline int blk_mq_request_started(struct request *rq) in blk_mq_request_started()
801 static inline int blk_mq_request_completed(struct request *rq) in blk_mq_request_completed()
808 * Set the state to complete when completing a request from inside ->queue_rq.
810 * need access to the request are called on failure, e.g. by nvme for
813 static inline void blk_mq_set_request_complete(struct request *rq) in blk_mq_set_request_complete()
819 * Complete the request directly instead of deferring it to softirq or
822 static inline void blk_mq_complete_request_direct(struct request *rq, in blk_mq_complete_request_direct()
823 void (*complete)(struct request *rq)) in blk_mq_complete_request_direct()
829 void blk_mq_start_request(struct request *rq);
830 void blk_mq_end_request(struct request *rq, blk_status_t error);
831 void __blk_mq_end_request(struct request *rq, blk_status_t error);
838 static inline bool blk_mq_need_time_stamp(struct request *rq) in blk_mq_need_time_stamp()
843 static inline bool blk_mq_is_reserved_rq(struct request *rq) in blk_mq_is_reserved_rq()
852 static inline bool blk_mq_add_to_batch(struct request *req, in blk_mq_add_to_batch()
869 void blk_mq_requeue_request(struct request *rq, bool kick_requeue_list);
872 void blk_mq_complete_request(struct request *rq);
873 bool blk_mq_complete_request_remote(struct request *rq);
902 unsigned int blk_mq_rq_cpu(struct request *rq);
914 * blk_mq_rq_from_pdu - cast a PDU to a request
917 * Return: request
919 * Driver command data is immediately after the request. So subtract request
920 * size to get back to the original request.
922 static inline struct request *blk_mq_rq_from_pdu(void *pdu) in blk_mq_rq_from_pdu()
924 return pdu - sizeof(struct request); in blk_mq_rq_from_pdu()
928 * blk_mq_rq_to_pdu - cast a request to a PDU
929 * @rq: the request to be casted
933 * Driver command data is immediately after the request. So add request to get
936 static inline void *blk_mq_rq_to_pdu(struct request *rq) in blk_mq_rq_to_pdu()
948 static inline void blk_mq_cleanup_rq(struct request *rq) in blk_mq_cleanup_rq()
954 static inline void blk_rq_bio_prep(struct request *rq, struct bio *bio, in blk_rq_bio_prep()
966 static inline bool rq_is_sync(struct request *rq) in rq_is_sync()
971 void blk_rq_init(struct request_queue *q, struct request *rq);
972 int blk_rq_prep_clone(struct request *rq, struct request *rq_src,
975 void blk_rq_unprep_clone(struct request *rq);
976 blk_status_t blk_insert_cloned_request(struct request *rq);
987 int blk_rq_map_user(struct request_queue *, struct request *,
989 int blk_rq_map_user_io(struct request *, struct rq_map_data *,
991 int blk_rq_map_user_iov(struct request_queue *, struct request *,
994 int blk_rq_map_kern(struct request_queue *, struct request *, void *,
996 int blk_rq_append_bio(struct request *rq, struct bio *bio);
997 void blk_execute_rq_nowait(struct request *rq, bool at_head);
998 blk_status_t blk_execute_rq(struct request *rq, bool at_head);
999 bool blk_rq_is_poll(struct request *rq);
1024 * blk_rq_bytes() : bytes left in the entire request
1026 * blk_rq_sectors() : sectors left in the entire request
1028 * blk_rq_stats_sectors() : sectors of the entire request used for stats
1030 static inline sector_t blk_rq_pos(const struct request *rq) in blk_rq_pos()
1035 static inline unsigned int blk_rq_bytes(const struct request *rq) in blk_rq_bytes()
1040 static inline int blk_rq_cur_bytes(const struct request *rq) in blk_rq_cur_bytes()
1049 static inline unsigned int blk_rq_sectors(const struct request *rq) in blk_rq_sectors()
1054 static inline unsigned int blk_rq_cur_sectors(const struct request *rq) in blk_rq_cur_sectors()
1059 static inline unsigned int blk_rq_stats_sectors(const struct request *rq) in blk_rq_stats_sectors()
1066 * is different from the size of the request. Any driver that supports such
1070 static inline unsigned int blk_rq_payload_bytes(struct request *rq) in blk_rq_payload_bytes()
1078 * Return the first full biovec in the request. The caller needs to check that
1081 static inline struct bio_vec req_bvec(struct request *rq) in req_bvec()
1088 static inline unsigned int blk_rq_count_bios(struct request *rq) in blk_rq_count_bios()
1099 void blk_steal_bios(struct bio_list *list, struct request *rq);
1102 * Request completion related functions.
1105 * the request without completing it.
1107 bool blk_update_request(struct request *rq, blk_status_t error,
1109 void blk_abort_request(struct request *);
1120 static inline unsigned short blk_rq_nr_phys_segments(struct request *rq) in blk_rq_nr_phys_segments()
1129 * Each discard bio merged into a request is counted as one segment.
1131 static inline unsigned short blk_rq_nr_discard_segments(struct request *rq) in blk_rq_nr_discard_segments()
1136 int __blk_rq_map_sg(struct request_queue *q, struct request *rq,
1138 static inline int blk_rq_map_sg(struct request_queue *q, struct request *rq, in blk_rq_map_sg()
1145 void blk_dump_rq_flags(struct request *, char *);
1148 static inline unsigned int blk_rq_zone_no(struct request *rq) in blk_rq_zone_no()
1153 static inline unsigned int blk_rq_zone_is_seq(struct request *rq) in blk_rq_zone_is_seq()
1158 bool blk_req_needs_zone_write_lock(struct request *rq);
1159 bool blk_req_zone_write_trylock(struct request *rq);
1160 void __blk_req_zone_write_lock(struct request *rq);
1161 void __blk_req_zone_write_unlock(struct request *rq);
1163 static inline void blk_req_zone_write_lock(struct request *rq) in blk_req_zone_write_lock()
1169 static inline void blk_req_zone_write_unlock(struct request *rq) in blk_req_zone_write_unlock()
1175 static inline bool blk_req_zone_is_write_locked(struct request *rq) in blk_req_zone_is_write_locked()
1181 static inline bool blk_req_can_dispatch_to_zone(struct request *rq) in blk_req_can_dispatch_to_zone()
1188 static inline bool blk_req_needs_zone_write_lock(struct request *rq) in blk_req_needs_zone_write_lock()
1193 static inline void blk_req_zone_write_lock(struct request *rq) in blk_req_zone_write_lock()
1197 static inline void blk_req_zone_write_unlock(struct request *rq) in blk_req_zone_write_unlock()
1200 static inline bool blk_req_zone_is_write_locked(struct request *rq) in blk_req_zone_is_write_locked()
1205 static inline bool blk_req_can_dispatch_to_zone(struct request *rq) in blk_req_can_dispatch_to_zone()