diff options
author | NeilBrown <neilb@suse.de> | 2007-09-27 06:47:43 -0400 |
---|---|---|
committer | Jens Axboe <axboe@carl.home.kernel.dk> | 2007-10-10 03:25:57 -0400 |
commit | 6712ecf8f648118c3363c142196418f89a510b90 (patch) | |
tree | 347d39a7d5a7ed96d3b1afecd28de2a0f98b98c9 /drivers/md/multipath.c | |
parent | 5bb23a688b2de23d7765a1dd439d89c038378978 (diff) |
Drop 'size' argument from bio_endio and bi_end_io
As bi_end_io is only called once when the reqeust is complete,
the 'size' argument is now redundant. Remove it.
Now there is no need for bio_endio to subtract the size completed
from bi_size. So don't do that either.
While we are at it, change bi_end_io to return void.
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/md/multipath.c')
-rw-r--r-- | drivers/md/multipath.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c index 1e2af43a73b9..f2a63f394ad9 100644 --- a/drivers/md/multipath.c +++ b/drivers/md/multipath.c | |||
@@ -82,21 +82,17 @@ static void multipath_end_bh_io (struct multipath_bh *mp_bh, int err) | |||
82 | struct bio *bio = mp_bh->master_bio; | 82 | struct bio *bio = mp_bh->master_bio; |
83 | multipath_conf_t *conf = mddev_to_conf(mp_bh->mddev); | 83 | multipath_conf_t *conf = mddev_to_conf(mp_bh->mddev); |
84 | 84 | ||
85 | bio_endio(bio, bio->bi_size, err); | 85 | bio_endio(bio, err); |
86 | mempool_free(mp_bh, conf->pool); | 86 | mempool_free(mp_bh, conf->pool); |
87 | } | 87 | } |
88 | 88 | ||
89 | static int multipath_end_request(struct bio *bio, unsigned int bytes_done, | 89 | static void multipath_end_request(struct bio *bio, int error) |
90 | int error) | ||
91 | { | 90 | { |
92 | int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); | 91 | int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); |
93 | struct multipath_bh * mp_bh = (struct multipath_bh *)(bio->bi_private); | 92 | struct multipath_bh * mp_bh = (struct multipath_bh *)(bio->bi_private); |
94 | multipath_conf_t *conf = mddev_to_conf(mp_bh->mddev); | 93 | multipath_conf_t *conf = mddev_to_conf(mp_bh->mddev); |
95 | mdk_rdev_t *rdev = conf->multipaths[mp_bh->path].rdev; | 94 | mdk_rdev_t *rdev = conf->multipaths[mp_bh->path].rdev; |
96 | 95 | ||
97 | if (bio->bi_size) | ||
98 | return 1; | ||
99 | |||
100 | if (uptodate) | 96 | if (uptodate) |
101 | multipath_end_bh_io(mp_bh, 0); | 97 | multipath_end_bh_io(mp_bh, 0); |
102 | else if (!bio_rw_ahead(bio)) { | 98 | else if (!bio_rw_ahead(bio)) { |
@@ -112,7 +108,6 @@ static int multipath_end_request(struct bio *bio, unsigned int bytes_done, | |||
112 | } else | 108 | } else |
113 | multipath_end_bh_io(mp_bh, error); | 109 | multipath_end_bh_io(mp_bh, error); |
114 | rdev_dec_pending(rdev, conf->mddev); | 110 | rdev_dec_pending(rdev, conf->mddev); |
115 | return 0; | ||
116 | } | 111 | } |
117 | 112 | ||
118 | static void unplug_slaves(mddev_t *mddev) | 113 | static void unplug_slaves(mddev_t *mddev) |
@@ -155,7 +150,7 @@ static int multipath_make_request (struct request_queue *q, struct bio * bio) | |||
155 | const int rw = bio_data_dir(bio); | 150 | const int rw = bio_data_dir(bio); |
156 | 151 | ||
157 | if (unlikely(bio_barrier(bio))) { | 152 | if (unlikely(bio_barrier(bio))) { |
158 | bio_endio(bio, bio->bi_size, -EOPNOTSUPP); | 153 | bio_endio(bio, -EOPNOTSUPP); |
159 | return 0; | 154 | return 0; |
160 | } | 155 | } |
161 | 156 | ||
@@ -169,7 +164,7 @@ static int multipath_make_request (struct request_queue *q, struct bio * bio) | |||
169 | 164 | ||
170 | mp_bh->path = multipath_map(conf); | 165 | mp_bh->path = multipath_map(conf); |
171 | if (mp_bh->path < 0) { | 166 | if (mp_bh->path < 0) { |
172 | bio_endio(bio, bio->bi_size, -EIO); | 167 | bio_endio(bio, -EIO); |
173 | mempool_free(mp_bh, conf->pool); | 168 | mempool_free(mp_bh, conf->pool); |
174 | return 0; | 169 | return 0; |
175 | } | 170 | } |