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 /fs/direct-io.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 'fs/direct-io.c')
-rw-r--r-- | fs/direct-io.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/fs/direct-io.c b/fs/direct-io.c index 901dc55e9f54..b5928a7b6a5a 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c | |||
@@ -264,15 +264,12 @@ static int dio_bio_complete(struct dio *dio, struct bio *bio); | |||
264 | /* | 264 | /* |
265 | * Asynchronous IO callback. | 265 | * Asynchronous IO callback. |
266 | */ | 266 | */ |
267 | static int dio_bio_end_aio(struct bio *bio, unsigned int bytes_done, int error) | 267 | static void dio_bio_end_aio(struct bio *bio, int error) |
268 | { | 268 | { |
269 | struct dio *dio = bio->bi_private; | 269 | struct dio *dio = bio->bi_private; |
270 | unsigned long remaining; | 270 | unsigned long remaining; |
271 | unsigned long flags; | 271 | unsigned long flags; |
272 | 272 | ||
273 | if (bio->bi_size) | ||
274 | return 1; | ||
275 | |||
276 | /* cleanup the bio */ | 273 | /* cleanup the bio */ |
277 | dio_bio_complete(dio, bio); | 274 | dio_bio_complete(dio, bio); |
278 | 275 | ||
@@ -287,8 +284,6 @@ static int dio_bio_end_aio(struct bio *bio, unsigned int bytes_done, int error) | |||
287 | aio_complete(dio->iocb, ret, 0); | 284 | aio_complete(dio->iocb, ret, 0); |
288 | kfree(dio); | 285 | kfree(dio); |
289 | } | 286 | } |
290 | |||
291 | return 0; | ||
292 | } | 287 | } |
293 | 288 | ||
294 | /* | 289 | /* |
@@ -298,21 +293,17 @@ static int dio_bio_end_aio(struct bio *bio, unsigned int bytes_done, int error) | |||
298 | * During I/O bi_private points at the dio. After I/O, bi_private is used to | 293 | * During I/O bi_private points at the dio. After I/O, bi_private is used to |
299 | * implement a singly-linked list of completed BIOs, at dio->bio_list. | 294 | * implement a singly-linked list of completed BIOs, at dio->bio_list. |
300 | */ | 295 | */ |
301 | static int dio_bio_end_io(struct bio *bio, unsigned int bytes_done, int error) | 296 | static void dio_bio_end_io(struct bio *bio, int error) |
302 | { | 297 | { |
303 | struct dio *dio = bio->bi_private; | 298 | struct dio *dio = bio->bi_private; |
304 | unsigned long flags; | 299 | unsigned long flags; |
305 | 300 | ||
306 | if (bio->bi_size) | ||
307 | return 1; | ||
308 | |||
309 | spin_lock_irqsave(&dio->bio_lock, flags); | 301 | spin_lock_irqsave(&dio->bio_lock, flags); |
310 | bio->bi_private = dio->bio_list; | 302 | bio->bi_private = dio->bio_list; |
311 | dio->bio_list = bio; | 303 | dio->bio_list = bio; |
312 | if (--dio->refcount == 1 && dio->waiter) | 304 | if (--dio->refcount == 1 && dio->waiter) |
313 | wake_up_process(dio->waiter); | 305 | wake_up_process(dio->waiter); |
314 | spin_unlock_irqrestore(&dio->bio_lock, flags); | 306 | spin_unlock_irqrestore(&dio->bio_lock, flags); |
315 | return 0; | ||
316 | } | 307 | } |
317 | 308 | ||
318 | static int | 309 | static int |