Commit 93dbb393503d53cd226e5e1f0088fe8f4dbaa2b8
1 parent
c1c201200a
Exists in
master
and in
7 other branches
block: fix bad definition of BIO_RW_SYNC
We can't OR shift values, so get rid of BIO_RW_SYNC and use BIO_RW_SYNCIO and BIO_RW_UNPLUG explicitly. This brings back the behaviour from before 213d9417fec62ef4c3675621b9364a667954d4dd. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Showing 9 changed files with 13 additions and 13 deletions Side-by-side Diff
block/blktrace.c
... | ... | @@ -142,7 +142,7 @@ |
142 | 142 | |
143 | 143 | what |= ddir_act[rw & WRITE]; |
144 | 144 | what |= MASK_TC_BIT(rw, BARRIER); |
145 | - what |= MASK_TC_BIT(rw, SYNC); | |
145 | + what |= MASK_TC_BIT(rw, SYNCIO); | |
146 | 146 | what |= MASK_TC_BIT(rw, AHEAD); |
147 | 147 | what |= MASK_TC_BIT(rw, META); |
148 | 148 | what |= MASK_TC_BIT(rw, DISCARD); |
drivers/md/dm-io.c
drivers/md/dm-kcopyd.c
... | ... | @@ -344,7 +344,7 @@ |
344 | 344 | { |
345 | 345 | int r; |
346 | 346 | struct dm_io_request io_req = { |
347 | - .bi_rw = job->rw | (1 << BIO_RW_SYNC), | |
347 | + .bi_rw = job->rw | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG), | |
348 | 348 | .mem.type = DM_IO_PAGE_LIST, |
349 | 349 | .mem.ptr.pl = job->pages, |
350 | 350 | .mem.offset = job->offset, |
drivers/md/md.c
... | ... | @@ -474,7 +474,7 @@ |
474 | 474 | * causes ENOTSUPP, we allocate a spare bio... |
475 | 475 | */ |
476 | 476 | struct bio *bio = bio_alloc(GFP_NOIO, 1); |
477 | - int rw = (1<<BIO_RW) | (1<<BIO_RW_SYNC); | |
477 | + int rw = (1<<BIO_RW) | (1<<BIO_RW_SYNCIO) | (1<<BIO_RW_UNPLUG); | |
478 | 478 | |
479 | 479 | bio->bi_bdev = rdev->bdev; |
480 | 480 | bio->bi_sector = sector; |
... | ... | @@ -531,7 +531,7 @@ |
531 | 531 | struct completion event; |
532 | 532 | int ret; |
533 | 533 | |
534 | - rw |= (1 << BIO_RW_SYNC); | |
534 | + rw |= (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG); | |
535 | 535 | |
536 | 536 | bio->bi_bdev = bdev; |
537 | 537 | bio->bi_sector = sector; |
include/linux/bio.h
include/linux/blktrace_api.h
... | ... | @@ -15,6 +15,7 @@ |
15 | 15 | BLK_TC_WRITE = 1 << 1, /* writes */ |
16 | 16 | BLK_TC_BARRIER = 1 << 2, /* barrier */ |
17 | 17 | BLK_TC_SYNC = 1 << 3, /* sync IO */ |
18 | + BLK_TC_SYNCIO = BLK_TC_SYNC, | |
18 | 19 | BLK_TC_QUEUE = 1 << 4, /* queueing/merging */ |
19 | 20 | BLK_TC_REQUEUE = 1 << 5, /* requeueing */ |
20 | 21 | BLK_TC_ISSUE = 1 << 6, /* issue */ |
include/linux/fs.h
... | ... | @@ -87,10 +87,10 @@ |
87 | 87 | #define WRITE 1 |
88 | 88 | #define READA 2 /* read-ahead - don't block if no resources */ |
89 | 89 | #define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */ |
90 | -#define READ_SYNC (READ | (1 << BIO_RW_SYNC)) | |
90 | +#define READ_SYNC (READ | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG)) | |
91 | 91 | #define READ_META (READ | (1 << BIO_RW_META)) |
92 | -#define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) | |
93 | -#define SWRITE_SYNC (SWRITE | (1 << BIO_RW_SYNC)) | |
92 | +#define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG)) | |
93 | +#define SWRITE_SYNC (SWRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG)) | |
94 | 94 | #define WRITE_BARRIER (WRITE | (1 << BIO_RW_BARRIER)) |
95 | 95 | #define DISCARD_NOBARRIER (1 << BIO_RW_DISCARD) |
96 | 96 | #define DISCARD_BARRIER ((1 << BIO_RW_DISCARD) | (1 << BIO_RW_BARRIER)) |
kernel/power/swap.c
... | ... | @@ -60,6 +60,7 @@ |
60 | 60 | static int submit(int rw, pgoff_t page_off, struct page *page, |
61 | 61 | struct bio **bio_chain) |
62 | 62 | { |
63 | + const int bio_rw = rw | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG); | |
63 | 64 | struct bio *bio; |
64 | 65 | |
65 | 66 | bio = bio_alloc(__GFP_WAIT | __GFP_HIGH, 1); |
... | ... | @@ -80,7 +81,7 @@ |
80 | 81 | bio_get(bio); |
81 | 82 | |
82 | 83 | if (bio_chain == NULL) { |
83 | - submit_bio(rw | (1 << BIO_RW_SYNC), bio); | |
84 | + submit_bio(bio_rw, bio); | |
84 | 85 | wait_on_page_locked(page); |
85 | 86 | if (rw == READ) |
86 | 87 | bio_set_pages_dirty(bio); |
... | ... | @@ -90,7 +91,7 @@ |
90 | 91 | get_page(page); /* These pages are freed later */ |
91 | 92 | bio->bi_private = *bio_chain; |
92 | 93 | *bio_chain = bio; |
93 | - submit_bio(rw | (1 << BIO_RW_SYNC), bio); | |
94 | + submit_bio(bio_rw, bio); | |
94 | 95 | } |
95 | 96 | return 0; |
96 | 97 | } |
mm/page_io.c