# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.867 -> 1.868 # drivers/block/ll_rw_blk.c 1.138 -> 1.139 # include/linux/blkdev.h 1.89 -> 1.90 # drivers/scsi/scsi.h 1.34 -> 1.35 # drivers/scsi/aic7xxx_old.c 1.30 -> 1.31 # drivers/block/elevator.c 1.34 -> 1.35 # drivers/block/deadline-iosched.c 1.9 -> 1.10 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 02/11/08 axboe@burns.home.kernel.dk 1.868 # 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. # -------------------------------------------- # diff -Nru a/drivers/block/deadline-iosched.c b/drivers/block/deadline-iosched.c --- a/drivers/block/deadline-iosched.c Fri Nov 8 09:57:41 2002 +++ b/drivers/block/deadline-iosched.c Fri Nov 8 09:57:41 2002 @@ -207,7 +207,7 @@ break; } - if (__rq->flags & REQ_BARRIER) + if (__rq->flags & (REQ_SOFTBARRIER | REQ_HARDBARRIER)) break; /* @@ -413,7 +413,7 @@ * flush hash on barrier insert, as not to allow merges before a * barrier. */ - if (unlikely(rq->flags & REQ_BARRIER)) { + if (unlikely(rq->flags & REQ_HARDBARRIER)) { DL_INVALIDATE_HASH(dd); q->last_merge = NULL; } diff -Nru a/drivers/block/elevator.c b/drivers/block/elevator.c --- a/drivers/block/elevator.c Fri Nov 8 09:57:41 2002 +++ b/drivers/block/elevator.c Fri Nov 8 09:57:41 2002 @@ -176,7 +176,9 @@ while ((entry = entry->prev) != &q->queue_head) { __rq = list_entry_rq(entry); - if (__rq->flags & (REQ_BARRIER | REQ_STARTED)) + if (__rq->flags & (REQ_SOFTBARRIER | REQ_HARDBARRIER)) + break; + else if (__rq->flags & REQ_STARTED) break; if (!(__rq->flags & REQ_CMD)) @@ -200,7 +202,7 @@ /* * new merges must not precede this barrier */ - if (rq->flags & REQ_BARRIER) + if (rq->flags & REQ_HARDBARRIER) q->last_merge = NULL; else if (!q->last_merge) q->last_merge = &rq->queuelist; diff -Nru a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c --- a/drivers/block/ll_rw_blk.c Fri Nov 8 09:57:41 2002 +++ b/drivers/block/ll_rw_blk.c Fri Nov 8 09:57:41 2002 @@ -644,7 +644,8 @@ static char *rq_flags[] = { "REQ_RW", "REQ_RW_AHEAD", - "REQ_BARRIER", + "REQ_SOFTBARRIER", + "REQ_HARDBARRIER", "REQ_CMD", "REQ_NOMERGE", "REQ_STARTED", @@ -1392,7 +1393,7 @@ * must not attempt merges on this) and that it acts as a soft * barrier */ - rq->flags |= REQ_SPECIAL | REQ_BARRIER; + rq->flags |= REQ_SPECIAL | REQ_SOFTBARRIER; rq->special = data; @@ -1788,7 +1789,7 @@ * REQ_BARRIER implies no merging, but lets make it explicit */ if (barrier) - req->flags |= (REQ_BARRIER | REQ_NOMERGE); + req->flags |= (REQ_HARDBARRIER | REQ_NOMERGE); req->errors = 0; req->hard_sector = req->sector = sector; diff -Nru a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c --- a/drivers/scsi/aic7xxx_old.c Fri Nov 8 09:57:41 2002 +++ b/drivers/scsi/aic7xxx_old.c Fri Nov 8 09:57:41 2002 @@ -2867,7 +2867,7 @@ aic_dev->r_total++; ptr = aic_dev->r_bins; } - if(cmd->device->simple_tags && cmd->request->flags & REQ_BARRIER) + if(cmd->device->simple_tags && cmd->request->flags & REQ_HARDBARRIER) { aic_dev->barrier_total++; if(scb->tag_action == MSG_ORDERED_Q_TAG) @@ -10206,7 +10206,7 @@ /* We always force TEST_UNIT_READY to untagged */ if (cmd->cmnd[0] != TEST_UNIT_READY && sdptr->simple_tags) { - if (req->flags & REQ_BARRIER) + if (req->flags & REQ_HARDBARRIER) { if(sdptr->ordered_tags) { diff -Nru a/drivers/scsi/scsi.h b/drivers/scsi/scsi.h --- a/drivers/scsi/scsi.h Fri Nov 8 09:57:41 2002 +++ b/drivers/scsi/scsi.h Fri Nov 8 09:57:41 2002 @@ -915,8 +915,8 @@ if(!blk_rq_tagged(req)) return 0; - - if(req->flags & REQ_BARRIER) + + if (req->flags & REQ_HARDBARRIER) *msg++ = MSG_ORDERED_TAG; else *msg++ = MSG_SIMPLE_TAG; diff -Nru a/include/linux/blkdev.h b/include/linux/blkdev.h --- a/include/linux/blkdev.h Fri Nov 8 09:57:41 2002 +++ b/include/linux/blkdev.h Fri Nov 8 09:57:41 2002 @@ -110,7 +110,8 @@ 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 @@ #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 @@ * 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