Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93dbb393 authored by Jens Axboe's avatar Jens Axboe
Browse files

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
213d9417.

Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent c1c20120
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -142,7 +142,7 @@ static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,

	what |= ddir_act[rw & WRITE];
	what |= MASK_TC_BIT(rw, BARRIER);
	what |= MASK_TC_BIT(rw, SYNC);
	what |= MASK_TC_BIT(rw, SYNCIO);
	what |= MASK_TC_BIT(rw, AHEAD);
	what |= MASK_TC_BIT(rw, META);
	what |= MASK_TC_BIT(rw, DISCARD);
+1 −1
Original line number Diff line number Diff line
@@ -328,7 +328,7 @@ static void dispatch_io(int rw, unsigned int num_regions,
	struct dpages old_pages = *dp;

	if (sync)
		rw |= (1 << BIO_RW_SYNC);
		rw |= (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG);

	/*
	 * For multiple regions we need to be careful to rewind
+1 −1
Original line number Diff line number Diff line
@@ -344,7 +344,7 @@ static int run_io_job(struct kcopyd_job *job)
{
	int r;
	struct dm_io_request io_req = {
		.bi_rw = job->rw | (1 << BIO_RW_SYNC),
		.bi_rw = job->rw | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG),
		.mem.type = DM_IO_PAGE_LIST,
		.mem.ptr.pl = job->pages,
		.mem.offset = job->offset,
+2 −2
Original line number Diff line number Diff line
@@ -474,7 +474,7 @@ void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev,
	 * causes ENOTSUPP, we allocate a spare bio...
	 */
	struct bio *bio = bio_alloc(GFP_NOIO, 1);
	int rw = (1<<BIO_RW) | (1<<BIO_RW_SYNC);
	int rw = (1<<BIO_RW) | (1<<BIO_RW_SYNCIO) | (1<<BIO_RW_UNPLUG);

	bio->bi_bdev = rdev->bdev;
	bio->bi_sector = sector;
@@ -531,7 +531,7 @@ int sync_page_io(struct block_device *bdev, sector_t sector, int size,
	struct completion event;
	int ret;

	rw |= (1 << BIO_RW_SYNC);
	rw |= (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG);

	bio->bi_bdev = bdev;
	bio->bi_sector = sector;
+0 −2
Original line number Diff line number Diff line
@@ -171,8 +171,6 @@ struct bio {
#define BIO_RW_FAILFAST_TRANSPORT	8
#define BIO_RW_FAILFAST_DRIVER		9

#define BIO_RW_SYNC	(BIO_RW_SYNCIO | BIO_RW_UNPLUG)

#define bio_rw_flagged(bio, flag)	((bio)->bi_rw & (1 << (flag)))

/*
Loading