aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/block/barrier.txt16
1 files changed, 3 insertions, 13 deletions
diff --git a/Documentation/block/barrier.txt b/Documentation/block/barrier.txt
index a272c3db8094..7d279f2f5bb2 100644
--- a/Documentation/block/barrier.txt
+++ b/Documentation/block/barrier.txt
@@ -82,23 +82,12 @@ including draining and flushing.
82typedef void (prepare_flush_fn)(request_queue_t *q, struct request *rq); 82typedef void (prepare_flush_fn)(request_queue_t *q, struct request *rq);
83 83
84int blk_queue_ordered(request_queue_t *q, unsigned ordered, 84int blk_queue_ordered(request_queue_t *q, unsigned ordered,
85 prepare_flush_fn *prepare_flush_fn, 85 prepare_flush_fn *prepare_flush_fn);
86 unsigned gfp_mask);
87
88int blk_queue_ordered_locked(request_queue_t *q, unsigned ordered,
89 prepare_flush_fn *prepare_flush_fn,
90 unsigned gfp_mask);
91
92The only difference between the two functions is whether or not the
93caller is holding q->queue_lock on entry. The latter expects the
94caller is holding the lock.
95 86
96@q : the queue in question 87@q : the queue in question
97@ordered : the ordered mode the driver/device supports 88@ordered : the ordered mode the driver/device supports
98@prepare_flush_fn : this function should prepare @rq such that it 89@prepare_flush_fn : this function should prepare @rq such that it
99 flushes cache to physical medium when executed 90 flushes cache to physical medium when executed
100@gfp_mask : gfp_mask used when allocating data structures
101 for ordered processing
102 91
103For example, SCSI disk driver's prepare_flush_fn looks like the 92For example, SCSI disk driver's prepare_flush_fn looks like the
104following. 93following.
@@ -106,9 +95,10 @@ following.
106static void sd_prepare_flush(request_queue_t *q, struct request *rq) 95static void sd_prepare_flush(request_queue_t *q, struct request *rq)
107{ 96{
108 memset(rq->cmd, 0, sizeof(rq->cmd)); 97 memset(rq->cmd, 0, sizeof(rq->cmd));
109 rq->flags |= REQ_BLOCK_PC; 98 rq->cmd_type = REQ_TYPE_BLOCK_PC;
110 rq->timeout = SD_TIMEOUT; 99 rq->timeout = SD_TIMEOUT;
111 rq->cmd[0] = SYNCHRONIZE_CACHE; 100 rq->cmd[0] = SYNCHRONIZE_CACHE;
101 rq->cmd_len = 10;
112} 102}
113 103
114The following seven ordered modes are supported. The following table 104The following seven ordered modes are supported. The following table