aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-zero.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2016-10-13 17:25:40 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2016-10-13 17:25:40 -0700
commit4a7126a25b4dfd07d61c699f724118275acc0c25 (patch)
treec78b82bfaa96f330d412ad63e355906f963c3faf /drivers/md/dm-zero.c
parentInput: i8042 - skip selftest on ASUS laptops (diff)
parentLinux 4.8 (diff)
downloadlinux-dev-4a7126a25b4dfd07d61c699f724118275acc0c25.tar.xz
linux-dev-4a7126a25b4dfd07d61c699f724118275acc0c25.zip
Merge tag 'v4.8' into next
Sync up with mainline to bring in I2C host notify changes and other updates.
Diffstat (limited to 'drivers/md/dm-zero.c')
-rw-r--r--drivers/md/dm-zero.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/md/dm-zero.c b/drivers/md/dm-zero.c
index 766bc93006e6..b616f11d8473 100644
--- a/drivers/md/dm-zero.c
+++ b/drivers/md/dm-zero.c
@@ -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_opf & 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);