Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208233
b: refs/heads/master
c: 7b6d91d
h: refs/heads/master
i:
  208231: d11c7bb
v: v3
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Aug 7, 2010
1 parent 718f2f1 commit a672f8b
Show file tree
Hide file tree
Showing 48 changed files with 243 additions and 290 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 33659ebbae262228eef4e0fe990f393d1f0ed941
refs/heads/master: 7b6d91daee5cac6402186ff224c3af39d79f4a0e
2 changes: 1 addition & 1 deletion trunk/block/blk-barrier.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ static inline bool start_ordered(struct request_queue *q, struct request **rqp)
/* initialize proxy request and queue it */
blk_rq_init(q, rq);
if (bio_data_dir(q->orig_bar_rq->bio) == WRITE)
rq->cmd_flags |= REQ_RW;
rq->cmd_flags |= REQ_WRITE;
if (q->ordered & QUEUE_ORDERED_DO_FUA)
rq->cmd_flags |= REQ_FUA;
init_request_from_bio(rq, q->orig_bar_rq->bio);
Expand Down
37 changes: 10 additions & 27 deletions trunk/block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1140,25 +1140,9 @@ void init_request_from_bio(struct request *req, struct bio *bio)
req->cpu = bio->bi_comp_cpu;
req->cmd_type = REQ_TYPE_FS;

/*
* Inherit FAILFAST from bio (for read-ahead, and explicit
* FAILFAST). FAILFAST flags are identical for req and bio.
*/
if (bio_rw_flagged(bio, BIO_RW_AHEAD))
req->cmd_flags |= bio->bi_rw & REQ_COMMON_MASK;
if (bio->bi_rw & REQ_RAHEAD)
req->cmd_flags |= REQ_FAILFAST_MASK;
else
req->cmd_flags |= bio->bi_rw & REQ_FAILFAST_MASK;

if (bio_rw_flagged(bio, BIO_RW_DISCARD))
req->cmd_flags |= REQ_DISCARD;
if (bio_rw_flagged(bio, BIO_RW_BARRIER))
req->cmd_flags |= REQ_HARDBARRIER;
if (bio_rw_flagged(bio, BIO_RW_SYNCIO))
req->cmd_flags |= REQ_RW_SYNC;
if (bio_rw_flagged(bio, BIO_RW_META))
req->cmd_flags |= REQ_RW_META;
if (bio_rw_flagged(bio, BIO_RW_NOIDLE))
req->cmd_flags |= REQ_NOIDLE;

req->errors = 0;
req->__sector = bio->bi_sector;
Expand All @@ -1181,12 +1165,12 @@ static int __make_request(struct request_queue *q, struct bio *bio)
int el_ret;
unsigned int bytes = bio->bi_size;
const unsigned short prio = bio_prio(bio);
const bool sync = bio_rw_flagged(bio, BIO_RW_SYNCIO);
const bool unplug = bio_rw_flagged(bio, BIO_RW_UNPLUG);
const bool sync = (bio->bi_rw & REQ_SYNC);
const bool unplug = (bio->bi_rw & REQ_UNPLUG);
const unsigned int ff = bio->bi_rw & REQ_FAILFAST_MASK;
int rw_flags;

if (bio_rw_flagged(bio, BIO_RW_BARRIER) &&
if ((bio->bi_rw & REQ_HARDBARRIER) &&
(q->next_ordered == QUEUE_ORDERED_NONE)) {
bio_endio(bio, -EOPNOTSUPP);
return 0;
Expand All @@ -1200,7 +1184,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)

spin_lock_irq(q->queue_lock);

if (unlikely(bio_rw_flagged(bio, BIO_RW_BARRIER)) || elv_queue_empty(q))
if (unlikely((bio->bi_rw & REQ_HARDBARRIER)) || elv_queue_empty(q))
goto get_rq;

el_ret = elv_merge(q, &req, bio);
Expand Down Expand Up @@ -1275,7 +1259,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
*/
rw_flags = bio_data_dir(bio);
if (sync)
rw_flags |= REQ_RW_SYNC;
rw_flags |= REQ_SYNC;

/*
* Grab a free request. This is might sleep but can not fail.
Expand Down Expand Up @@ -1464,7 +1448,7 @@ static inline void __generic_make_request(struct bio *bio)
goto end_io;
}

if (unlikely(!bio_rw_flagged(bio, BIO_RW_DISCARD) &&
if (unlikely(!(bio->bi_rw & REQ_DISCARD) &&
nr_sectors > queue_max_hw_sectors(q))) {
printk(KERN_ERR "bio too big device %s (%u > %u)\n",
bdevname(bio->bi_bdev, b),
Expand Down Expand Up @@ -1497,8 +1481,7 @@ static inline void __generic_make_request(struct bio *bio)
if (bio_check_eod(bio, nr_sectors))
goto end_io;

if (bio_rw_flagged(bio, BIO_RW_DISCARD) &&
!blk_queue_discard(q)) {
if ((bio->bi_rw & REQ_DISCARD) && !blk_queue_discard(q)) {
err = -EOPNOTSUPP;
goto end_io;
}
Expand Down Expand Up @@ -2365,7 +2348,7 @@ void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
struct bio *bio)
{
/* Bit 0 (R/W) is identical in rq->cmd_flags and bio->bi_rw */
rq->cmd_flags |= bio->bi_rw & REQ_RW;
rq->cmd_flags |= bio->bi_rw & REQ_WRITE;

if (bio_has_data(bio)) {
rq->nr_phys_segments = bio_phys_segments(q, bio);
Expand Down
2 changes: 1 addition & 1 deletion trunk/block/blk-map.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ int blk_rq_map_kern(struct request_queue *q, struct request *rq, void *kbuf,
return PTR_ERR(bio);

if (rq_data_dir(rq) == WRITE)
bio->bi_rw |= (1 << BIO_RW);
bio->bi_rw |= (1 << REQ_WRITE);

if (do_copy)
rq->cmd_flags |= REQ_COPY_USER;
Expand Down
2 changes: 1 addition & 1 deletion trunk/block/blk-merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ int blk_rq_map_sg(struct request_queue *q, struct request *rq,
}

if (q->dma_drain_size && q->dma_drain_needed(rq)) {
if (rq->cmd_flags & REQ_RW)
if (rq->cmd_flags & REQ_WRITE)
memset(q->dma_drain_buffer, 0, q->dma_drain_size);

sg->page_link &= ~0x02;
Expand Down
14 changes: 7 additions & 7 deletions trunk/block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ static inline struct cfq_data *cic_to_cfqd(struct cfq_io_context *cic)
*/
static inline bool cfq_bio_sync(struct bio *bio)
{
return bio_data_dir(bio) == READ || bio_rw_flagged(bio, BIO_RW_SYNCIO);
return bio_data_dir(bio) == READ || (bio->bi_rw & REQ_SYNC);
}

/*
Expand Down Expand Up @@ -646,10 +646,10 @@ cfq_choose_req(struct cfq_data *cfqd, struct request *rq1, struct request *rq2,
return rq1;
else if (rq_is_sync(rq2) && !rq_is_sync(rq1))
return rq2;
if ((rq1->cmd_flags & REQ_RW_META) && !(rq2->cmd_flags & REQ_RW_META))
if ((rq1->cmd_flags & REQ_META) && !(rq2->cmd_flags & REQ_META))
return rq1;
else if ((rq2->cmd_flags & REQ_RW_META) &&
!(rq1->cmd_flags & REQ_RW_META))
else if ((rq2->cmd_flags & REQ_META) &&
!(rq1->cmd_flags & REQ_META))
return rq2;

s1 = blk_rq_pos(rq1);
Expand Down Expand Up @@ -1485,7 +1485,7 @@ static void cfq_remove_request(struct request *rq)
cfqq->cfqd->rq_queued--;
cfq_blkiocg_update_io_remove_stats(&(RQ_CFQG(rq))->blkg,
rq_data_dir(rq), rq_is_sync(rq));
if (rq->cmd_flags & REQ_RW_META) {
if (rq->cmd_flags & REQ_META) {
WARN_ON(!cfqq->meta_pending);
cfqq->meta_pending--;
}
Expand Down Expand Up @@ -3177,7 +3177,7 @@ cfq_should_preempt(struct cfq_data *cfqd, struct cfq_queue *new_cfqq,
* So both queues are sync. Let the new request get disk time if
* it's a metadata request and the current queue is doing regular IO.
*/
if ((rq->cmd_flags & REQ_RW_META) && !cfqq->meta_pending)
if ((rq->cmd_flags & REQ_META) && !cfqq->meta_pending)
return true;

/*
Expand Down Expand Up @@ -3231,7 +3231,7 @@ cfq_rq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq,
struct cfq_io_context *cic = RQ_CIC(rq);

cfqd->rq_queued++;
if (rq->cmd_flags & REQ_RW_META)
if (rq->cmd_flags & REQ_META)
cfqq->meta_pending++;

cfq_update_io_thinktime(cfqd, cic);
Expand Down
3 changes: 1 addition & 2 deletions trunk/block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ int elv_rq_merge_ok(struct request *rq, struct bio *bio)
/*
* Don't merge file system requests and discard requests
*/
if (bio_rw_flagged(bio, BIO_RW_DISCARD) !=
bio_rw_flagged(rq->bio, BIO_RW_DISCARD))
if ((bio->bi_rw & REQ_DISCARD) != (rq->bio->bi_rw & REQ_DISCARD))
return 0;

/*
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ata/libata-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ static int atapi_drain_needed(struct request *rq)
if (likely(rq->cmd_type != REQ_TYPE_BLOCK_PC))
return 0;

if (!blk_rq_bytes(rq) || (rq->cmd_flags & REQ_RW))
if (!blk_rq_bytes(rq) || (rq->cmd_flags & REQ_WRITE))
return 0;

return atapi_cmd_type(rq->cmd[0]) == ATAPI_MISC;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/block/aoe/aoeblk.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ aoeblk_make_request(struct request_queue *q, struct bio *bio)
BUG();
bio_endio(bio, -ENXIO);
return 0;
} else if (bio_rw_flagged(bio, BIO_RW_BARRIER)) {
} else if (bio->bi_rw & REQ_HARDBARRIER) {
bio_endio(bio, -EOPNOTSUPP);
return 0;
} else if (bio->bi_io_vec == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/block/brd.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ static int brd_make_request(struct request_queue *q, struct bio *bio)
get_capacity(bdev->bd_disk))
goto out;

if (unlikely(bio_rw_flagged(bio, BIO_RW_DISCARD))) {
if (unlikely(bio->bi_rw & REQ_DISCARD)) {
err = 0;
discard_from_brd(brd, sector, bio->bi_size);
goto out;
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/block/drbd/drbd_actlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ static int _drbd_md_sync_page_io(struct drbd_conf *mdev,
md_io.error = 0;

if ((rw & WRITE) && !test_bit(MD_NO_BARRIER, &mdev->flags))
rw |= (1 << BIO_RW_BARRIER);
rw |= ((1<<BIO_RW_UNPLUG) | (1<<BIO_RW_SYNCIO));
rw |= REQ_HARDBARRIER;
rw |= REQ_UNPLUG | REQ_SYNC;

retry:
bio = bio_alloc(GFP_NOIO, 1);
Expand All @@ -103,11 +103,11 @@ static int _drbd_md_sync_page_io(struct drbd_conf *mdev,
/* check for unsupported barrier op.
* would rather check on EOPNOTSUPP, but that is not reliable.
* don't try again for ANY return value != 0 */
if (unlikely(bio_rw_flagged(bio, BIO_RW_BARRIER) && !ok)) {
if (unlikely((bio->bi_rw & REQ_HARDBARRIER) && !ok)) {
/* Try again with no barrier */
dev_warn(DEV, "Barriers not supported on meta data device - disabling\n");
set_bit(MD_NO_BARRIER, &mdev->flags);
rw &= ~(1 << BIO_RW_BARRIER);
rw &= ~REQ_HARDBARRIER;
bio_put(bio);
goto retry;
}
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/block/drbd/drbd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2425,15 +2425,15 @@ int drbd_send_dblock(struct drbd_conf *mdev, struct drbd_request *req)
/* NOTE: no need to check if barriers supported here as we would
* not pass the test in make_request_common in that case
*/
if (bio_rw_flagged(req->master_bio, BIO_RW_BARRIER)) {
if (req->master_bio->bi_rw & REQ_HARDBARRIER) {
dev_err(DEV, "ASSERT FAILED would have set DP_HARDBARRIER\n");
/* dp_flags |= DP_HARDBARRIER; */
}
if (bio_rw_flagged(req->master_bio, BIO_RW_SYNCIO))
if (req->master_bio->bi_rw & REQ_SYNC)
dp_flags |= DP_RW_SYNC;
/* for now handle SYNCIO and UNPLUG
* as if they still were one and the same flag */
if (bio_rw_flagged(req->master_bio, BIO_RW_UNPLUG))
if (req->master_bio->bi_rw & REQ_UNPLUG)
dp_flags |= DP_RW_SYNC;
if (mdev->state.conn >= C_SYNC_SOURCE &&
mdev->state.conn <= C_PAUSED_SYNC_T)
Expand Down
22 changes: 11 additions & 11 deletions trunk/drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ int drbd_submit_ee(struct drbd_conf *mdev, struct drbd_epoch_entry *e,
bio->bi_sector = sector;
bio->bi_bdev = mdev->ldev->backing_bdev;
/* we special case some flags in the multi-bio case, see below
* (BIO_RW_UNPLUG, BIO_RW_BARRIER) */
* (REQ_UNPLUG, REQ_HARDBARRIER) */
bio->bi_rw = rw;
bio->bi_private = e;
bio->bi_end_io = drbd_endio_sec;
Expand Down Expand Up @@ -1209,16 +1209,16 @@ int drbd_submit_ee(struct drbd_conf *mdev, struct drbd_epoch_entry *e,
bios = bios->bi_next;
bio->bi_next = NULL;

/* strip off BIO_RW_UNPLUG unless it is the last bio */
/* strip off REQ_UNPLUG unless it is the last bio */
if (bios)
bio->bi_rw &= ~(1<<BIO_RW_UNPLUG);
bio->bi_rw &= ~REQ_UNPLUG;

drbd_generic_make_request(mdev, fault_type, bio);

/* strip off BIO_RW_BARRIER,
/* strip off REQ_HARDBARRIER,
* unless it is the first or last bio */
if (bios && bios->bi_next)
bios->bi_rw &= ~(1<<BIO_RW_BARRIER);
bios->bi_rw &= ~REQ_HARDBARRIER;
} while (bios);
maybe_kick_lo(mdev);
return 0;
Expand All @@ -1233,7 +1233,7 @@ int drbd_submit_ee(struct drbd_conf *mdev, struct drbd_epoch_entry *e,
}

/**
* w_e_reissue() - Worker callback; Resubmit a bio, without BIO_RW_BARRIER set
* w_e_reissue() - Worker callback; Resubmit a bio, without REQ_HARDBARRIER set
* @mdev: DRBD device.
* @w: work object.
* @cancel: The connection will be closed anyways (unused in this callback)
Expand All @@ -1245,7 +1245,7 @@ int w_e_reissue(struct drbd_conf *mdev, struct drbd_work *w, int cancel) __relea
(and DE_BARRIER_IN_NEXT_EPOCH_ISSUED in the previous Epoch)
so that we can finish that epoch in drbd_may_finish_epoch().
That is necessary if we already have a long chain of Epochs, before
we realize that BIO_RW_BARRIER is actually not supported */
we realize that REQ_HARDBARRIER is actually not supported */

/* As long as the -ENOTSUPP on the barrier is reported immediately
that will never trigger. If it is reported late, we will just
Expand Down Expand Up @@ -1824,14 +1824,14 @@ static int receive_Data(struct drbd_conf *mdev, struct p_header *h)
epoch = list_entry(e->epoch->list.prev, struct drbd_epoch, list);
if (epoch == e->epoch) {
set_bit(DE_CONTAINS_A_BARRIER, &e->epoch->flags);
rw |= (1<<BIO_RW_BARRIER);
rw |= REQ_HARDBARRIER;
e->flags |= EE_IS_BARRIER;
} else {
if (atomic_read(&epoch->epoch_size) > 1 ||
!test_bit(DE_CONTAINS_A_BARRIER, &epoch->flags)) {
set_bit(DE_BARRIER_IN_NEXT_EPOCH_ISSUED, &epoch->flags);
set_bit(DE_CONTAINS_A_BARRIER, &e->epoch->flags);
rw |= (1<<BIO_RW_BARRIER);
rw |= REQ_HARDBARRIER;
e->flags |= EE_IS_BARRIER;
}
}
Expand All @@ -1841,10 +1841,10 @@ static int receive_Data(struct drbd_conf *mdev, struct p_header *h)
dp_flags = be32_to_cpu(p->dp_flags);
if (dp_flags & DP_HARDBARRIER) {
dev_err(DEV, "ASSERT FAILED would have submitted barrier request\n");
/* rw |= (1<<BIO_RW_BARRIER); */
/* rw |= REQ_HARDBARRIER; */
}
if (dp_flags & DP_RW_SYNC)
rw |= (1<<BIO_RW_SYNCIO) | (1<<BIO_RW_UNPLUG);
rw |= REQ_SYNC | REQ_UNPLUG;
if (dp_flags & DP_MAY_SET_IN_SYNC)
e->flags |= EE_MAY_SET_IN_SYNC;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/block/drbd/drbd_req.c
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ int drbd_make_request_26(struct request_queue *q, struct bio *bio)
* because of those XXX, this is not yet enabled,
* i.e. in drbd_init_set_defaults we set the NO_BARRIER_SUPP bit.
*/
if (unlikely(bio_rw_flagged(bio, BIO_RW_BARRIER) && test_bit(NO_BARRIER_SUPP, &mdev->flags))) {
if (unlikely(bio->bi_rw & REQ_HARDBARRIER) && test_bit(NO_BARRIER_SUPP, &mdev->flags)) {
/* dev_warn(DEV, "Rejecting barrier request as underlying device does not support\n"); */
bio_endio(bio, -EOPNOTSUPP);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/block/loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ static int do_bio_filebacked(struct loop_device *lo, struct bio *bio)
pos = ((loff_t) bio->bi_sector << 9) + lo->lo_offset;

if (bio_rw(bio) == WRITE) {
bool barrier = bio_rw_flagged(bio, BIO_RW_BARRIER);
bool barrier = (bio->bi_rw & REQ_HARDBARRIER);
struct file *file = lo->lo_backing_file;

if (barrier) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/block/pktcdvd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,7 @@ static int pkt_start_recovery(struct packet_data *pkt)
pkt->bio->bi_flags = 1 << BIO_UPTODATE;
pkt->bio->bi_idx = 0;

BUG_ON(pkt->bio->bi_rw != (1 << BIO_RW));
BUG_ON(pkt->bio->bi_rw != REQ_WRITE);
BUG_ON(pkt->bio->bi_vcnt != pkt->frames);
BUG_ON(pkt->bio->bi_size != pkt->frames * CD_FRAMESIZE);
BUG_ON(pkt->bio->bi_end_io != pkt_end_io_packet_write);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/block/umem.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ static void process_page(unsigned long data)
le32_to_cpu(desc->local_addr)>>9,
le32_to_cpu(desc->transfer_size));
dump_dmastat(card, control);
} else if (test_bit(BIO_RW, &bio->bi_rw) &&
} else if ((bio->bi_rw & REQ_WRITE) &&
le32_to_cpu(desc->local_addr) >> 9 ==
card->init_size) {
card->init_size += le32_to_cpu(desc->transfer_size) >> 9;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ide/ide-cd_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ int ide_cdrom_packet(struct cdrom_device_info *cdi,
touch it at all. */

if (cgc->data_direction == CGC_DATA_WRITE)
flags |= REQ_RW;
flags |= REQ_WRITE;

if (cgc->sense)
memset(cgc->sense, 0, sizeof(struct request_sense));
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ide/ide-floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ static void idefloppy_create_rw_cmd(ide_drive_t *drive,
memcpy(rq->cmd, pc->c, 12);

pc->rq = rq;
if (rq->cmd_flags & REQ_RW)
if (rq->cmd_flags & REQ_WRITE)
pc->flags |= PC_FLAG_WRITING;

pc->flags |= PC_FLAG_DMA_OK;
Expand Down
Loading

0 comments on commit a672f8b

Please sign in to comment.