Commit 3fd83717 authored by NeilBrown's avatar NeilBrown

md: use set_bit/clear_bit instead of shift/mask for bi_flags changes.

Using {set,clear}_bit is more consistent than shifting and masking.

No functional change.
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 5965b642
...@@ -2722,7 +2722,7 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipp ...@@ -2722,7 +2722,7 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipp
/* remove last page from this bio */ /* remove last page from this bio */
bio->bi_vcnt--; bio->bi_vcnt--;
bio->bi_iter.bi_size -= len; bio->bi_iter.bi_size -= len;
bio->bi_flags &= ~(1<< BIO_SEG_VALID); __clear_bit(BIO_SEG_VALID, &bio->bi_flags);
} }
goto bio_full; goto bio_full;
} }
......
...@@ -3388,7 +3388,7 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, ...@@ -3388,7 +3388,7 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr,
/* remove last page from this bio */ /* remove last page from this bio */
bio2->bi_vcnt--; bio2->bi_vcnt--;
bio2->bi_iter.bi_size -= len; bio2->bi_iter.bi_size -= len;
bio2->bi_flags &= ~(1<< BIO_SEG_VALID); __clear_bit(BIO_SEG_VALID, &bio2->bi_flags);
} }
goto bio_full; goto bio_full;
} }
...@@ -4416,7 +4416,7 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr, ...@@ -4416,7 +4416,7 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr,
read_bio->bi_end_io = end_sync_read; read_bio->bi_end_io = end_sync_read;
read_bio->bi_rw = READ; read_bio->bi_rw = READ;
read_bio->bi_flags &= (~0UL << BIO_RESET_BITS); read_bio->bi_flags &= (~0UL << BIO_RESET_BITS);
read_bio->bi_flags |= 1 << BIO_UPTODATE; __set_bit(BIO_UPTODATE, &read_bio->bi_flags);
read_bio->bi_vcnt = 0; read_bio->bi_vcnt = 0;
read_bio->bi_iter.bi_size = 0; read_bio->bi_iter.bi_size = 0;
r10_bio->master_bio = read_bio; r10_bio->master_bio = read_bio;
...@@ -4473,7 +4473,7 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr, ...@@ -4473,7 +4473,7 @@ static sector_t reshape_request(struct mddev *mddev, sector_t sector_nr,
/* Remove last page from this bio */ /* Remove last page from this bio */
bio2->bi_vcnt--; bio2->bi_vcnt--;
bio2->bi_iter.bi_size -= len; bio2->bi_iter.bi_size -= len;
bio2->bi_flags &= ~(1<<BIO_SEG_VALID); __clear_bit(BIO_SEG_VALID, &bio2->bi_flags);
} }
goto bio_full; goto bio_full;
} }
......
...@@ -4301,7 +4301,7 @@ static int chunk_aligned_read(struct mddev *mddev, struct bio * raid_bio) ...@@ -4301,7 +4301,7 @@ static int chunk_aligned_read(struct mddev *mddev, struct bio * raid_bio)
rcu_read_unlock(); rcu_read_unlock();
raid_bio->bi_next = (void*)rdev; raid_bio->bi_next = (void*)rdev;
align_bi->bi_bdev = rdev->bdev; align_bi->bi_bdev = rdev->bdev;
align_bi->bi_flags &= ~(1 << BIO_SEG_VALID); __clear_bit(BIO_SEG_VALID, &align_bi->bi_flags);
if (!bio_fits_rdev(align_bi) || if (!bio_fits_rdev(align_bi) ||
is_badblock(rdev, align_bi->bi_iter.bi_sector, is_badblock(rdev, align_bi->bi_iter.bi_sector,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment