Commit 93dbb393503d53cd226e5e1f0088fe8f4dbaa2b8

Authored by Jens Axboe
1 parent c1c201200a

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

... ... @@ -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);
... ... @@ -328,7 +328,7 @@
328 328 struct dpages old_pages = *dp;
329 329  
330 330 if (sync)
331   - rw |= (1 << BIO_RW_SYNC);
  331 + rw |= (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG);
332 332  
333 333 /*
334 334 * For multiple regions we need to be careful to rewind
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,
... ... @@ -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;
... ... @@ -171,8 +171,6 @@
171 171 #define BIO_RW_FAILFAST_TRANSPORT 8
172 172 #define BIO_RW_FAILFAST_DRIVER 9
173 173  
174   -#define BIO_RW_SYNC (BIO_RW_SYNCIO | BIO_RW_UNPLUG)
175   -
176 174 #define bio_rw_flagged(bio, flag) ((bio)->bi_rw & (1 << (flag)))
177 175  
178 176 /*
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 */
... ... @@ -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))
... ... @@ -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 }
... ... @@ -111,7 +111,7 @@
111 111 goto out;
112 112 }
113 113 if (wbc->sync_mode == WB_SYNC_ALL)
114   - rw |= (1 << BIO_RW_SYNC);
  114 + rw |= (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG);
115 115 count_vm_event(PSWPOUT);
116 116 set_page_writeback(page);
117 117 unlock_page(page);