diff options
author | Kent Overstreet <koverstreet@google.com> | 2012-09-25 18:05:12 -0400 |
---|---|---|
committer | Kent Overstreet <koverstreet@google.com> | 2013-03-23 17:15:29 -0400 |
commit | f73a1c7d117d07a96d89475066188a2b79e53c48 (patch) | |
tree | b2343926df6cf7877ee398ba485a962148b67804 /drivers/md/raid1.c | |
parent | fb9e3534768c1daa0bd09dd00d1a8828e15079c8 (diff) |
block: Add bio_end_sector()
Just a little convenience macro - main reason to add it now is preparing
for immutable bio vecs, it'll reduce the size of the patch that puts
bi_sector/bi_size/bi_idx into a struct bvec_iter.
Signed-off-by: Kent Overstreet <koverstreet@google.com>
CC: Jens Axboe <axboe@kernel.dk>
CC: Lars Ellenberg <drbd-dev@lists.linbit.com>
CC: Jiri Kosina <jkosina@suse.cz>
CC: Alasdair Kergon <agk@redhat.com>
CC: dm-devel@redhat.com
CC: Neil Brown <neilb@suse.de>
CC: Martin Schwidefsky <schwidefsky@de.ibm.com>
CC: Heiko Carstens <heiko.carstens@de.ibm.com>
CC: linux-s390@vger.kernel.org
CC: Chris Mason <chris.mason@fusionio.com>
CC: Steven Whitehouse <swhiteho@redhat.com>
Acked-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r-- | drivers/md/raid1.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index fd86b372692d..4d8c2e0a6bad 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -1018,7 +1018,7 @@ static void make_request(struct mddev *mddev, struct bio * bio) | |||
1018 | md_write_start(mddev, bio); /* wait on superblock update early */ | 1018 | md_write_start(mddev, bio); /* wait on superblock update early */ |
1019 | 1019 | ||
1020 | if (bio_data_dir(bio) == WRITE && | 1020 | if (bio_data_dir(bio) == WRITE && |
1021 | bio->bi_sector + bio->bi_size/512 > mddev->suspend_lo && | 1021 | bio_end_sector(bio) > mddev->suspend_lo && |
1022 | bio->bi_sector < mddev->suspend_hi) { | 1022 | bio->bi_sector < mddev->suspend_hi) { |
1023 | /* As the suspend_* range is controlled by | 1023 | /* As the suspend_* range is controlled by |
1024 | * userspace, we want an interruptible | 1024 | * userspace, we want an interruptible |
@@ -1029,7 +1029,7 @@ static void make_request(struct mddev *mddev, struct bio * bio) | |||
1029 | flush_signals(current); | 1029 | flush_signals(current); |
1030 | prepare_to_wait(&conf->wait_barrier, | 1030 | prepare_to_wait(&conf->wait_barrier, |
1031 | &w, TASK_INTERRUPTIBLE); | 1031 | &w, TASK_INTERRUPTIBLE); |
1032 | if (bio->bi_sector + bio->bi_size/512 <= mddev->suspend_lo || | 1032 | if (bio_end_sector(bio) <= mddev->suspend_lo || |
1033 | bio->bi_sector >= mddev->suspend_hi) | 1033 | bio->bi_sector >= mddev->suspend_hi) |
1034 | break; | 1034 | break; |
1035 | schedule(); | 1035 | schedule(); |