aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/block
diff options
context:
space:
mode:
authorMike Christie <mchristi@redhat.com>2016-06-05 15:32:25 -0400
committerJens Axboe <axboe@fb.com>2016-06-07 15:41:38 -0400
commit28a8f0d317bf225ff15008f5dd66ae16242dd843 (patch)
tree4ed24aee241907a3612a61f8cc634acd10989c21 /Documentation/block
parenta418090aa88b9b531ac1f504d6bb8c0e9b04ccb7 (diff)
block, drivers, fs: rename REQ_FLUSH to REQ_PREFLUSH
To avoid confusion between REQ_OP_FLUSH, which is handled by request_fn drivers, and upper layers requesting the block layer perform a flush sequence along with possibly a WRITE, this patch renames REQ_FLUSH to REQ_PREFLUSH. Signed-off-by: Mike Christie <mchristi@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'Documentation/block')
-rw-r--r--Documentation/block/writeback_cache_control.txt22
1 files changed, 11 insertions, 11 deletions
diff --git a/Documentation/block/writeback_cache_control.txt b/Documentation/block/writeback_cache_control.txt
index da70bdacd503..8a6bdada5f6b 100644
--- a/Documentation/block/writeback_cache_control.txt
+++ b/Documentation/block/writeback_cache_control.txt
@@ -20,11 +20,11 @@ a forced cache flush, and the Force Unit Access (FUA) flag for requests.
20Explicit cache flushes 20Explicit cache flushes
21---------------------- 21----------------------
22 22
23The REQ_FLUSH flag can be OR ed into the r/w flags of a bio submitted from 23The REQ_PREFLUSH flag can be OR ed into the r/w flags of a bio submitted from
24the filesystem and will make sure the volatile cache of the storage device 24the filesystem and will make sure the volatile cache of the storage device
25has been flushed before the actual I/O operation is started. This explicitly 25has been flushed before the actual I/O operation is started. This explicitly
26guarantees that previously completed write requests are on non-volatile 26guarantees that previously completed write requests are on non-volatile
27storage before the flagged bio starts. In addition the REQ_FLUSH flag can be 27storage before the flagged bio starts. In addition the REQ_PREFLUSH flag can be
28set on an otherwise empty bio structure, which causes only an explicit cache 28set on an otherwise empty bio structure, which causes only an explicit cache
29flush without any dependent I/O. It is recommend to use 29flush without any dependent I/O. It is recommend to use
30the blkdev_issue_flush() helper for a pure cache flush. 30the blkdev_issue_flush() helper for a pure cache flush.
@@ -41,21 +41,21 @@ signaled after the data has been committed to non-volatile storage.
41Implementation details for filesystems 41Implementation details for filesystems
42-------------------------------------- 42--------------------------------------
43 43
44Filesystems can simply set the REQ_FLUSH and REQ_FUA bits and do not have to 44Filesystems can simply set the REQ_PREFLUSH and REQ_FUA bits and do not have to
45worry if the underlying devices need any explicit cache flushing and how 45worry if the underlying devices need any explicit cache flushing and how
46the Forced Unit Access is implemented. The REQ_FLUSH and REQ_FUA flags 46the Forced Unit Access is implemented. The REQ_PREFLUSH and REQ_FUA flags
47may both be set on a single bio. 47may both be set on a single bio.
48 48
49 49
50Implementation details for make_request_fn based block drivers 50Implementation details for make_request_fn based block drivers
51-------------------------------------------------------------- 51--------------------------------------------------------------
52 52
53These drivers will always see the REQ_FLUSH and REQ_FUA bits as they sit 53These drivers will always see the REQ_PREFLUSH and REQ_FUA bits as they sit
54directly below the submit_bio interface. For remapping drivers the REQ_FUA 54directly below the submit_bio interface. For remapping drivers the REQ_FUA
55bits need to be propagated to underlying devices, and a global flush needs 55bits need to be propagated to underlying devices, and a global flush needs
56to be implemented for bios with the REQ_FLUSH bit set. For real device 56to be implemented for bios with the REQ_PREFLUSH bit set. For real device
57drivers that do not have a volatile cache the REQ_FLUSH and REQ_FUA bits 57drivers that do not have a volatile cache the REQ_PREFLUSH and REQ_FUA bits
58on non-empty bios can simply be ignored, and REQ_FLUSH requests without 58on non-empty bios can simply be ignored, and REQ_PREFLUSH requests without
59data can be completed successfully without doing any work. Drivers for 59data can be completed successfully without doing any work. Drivers for
60devices with volatile caches need to implement the support for these 60devices with volatile caches need to implement the support for these
61flags themselves without any help from the block layer. 61flags themselves without any help from the block layer.
@@ -65,8 +65,8 @@ Implementation details for request_fn based block drivers
65-------------------------------------------------------------- 65--------------------------------------------------------------
66 66
67For devices that do not support volatile write caches there is no driver 67For devices that do not support volatile write caches there is no driver
68support required, the block layer completes empty REQ_FLUSH requests before 68support required, the block layer completes empty REQ_PREFLUSH requests before
69entering the driver and strips off the REQ_FLUSH and REQ_FUA bits from 69entering the driver and strips off the REQ_PREFLUSH and REQ_FUA bits from
70requests that have a payload. For devices with volatile write caches the 70requests that have a payload. For devices with volatile write caches the
71driver needs to tell the block layer that it supports flushing caches by 71driver needs to tell the block layer that it supports flushing caches by
72doing: 72doing:
@@ -74,7 +74,7 @@ doing:
74 blk_queue_write_cache(sdkp->disk->queue, true, false); 74 blk_queue_write_cache(sdkp->disk->queue, true, false);
75 75
76and handle empty REQ_OP_FLUSH requests in its prep_fn/request_fn. Note that 76and handle empty REQ_OP_FLUSH requests in its prep_fn/request_fn. Note that
77REQ_FLUSH requests with a payload are automatically turned into a sequence 77REQ_PREFLUSH requests with a payload are automatically turned into a sequence
78of an empty REQ_OP_FLUSH request followed by the actual write by the block 78of an empty REQ_OP_FLUSH request followed by the actual write by the block
79layer. For devices that also support the FUA bit the block layer needs 79layer. For devices that also support the FUA bit the block layer needs
80to be told to pass through the REQ_FUA bit using: 80to be told to pass through the REQ_FUA bit using: