block: get rid of bio_rw and READA
authorChristoph Hellwig <hch@lst.de>
Tue, 19 Jul 2016 09:28:41 +0000 (11:28 +0200)
committerJens Axboe <axboe@fb.com>
Wed, 20 Jul 2016 23:37:01 +0000 (17:37 -0600)
These two are confusing leftover of the old world order, combining
values of the REQ_OP_ and REQ_ namespaces.  For callers that don't
special case we mostly just replace bi_rw with bio_data_dir or
op_is_write, except for the few cases where a switch over the REQ_OP_
values makes more sense.  Any check for READA is replaced with an
explicit check for REQ_RAHEAD.  Also remove the READA alias for
REQ_RAHEAD.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
26 files changed:
drivers/block/brd.c
drivers/block/drbd/drbd_req.c
drivers/block/drbd/drbd_worker.c
drivers/block/null_blk.c
drivers/block/umem.c
drivers/lightnvm/rrpc.c
drivers/md/dm-raid1.c
drivers/md/dm-snap.c
drivers/md/dm-zero.c
drivers/md/dm.c
drivers/md/raid1.c
drivers/md/raid5.c
drivers/nvme/host/lightnvm.c
drivers/staging/lustre/lustre/llite/lloop.c
fs/buffer.c
fs/f2fs/checkpoint.c
fs/f2fs/gc.c
fs/f2fs/node.c
fs/gfs2/bmap.c
fs/gfs2/dir.c
fs/gfs2/meta_io.c
fs/reiserfs/stree.c
fs/udf/dir.c
fs/udf/directory.c
include/linux/fs.h
include/trace/events/f2fs.h

index f5b0d6f4e09fab1852e8f3625076ec729624bc91..41a6c4c9da9f7d1310ca55f31365afa1dc6e3b14 100644 (file)
@@ -347,9 +347,7 @@ static blk_qc_t brd_make_request(struct request_queue *q, struct bio *bio)
                goto out;
        }
 
-       rw = bio_rw(bio);
-       if (rw == READA)
-               rw = READ;
+       rw = bio_data_dir(bio);
 
        bio_for_each_segment(bvec, bio, iter) {
                unsigned int len = bvec.bv_len;
index 787536a0ee7ccde5f7c142bad4903eb499321285..66b8e4bb74d8ab099b090103bd1ee1d4ce86c6f9 100644 (file)
@@ -219,7 +219,6 @@ void drbd_req_complete(struct drbd_request *req, struct bio_and_error *m)
 {
        const unsigned s = req->rq_state;
        struct drbd_device *device = req->device;
-       int rw;
        int error, ok;
 
        /* we must not complete the master bio, while it is
@@ -243,8 +242,6 @@ void drbd_req_complete(struct drbd_request *req, struct bio_and_error *m)
                return;
        }
 
-       rw = bio_rw(req->master_bio);
-
        /*
         * figure out whether to report success or failure.
         *
@@ -268,7 +265,7 @@ void drbd_req_complete(struct drbd_request *req, struct bio_and_error *m)
         * epoch number.  If they match, increase the current_tle_nr,
         * and reset the transfer log epoch write_cnt.
         */
-       if (rw == WRITE &&
+       if (op_is_write(bio_op(req->master_bio)) &&
            req->epoch == atomic_read(&first_peer_device(device)->connection->current_tle_nr))
                start_new_tl_epoch(first_peer_device(device)->connection);
 
@@ -285,11 +282,14 @@ void drbd_req_complete(struct drbd_request *req, struct bio_and_error *m)
         * because no path was available, in which case
         * it was not even added to the transfer_log.
         *
-        * READA may fail, and will not be retried.
+        * read-ahead may fail, and will not be retried.
         *
         * WRITE should have used all available paths already.
         */
-       if (!ok && rw == READ && !list_empty(&req->tl_requests))
+       if (!ok &&
+           bio_op(req->master_bio) == REQ_OP_READ &&
+           !(req->master_bio->bi_rw & REQ_RAHEAD) &&
+           !list_empty(&req->tl_requests))
                req->rq_state |= RQ_POSTPONED;
 
        if (!(req->rq_state & RQ_POSTPONED)) {
@@ -645,7 +645,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
                __drbd_chk_io_error(device, DRBD_READ_ERROR);
                /* fall through. */
        case READ_AHEAD_COMPLETED_WITH_ERROR:
-               /* it is legal to fail READA, no __drbd_chk_io_error in that case. */
+               /* it is legal to fail read-ahead, no __drbd_chk_io_error in that case. */
                mod_rq_state(req, m, RQ_LOCAL_PENDING, RQ_LOCAL_COMPLETED);
                break;
 
@@ -657,7 +657,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
                break;
 
        case QUEUE_FOR_NET_READ:
-               /* READ or READA, and
+               /* READ, and
                 * no local disk,
                 * or target area marked as invalid,
                 * or just got an io-error. */
@@ -1172,7 +1172,14 @@ drbd_submit_req_private_bio(struct drbd_request *req)
 {
        struct drbd_device *device = req->device;
        struct bio *bio = req->private_bio;
-       const int rw = bio_rw(bio);
+       unsigned int type;
+
+       if (bio_op(bio) != REQ_OP_READ)
+               type = DRBD_FAULT_DT_WR;
+       else if (bio->bi_rw & REQ_RAHEAD)
+               type = DRBD_FAULT_DT_RA;
+       else
+               type = DRBD_FAULT_DT_RD;
 
        bio->bi_bdev = device->ldev->backing_bdev;
 
@@ -1182,10 +1189,7 @@ drbd_submit_req_private_bio(struct drbd_request *req)
         * stable storage, and this is a WRITE, we may not even submit
         * this bio. */
        if (get_ldev(device)) {
-               if (drbd_insert_fault(device,
-                                     rw == WRITE ? DRBD_FAULT_DT_WR
-                                   : rw == READ  ? DRBD_FAULT_DT_RD
-                                   :               DRBD_FAULT_DT_RA))
+               if (drbd_insert_fault(device, type))
                        bio_io_error(bio);
                else if (bio_op(bio) == REQ_OP_DISCARD)
                        drbd_process_discard_req(req);
@@ -1278,7 +1282,7 @@ static bool may_do_writes(struct drbd_device *device)
 static void drbd_send_and_submit(struct drbd_device *device, struct drbd_request *req)
 {
        struct drbd_resource *resource = device->resource;
-       const int rw = bio_rw(req->master_bio);
+       const int rw = bio_data_dir(req->master_bio);
        struct bio_and_error m = { NULL, };
        bool no_remote = false;
        bool submit_private_bio = false;
@@ -1308,7 +1312,7 @@ static void drbd_send_and_submit(struct drbd_device *device, struct drbd_request
                goto out;
        }
 
-       /* We fail READ/READA early, if we can not serve it.
+       /* We fail READ early, if we can not serve it.
         * We must do this before req is registered on any lists.
         * Otherwise, drbd_req_complete() will queue failed READ for retry. */
        if (rw != WRITE) {
index b3fa5575bc0e64ed4dd6599c5e7bb2f3c5632988..35dbb3dca47ef6a609811c03fefcc1bb4fc2f101 100644 (file)
@@ -248,18 +248,26 @@ void drbd_request_endio(struct bio *bio)
 
        /* to avoid recursion in __req_mod */
        if (unlikely(bio->bi_error)) {
-               if (bio_op(bio) == REQ_OP_DISCARD)
-                       what = (bio->bi_error == -EOPNOTSUPP)
-                               ? DISCARD_COMPLETED_NOTSUPP
-                               : DISCARD_COMPLETED_WITH_ERROR;
-               else
-                       what = (bio_data_dir(bio) == WRITE)
-                       ? WRITE_COMPLETED_WITH_ERROR
-                       : (bio_rw(bio) == READ)
-                         ? READ_COMPLETED_WITH_ERROR
-                         : READ_AHEAD_COMPLETED_WITH_ERROR;
-       } else
+               switch (bio_op(bio)) {
+               case REQ_OP_DISCARD:
+                       if (bio->bi_error == -EOPNOTSUPP)
+                               what = DISCARD_COMPLETED_NOTSUPP;
+                       else
+                               what = DISCARD_COMPLETED_WITH_ERROR;
+                       break;
+               case REQ_OP_READ:
+                       if (bio->bi_rw & REQ_RAHEAD)
+                               what = READ_AHEAD_COMPLETED_WITH_ERROR;
+                       else
+                               what = READ_COMPLETED_WITH_ERROR;
+                       break;
+               default:
+                       what = WRITE_COMPLETED_WITH_ERROR;
+                       break;
+               }
+       } else {
                what = COMPLETED_OK;
+       }
 
        bio_put(req->private_bio);
        req->private_bio = ERR_PTR(bio->bi_error);
index cab97593ba549e7eb73509f1807546244c057d8e..75a7f88d67176af54c19df1768ce770b6d4f11ce 100644 (file)
@@ -448,7 +448,7 @@ static int null_lnvm_submit_io(struct nvm_dev *dev, struct nvm_rq *rqd)
        struct request *rq;
        struct bio *bio = rqd->bio;
 
-       rq = blk_mq_alloc_request(q, bio_rw(bio), 0);
+       rq = blk_mq_alloc_request(q, bio_data_dir(bio), 0);
        if (IS_ERR(rq))
                return -ENOMEM;
 
index 4b3ba74e9d22f3ec90ad4d8b39cdb0fcfac2ab83..d0a3e6d4515f8246bab82dab698cfcc8b58f800c 100644 (file)
@@ -344,7 +344,6 @@ static int add_bio(struct cardinfo *card)
        int offset;
        struct bio *bio;
        struct bio_vec vec;
-       int rw;
 
        bio = card->currentbio;
        if (!bio && card->bio) {
@@ -359,7 +358,6 @@ static int add_bio(struct cardinfo *card)
        if (!bio)
                return 0;
 
-       rw = bio_rw(bio);
        if (card->mm_pages[card->Ready].cnt >= DESC_PER_PAGE)
                return 0;
 
@@ -369,7 +367,7 @@ static int add_bio(struct cardinfo *card)
                                  vec.bv_page,
                                  vec.bv_offset,
                                  vec.bv_len,
-                                 (rw == READ) ?
+                                 bio_op(bio) == REQ_OP_READ ?
                                  PCI_DMA_FROMDEVICE : PCI_DMA_TODEVICE);
 
        p = &card->mm_pages[card->Ready];
@@ -398,7 +396,7 @@ static int add_bio(struct cardinfo *card)
                                         DMASCR_CHAIN_EN |
                                         DMASCR_SEM_EN |
                                         pci_cmds);
-       if (rw == WRITE)
+       if (bio_op(bio) == REQ_OP_WRITE)
                desc->control_bits |= cpu_to_le32(DMASCR_TRANSFER_READ);
        desc->sem_control_bits = desc->control_bits;
 
index fa1ab042148964e8da2d7703f6e9ab756ab33ad9..37fcaadbf80ca05dd22d9a018837ea3974d21a8e 100644 (file)
@@ -853,14 +853,14 @@ static int rrpc_setup_rq(struct rrpc *rrpc, struct bio *bio,
                        return NVM_IO_ERR;
                }
 
-               if (bio_rw(bio) == WRITE)
+               if (bio_op(bio) == REQ_OP_WRITE)
                        return rrpc_write_ppalist_rq(rrpc, bio, rqd, flags,
                                                                        npages);
 
                return rrpc_read_ppalist_rq(rrpc, bio, rqd, flags, npages);
        }
 
-       if (bio_rw(bio) == WRITE)
+       if (bio_op(bio) == REQ_OP_WRITE)
                return rrpc_write_rq(rrpc, bio, rqd, flags);
 
        return rrpc_read_rq(rrpc, bio, rqd, flags);
index 9f5f460c0e920af5bb49338e2c47a70c525c9262..dac55b254a09a7fb76d1745ff7f0660338211e2a 100644 (file)
@@ -528,7 +528,7 @@ static void read_callback(unsigned long error, void *context)
                DMWARN_LIMIT("Read failure on mirror device %s.  "
                             "Trying alternative device.",
                             m->dev->name);
-               queue_bio(m->ms, bio, bio_rw(bio));
+               queue_bio(m->ms, bio, bio_data_dir(bio));
                return;
        }
 
@@ -1193,7 +1193,7 @@ static void mirror_dtr(struct dm_target *ti)
  */
 static int mirror_map(struct dm_target *ti, struct bio *bio)
 {
-       int r, rw = bio_rw(bio);
+       int r, rw = bio_data_dir(bio);
        struct mirror *m;
        struct mirror_set *ms = ti->private;
        struct dm_dirty_log *log = dm_rh_dirty_log(ms->rh);
@@ -1217,7 +1217,7 @@ static int mirror_map(struct dm_target *ti, struct bio *bio)
         * If region is not in-sync queue the bio.
         */
        if (!r || (r == -EWOULDBLOCK)) {
-               if (rw == READA)
+               if (bio->bi_rw & REQ_RAHEAD)
                        return -EWOULDBLOCK;
 
                queue_bio(ms, bio, rw);
@@ -1242,7 +1242,7 @@ static int mirror_map(struct dm_target *ti, struct bio *bio)
 
 static int mirror_end_io(struct dm_target *ti, struct bio *bio, int error)
 {
-       int rw = bio_rw(bio);
+       int rw = bio_data_dir(bio);
        struct mirror_set *ms = (struct mirror_set *) ti->private;
        struct mirror *m = NULL;
        struct dm_bio_details *bd = NULL;
index 69ab1ff5f5c996ce542d0025943231ed54e6fe59..cc2f14b42ba4208d24931551404f44b0d7c5ce24 100644 (file)
@@ -1696,7 +1696,8 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio)
         * to copy an exception */
        down_write(&s->lock);
 
-       if (!s->valid || (unlikely(s->snapshot_overflowed) && bio_rw(bio) == WRITE)) {
+       if (!s->valid || (unlikely(s->snapshot_overflowed) &&
+           bio_data_dir(bio) == WRITE)) {
                r = -EIO;
                goto out_unlock;
        }
@@ -1713,7 +1714,7 @@ static int snapshot_map(struct dm_target *ti, struct bio *bio)
         * flags so we should only get this if we are
         * writeable.
         */
-       if (bio_rw(bio) == WRITE) {
+       if (bio_data_dir(bio) == WRITE) {
                pe = __lookup_pending_exception(s, chunk);
                if (!pe) {
                        up_write(&s->lock);
@@ -1819,7 +1820,7 @@ static int snapshot_merge_map(struct dm_target *ti, struct bio *bio)
        e = dm_lookup_exception(&s->complete, chunk);
        if (e) {
                /* Queue writes overlapping with chunks being merged */
-               if (bio_rw(bio) == WRITE &&
+               if (bio_data_dir(bio) == WRITE &&
                    chunk >= s->first_merging_chunk &&
                    chunk < (s->first_merging_chunk +
                             s->num_merging_chunks)) {
@@ -1831,7 +1832,7 @@ static int snapshot_merge_map(struct dm_target *ti, struct bio *bio)
 
                remap_exception(s, e, bio, chunk);
 
-               if (bio_rw(bio) == WRITE)
+               if (bio_data_dir(bio) == WRITE)
                        track_chunk(s, bio, chunk);
                goto out_unlock;
        }
@@ -1839,7 +1840,7 @@ static int snapshot_merge_map(struct dm_target *ti, struct bio *bio)
 redirect_to_origin:
        bio->bi_bdev = s->origin->bdev;
 
-       if (bio_rw(bio) == WRITE) {
+       if (bio_data_dir(bio) == WRITE) {
                up_write(&s->lock);
                return do_origin(s->origin, bio);
        }
@@ -2288,7 +2289,7 @@ static int origin_map(struct dm_target *ti, struct bio *bio)
        if (unlikely(bio->bi_rw & REQ_PREFLUSH))
                return DM_MAPIO_REMAPPED;
 
-       if (bio_rw(bio) != WRITE)
+       if (bio_data_dir(bio) != WRITE)
                return DM_MAPIO_REMAPPED;
 
        available_sectors = o->split_boundary -
index 766bc93006e616758fef0f37397a8cf5126bea3a..618b8752dcf1479733764592930902232ec47b27 100644 (file)
@@ -35,16 +35,19 @@ static int zero_ctr(struct dm_target *ti, unsigned int argc, char **argv)
  */
 static int zero_map(struct dm_target *ti, struct bio *bio)
 {
-       switch(bio_rw(bio)) {
-       case READ:
+       switch (bio_op(bio)) {
+       case REQ_OP_READ:
+               if (bio->bi_rw & REQ_RAHEAD) {
+                       /* readahead of null bytes only wastes buffer cache */
+                       return -EIO;
+               }
                zero_fill_bio(bio);
                break;
-       case READA:
-               /* readahead of null bytes only wastes buffer cache */
-               return -EIO;
-       case WRITE:
+       case REQ_OP_WRITE:
                /* writes get silently dropped */
                break;
+       default:
+               return -EIO;
        }
 
        bio_endio(bio);
index aba7ed9abb3ab774dfcac7d710a50290888cf230..812fd5984eeaf2cae8e861806cb592baf6f6a936 100644 (file)
@@ -1833,7 +1833,7 @@ static blk_qc_t dm_make_request(struct request_queue *q, struct bio *bio)
        if (unlikely(test_bit(DMF_BLOCK_IO_FOR_SUSPEND, &md->flags))) {
                dm_put_live_table(md, srcu_idx);
 
-               if (bio_rw(bio) != READA)
+               if (!(bio->bi_rw & REQ_RAHEAD))
                        queue_io(md, bio);
                else
                        bio_io_error(bio);
index 41d9c31da3b38d70b6dc3d4686bade7d9f866e3d..4e6da4497553cde35149daa63caf74e4ecbe843b 100644 (file)
@@ -1105,7 +1105,7 @@ static void raid1_make_request(struct mddev *mddev, struct bio * bio)
        bitmap = mddev->bitmap;
 
        /*
-        * make_request() can abort the operation when READA is being
+        * make_request() can abort the operation when read-ahead is being
         * used and no empty request is available.
         *
         */
index 7aacf5b55e1540f9bacab18c06e39a1ea8105417..6953d78297b0ccf633abeb7591ed23fdb469f639 100644 (file)
@@ -5233,7 +5233,7 @@ static void raid5_make_request(struct mddev *mddev, struct bio * bi)
                        (unsigned long long)logical_sector);
 
                sh = raid5_get_active_stripe(conf, new_sector, previous,
-                                      (bi->bi_rw&RWA_MASK), 0);
+                                      (bi->bi_rw & REQ_RAHEAD), 0);
                if (sh) {
                        if (unlikely(previous)) {
                                /* expansion might have moved on while waiting for a
index 97fe6109c98f4af993e3842d2afef88328302601..63f483daf9301fcd51d4b7b4cce031e379a1816d 100644 (file)
@@ -500,7 +500,7 @@ static int nvme_nvm_submit_io(struct nvm_dev *dev, struct nvm_rq *rqd)
        struct bio *bio = rqd->bio;
        struct nvme_nvm_command *cmd;
 
-       rq = blk_mq_alloc_request(q, bio_rw(bio), 0);
+       rq = blk_mq_alloc_request(q, bio_data_dir(bio), 0);
        if (IS_ERR(rq))
                return -ENOMEM;
 
index b677930a8a3b417408091b872ee1c96decee0367..56ae8ac32708a9bed5e03ca01d60db1157f164b3 100644 (file)
@@ -336,7 +336,6 @@ static unsigned int loop_get_bio(struct lloop_device *lo, struct bio **req)
 static blk_qc_t loop_make_request(struct request_queue *q, struct bio *old_bio)
 {
        struct lloop_device *lo = q->queuedata;
-       int rw = bio_rw(old_bio);
        int inactive;
 
        blk_queue_split(q, &old_bio, q->bio_split);
@@ -354,13 +353,15 @@ static blk_qc_t loop_make_request(struct request_queue *q, struct bio *old_bio)
        if (inactive)
                goto err;
 
-       if (rw == WRITE) {
+       switch (bio_op(old_bio)) {
+       case REQ_OP_WRITE:
                if (lo->lo_flags & LO_FLAGS_READ_ONLY)
                        goto err;
-       } else if (rw == READA) {
-               rw = READ;
-       } else if (rw != READ) {
-               CERROR("lloop: unknown command (%x)\n", rw);
+               break;
+       case REQ_OP_READ:
+               break;
+       default:
+               CERROR("lloop: unknown command (%x)\n", bio_op(old_bio));
                goto err;
        }
        loop_add_bio(lo, old_bio);
index 373aacb4f4c1e147e415b233c5ce927a833382ab..c24201e78492f1650bff12eeb340c5d4522e55bf 100644 (file)
@@ -153,7 +153,7 @@ static void __end_buffer_read_notouch(struct buffer_head *bh, int uptodate)
        if (uptodate) {
                set_buffer_uptodate(bh);
        } else {
-               /* This happens, due to failed READA attempts. */
+               /* This happens, due to failed read-ahead attempts. */
                clear_buffer_uptodate(bh);
        }
        unlock_buffer(bh);
@@ -1395,7 +1395,7 @@ void __breadahead(struct block_device *bdev, sector_t block, unsigned size)
 {
        struct buffer_head *bh = __getblk(bdev, block, size);
        if (likely(bh)) {
-               ll_rw_block(REQ_OP_READ, READA, 1, &bh);
+               ll_rw_block(REQ_OP_READ, REQ_RAHEAD, 1, &bh);
                brelse(bh);
        }
 }
@@ -3052,14 +3052,14 @@ EXPORT_SYMBOL(submit_bh);
 /**
  * ll_rw_block: low-level access to block devices (DEPRECATED)
  * @op: whether to %READ or %WRITE
- * @op_flags: rq_flag_bits or %READA (readahead)
+ * @op_flags: rq_flag_bits
  * @nr: number of &struct buffer_heads in the array
  * @bhs: array of pointers to &struct buffer_head
  *
  * ll_rw_block() takes an array of pointers to &struct buffer_heads, and
- * requests an I/O operation on them, either a %READ or a %WRITE.  The third
- * %READA option is described in the documentation for generic_make_request()
- * which ll_rw_block() calls.
+ * requests an I/O operation on them, either a %REQ_OP_READ or a %REQ_OP_WRITE.
+ * @op_flags contains flags modifying the detailed I/O behavior, most notably
+ * %REQ_RAHEAD.
  *
  * This function drops any buffer that it cannot get a lock on (with the
  * BH_Lock state bit), any buffer that appears to be clean when doing a write
index b6d600e91f39dfe18fa0435fd13a05c5c0d90058..124b4a3017b537efd3df41002ad069f0f4badb6d 100644 (file)
@@ -159,7 +159,7 @@ int ra_meta_pages(struct f2fs_sb_info *sbi, block_t start, int nrpages,
                .sbi = sbi,
                .type = META,
                .op = REQ_OP_READ,
-               .op_flags = sync ? (READ_SYNC | REQ_META | REQ_PRIO) : READA,
+               .op_flags = sync ? (READ_SYNC | REQ_META | REQ_PRIO) : REQ_RAHEAD,
                .encrypted_page = NULL,
        };
        struct blk_plug plug;
index 3649d86bb431e208f5645ed962c5ce9d1bbc817a..f06ed73adf99602dcedd63ab75366f049d226213 100644 (file)
@@ -733,7 +733,8 @@ next_step:
 
                        start_bidx = start_bidx_of_node(nofs, inode);
                        data_page = get_read_data_page(inode,
-                                       start_bidx + ofs_in_node, READA, true);
+                                       start_bidx + ofs_in_node, REQ_RAHEAD,
+                                       true);
                        if (IS_ERR(data_page)) {
                                iput(inode);
                                continue;
index e53403987f6d1cfcc237f29e17f9b896cb245b80..d1867698e6012ca263a04babc4502e1916cc16ad 100644 (file)
@@ -1119,7 +1119,7 @@ void ra_node_page(struct f2fs_sb_info *sbi, nid_t nid)
        if (!apage)
                return;
 
-       err = read_node_page(apage, READA);
+       err = read_node_page(apage, REQ_RAHEAD);
        f2fs_put_page(apage, err ? 1 : 0);
 }
 
index fd6389cf0f144f0b0942caef47c1b1a587e83ec7..6e2bec1cd28944eecd3d59f22f8a25ccf2facc4e 100644 (file)
@@ -285,7 +285,8 @@ static void gfs2_metapath_ra(struct gfs2_glock *gl,
                if (trylock_buffer(rabh)) {
                        if (!buffer_uptodate(rabh)) {
                                rabh->b_end_io = end_buffer_read_sync;
-                               submit_bh(REQ_OP_READ, READA | REQ_META, rabh);
+                               submit_bh(REQ_OP_READ, REQ_RAHEAD | REQ_META,
+                                               rabh);
                                continue;
                        }
                        unlock_buffer(rabh);
index 0fbb42679cefcc2517beeb4634b4a50286b101b7..f077cf5796ee2a8fc16f3c2e403539e2d7dcb1cd 100644 (file)
@@ -1513,7 +1513,7 @@ static void gfs2_dir_readahead(struct inode *inode, unsigned hsize, u32 index,
                                continue;
                        }
                        bh->b_end_io = end_buffer_read_sync;
-                       submit_bh(REQ_OP_READ, READA | REQ_META, bh);
+                       submit_bh(REQ_OP_READ, REQ_RAHEAD | REQ_META, bh);
                        continue;
                }
                brelse(bh);
index 052c1132e5b6e821b4f6a75539660d8a1655b1f0..950b8be68e415435d530196810ac733392c5035f 100644 (file)
@@ -459,7 +459,7 @@ struct buffer_head *gfs2_meta_ra(struct gfs2_glock *gl, u64 dblock, u32 extlen)
                bh = gfs2_getbuf(gl, dblock, CREATE);
 
                if (!buffer_uptodate(bh) && !buffer_locked(bh))
-                       ll_rw_block(REQ_OP_READ, READA | REQ_META, 1, &bh);
+                       ll_rw_block(REQ_OP_READ, REQ_RAHEAD | REQ_META, 1, &bh);
                brelse(bh);
                dblock++;
                extlen--;
index 64b29b592d86e70eb98422db1baebb0d1ace13f6..4032d1e87c8fabc0db9dd327ebc3c4c748e53541 100644 (file)
@@ -551,7 +551,7 @@ static int search_by_key_reada(struct super_block *s,
                if (!buffer_uptodate(bh[j])) {
                        if (depth == -1)
                                depth = reiserfs_write_unlock_nested(s);
-                       ll_rw_block(REQ_OP_READ, READA, 1, bh + j);
+                       ll_rw_block(REQ_OP_READ, REQ_RAHEAD, 1, bh + j);
                }
                brelse(bh[j]);
        }
index 80c8a21daed917f445fa10aced32c602cd2b401e..aaec13c952531dc733d31e048d3050f018b40eed 100644 (file)
@@ -113,7 +113,7 @@ static int udf_readdir(struct file *file, struct dir_context *ctx)
                                        brelse(tmp);
                        }
                        if (num) {
-                               ll_rw_block(REQ_OP_READ, READA, num, bha);
+                               ll_rw_block(REQ_OP_READ, REQ_RAHEAD, num, bha);
                                for (i = 0; i < num; i++)
                                        brelse(bha[i]);
                        }
index 71f3e0b5b8ab8be8eaecd91bb0d374f002b41b8a..988d5352bdb866e6108a03d3798492c206b034f9 100644 (file)
@@ -87,7 +87,7 @@ struct fileIdentDesc *udf_fileident_read(struct inode *dir, loff_t *nf_pos,
                                        brelse(tmp);
                        }
                        if (num) {
-                               ll_rw_block(REQ_OP_READ, READA, num, bha);
+                               ll_rw_block(REQ_OP_READ, REQ_RAHEAD, num, bha);
                                for (i = 0; i < num; i++)
                                        brelse(bha[i]);
                        }
index 183024525d40404fdc1300a6053e98cd6c02ef8f..dc488662ce0b46f1ab926c2ed2136e34f1d753a0 100644 (file)
@@ -178,9 +178,6 @@ typedef int (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
  * READ_SYNC           A synchronous read. Device is not plugged, caller can
  *                     immediately wait on this read without caring about
  *                     unplugging.
- * READA               Used for read-ahead operations. Lower priority, and the
- *                     block layer could (in theory) choose to ignore this
- *                     request if it runs into resource problems.
  * WRITE               A normal async write. Device will be plugged.
  * WRITE_SYNC          Synchronous write. Identical to WRITE, but passes down
  *                     the hint that someone will be waiting on this IO
@@ -195,11 +192,9 @@ typedef int (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
  *
  */
 #define RW_MASK                        REQ_OP_WRITE
-#define RWA_MASK               REQ_RAHEAD
 
 #define READ                   REQ_OP_READ
-#define WRITE                  RW_MASK
-#define READA                  RWA_MASK
+#define WRITE                  REQ_OP_WRITE
 
 #define READ_SYNC              REQ_SYNC
 #define WRITE_SYNC             (REQ_SYNC | REQ_NOIDLE)
@@ -2470,17 +2465,6 @@ static inline bool op_is_write(unsigned int op)
        return op == REQ_OP_READ ? false : true;
 }
 
-/*
- * return READ, READA, or WRITE
- */
-static inline int bio_rw(struct bio *bio)
-{
-       if (op_is_write(bio_op(bio)))
-               return WRITE;
-
-       return bio->bi_rw & RWA_MASK;
-}
-
 /*
  * return data direction, READ or WRITE
  */
index 878963a1f0587220d1ca0443c0fccd2d76ba8634..ff95fd02116f77ecd4cc5ca85ae4abc16c265339 100644 (file)
@@ -55,7 +55,7 @@ TRACE_DEFINE_ENUM(CP_DISCARD);
                { IPU,          "IN-PLACE" },                           \
                { OPU,          "OUT-OF-PLACE" })
 
-#define F2FS_BIO_FLAG_MASK(t)  (t & (READA | WRITE_FLUSH_FUA))
+#define F2FS_BIO_FLAG_MASK(t)  (t & (REQ_RAHEAD | WRITE_FLUSH_FUA))
 #define F2FS_BIO_EXTRA_MASK(t) (t & (REQ_META | REQ_PRIO))
 
 #define show_bio_type(op, op_flags) show_bio_op(op),                   \
@@ -68,7 +68,7 @@ TRACE_DEFINE_ENUM(CP_DISCARD);
 
 #define show_bio_op_flags(flags)                                       \
        __print_symbolic(F2FS_BIO_FLAG_MASK(flags),                     \
-               { READA,                "READAHEAD" },                  \
+               { REQ_RAHEAD,           "READAHEAD" },                  \
                { READ_SYNC,            "READ_SYNC" },                  \
                { WRITE_SYNC,           "WRITE_SYNC" },                 \
                { WRITE_FLUSH,          "WRITE_FLUSH" },                \