forked from luck/tmp_suning_uos_patched
block: update comments to reflect REQ_FLUSH -> REQ_PREFLUSH rename
Normally I wouldn't bother with this, but in my opinion the comments are the most important part of this whole file since without them no one would have any clue how this insanity works. Signed-off-by: Omar Sandoval <osandov@fb.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
6a934bb814
commit
3140c3cfae
|
@ -1,12 +1,12 @@
|
|||
/*
|
||||
* Functions to sequence FLUSH and FUA writes.
|
||||
* Functions to sequence PREFLUSH and FUA writes.
|
||||
*
|
||||
* Copyright (C) 2011 Max Planck Institute for Gravitational Physics
|
||||
* Copyright (C) 2011 Tejun Heo <tj@kernel.org>
|
||||
*
|
||||
* This file is released under the GPLv2.
|
||||
*
|
||||
* REQ_{FLUSH|FUA} requests are decomposed to sequences consisted of three
|
||||
* REQ_{PREFLUSH|FUA} requests are decomposed to sequences consisted of three
|
||||
* optional steps - PREFLUSH, DATA and POSTFLUSH - according to the request
|
||||
* properties and hardware capability.
|
||||
*
|
||||
|
@ -16,9 +16,9 @@
|
|||
* REQ_FUA means that the data must be on non-volatile media on request
|
||||
* completion.
|
||||
*
|
||||
* If the device doesn't have writeback cache, FLUSH and FUA don't make any
|
||||
* difference. The requests are either completed immediately if there's no
|
||||
* data or executed as normal requests otherwise.
|
||||
* If the device doesn't have writeback cache, PREFLUSH and FUA don't make any
|
||||
* difference. The requests are either completed immediately if there's no data
|
||||
* or executed as normal requests otherwise.
|
||||
*
|
||||
* If the device has writeback cache and supports FUA, REQ_PREFLUSH is
|
||||
* translated to PREFLUSH but REQ_FUA is passed down directly with DATA.
|
||||
|
@ -31,7 +31,7 @@
|
|||
* fq->flush_queue[fq->flush_pending_idx]. Once certain criteria are met, a
|
||||
* REQ_OP_FLUSH is issued and the pending_idx is toggled. When the flush
|
||||
* completes, all the requests which were pending are proceeded to the next
|
||||
* step. This allows arbitrary merging of different types of FLUSH/FUA
|
||||
* step. This allows arbitrary merging of different types of PREFLUSH/FUA
|
||||
* requests.
|
||||
*
|
||||
* Currently, the following conditions are used to determine when to issue
|
||||
|
@ -47,19 +47,19 @@
|
|||
* C3. The second condition is ignored if there is a request which has
|
||||
* waited longer than FLUSH_PENDING_TIMEOUT. This is to avoid
|
||||
* starvation in the unlikely case where there are continuous stream of
|
||||
* FUA (without FLUSH) requests.
|
||||
* FUA (without PREFLUSH) requests.
|
||||
*
|
||||
* For devices which support FUA, it isn't clear whether C2 (and thus C3)
|
||||
* is beneficial.
|
||||
*
|
||||
* Note that a sequenced FLUSH/FUA request with DATA is completed twice.
|
||||
* Note that a sequenced PREFLUSH/FUA request with DATA is completed twice.
|
||||
* Once while executing DATA and again after the whole sequence is
|
||||
* complete. The first completion updates the contained bio but doesn't
|
||||
* finish it so that the bio submitter is notified only after the whole
|
||||
* sequence is complete. This is implemented by testing RQF_FLUSH_SEQ in
|
||||
* req_bio_endio().
|
||||
*
|
||||
* The above peculiarity requires that each FLUSH/FUA request has only one
|
||||
* The above peculiarity requires that each PREFLUSH/FUA request has only one
|
||||
* bio attached to it, which is guaranteed as they aren't allowed to be
|
||||
* merged in the usual way.
|
||||
*/
|
||||
|
@ -76,7 +76,7 @@
|
|||
#include "blk-mq-tag.h"
|
||||
#include "blk-mq-sched.h"
|
||||
|
||||
/* FLUSH/FUA sequences */
|
||||
/* PREFLUSH/FUA sequences */
|
||||
enum {
|
||||
REQ_FSEQ_PREFLUSH = (1 << 0), /* pre-flushing in progress */
|
||||
REQ_FSEQ_DATA = (1 << 1), /* data write in progress */
|
||||
|
@ -148,7 +148,7 @@ static bool blk_flush_queue_rq(struct request *rq, bool add_front)
|
|||
|
||||
/**
|
||||
* blk_flush_complete_seq - complete flush sequence
|
||||
* @rq: FLUSH/FUA request being sequenced
|
||||
* @rq: PREFLUSH/FUA request being sequenced
|
||||
* @fq: flush queue
|
||||
* @seq: sequences to complete (mask of %REQ_FSEQ_*, can be zero)
|
||||
* @error: whether an error occurred
|
||||
|
@ -406,7 +406,7 @@ static void mq_flush_data_end_io(struct request *rq, blk_status_t error)
|
|||
}
|
||||
|
||||
/**
|
||||
* blk_insert_flush - insert a new FLUSH/FUA request
|
||||
* blk_insert_flush - insert a new PREFLUSH/FUA request
|
||||
* @rq: request to insert
|
||||
*
|
||||
* To be called from __elv_add_request() for %ELEVATOR_INSERT_FLUSH insertions.
|
||||
|
|
Loading…
Reference in New Issue
Block a user