diff options
| author | Jens Axboe <axboe@suse.de> | 2002-11-07 21:50:01 -0800 |
|---|---|---|
| committer | Jens Axboe <axboe@suse.de> | 2002-11-07 21:50:01 -0800 |
| commit | 719eb3e1860791195ed7656b800d8bb57b277a75 (patch) | |
| tree | 43f6d18a9560b58b9bb6595b5bbb6d8f035b9f0a /include | |
| parent | 26d15b504ec3faf63447a97d3ba2498c4696ad81 (diff) | |
[PATCH] soft and hard barriers
Right now we have one type of barrier in the block layer, and that is
used mainly for making sure that the io scheduler doesn't reorder
requests when we don't want it to. We also need a flag to tell the io
scheduler and low level queue that this is a barrier. So basically two
needs:
o software barrier, prevents the io scheduler from reordering
o hardware barrier, driver must prevent drive from reordering
So this patch gets rid of REQ_BARRIER and instead adds REQ_SOFTBARRIER
and REQ_HARDBARRIER.
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/blkdev.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 5fe4ade9e2bd..472432a57b06 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -110,7 +110,8 @@ struct request { enum rq_flag_bits { __REQ_RW, /* not set, read. set, write */ __REQ_RW_AHEAD, /* READA */ - __REQ_BARRIER, /* may not be passed */ + __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ + __REQ_HARDBARRIER, /* may not be passed by drive either */ __REQ_CMD, /* is a regular fs rw request */ __REQ_NOMERGE, /* don't touch this for merging */ __REQ_STARTED, /* drive already may have started this one */ @@ -134,7 +135,8 @@ enum rq_flag_bits { #define REQ_RW (1 << __REQ_RW) #define REQ_RW_AHEAD (1 << __REQ_RW_AHEAD) -#define REQ_BARRIER (1 << __REQ_BARRIER) +#define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) +#define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) #define REQ_CMD (1 << __REQ_CMD) #define REQ_NOMERGE (1 << __REQ_NOMERGE) #define REQ_STARTED (1 << __REQ_STARTED) @@ -275,9 +277,10 @@ struct request_queue * mergeable request must not have _NOMERGE or _BARRIER bit set, nor may * it already be started by driver. */ +#define RQ_NOMERGE_FLAGS \ + (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER) #define rq_mergeable(rq) \ - (!((rq)->flags & (REQ_NOMERGE | REQ_STARTED | REQ_BARRIER)) \ - && ((rq)->flags & REQ_CMD)) + (!((rq)->flags & RQ_NOMERGE_FLAGS) && blk_fs_request((rq))) /* * noop, requests are automagically marked as active/inactive by I/O |
