diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-11 19:14:22 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-11 19:14:22 -0700 |
commit | 1ce48904285fe4b0298864f9153a8502ebeac35c (patch) | |
tree | ffe1e0c31cdea427b48ae4d4d59a96ff9d208f32 /drivers/md/md.c | |
parent | 55982fd184a065b1c69279d29cbc01dbf424d2f4 (diff) | |
parent | 780513ecb80ea0934fc6833efc4f5ed9ab4ff9bb (diff) |
Merge branch 'block-2.6.24' of git://git.kernel.dk/data/git/linux-2.6-block
* 'block-2.6.24' of git://git.kernel.dk/data/git/linux-2.6-block: (37 commits)
[BLOCK] Fix failing compile with BLK_DEV_IO_TRACE=n
compat_ioctl: move floppy handlers to block/compat_ioctl.c
compat_ioctl: move cdrom handlers to block/compat_ioctl.c
compat_ioctl: move BLKPG handling to block/compat_ioctl.c
compat_ioctl: move hdio calls to block/compat_ioctl.c
compat_ioctl: handle blk_trace ioctls
compat_ioctl: add compat_blkdev_driver_ioctl()
compat_ioctl: move common block ioctls to compat_blkdev_ioctl
Sysace: Don't enable IRQ until after interrupt handler is registered
Sysace: sparse fixes
Sysace: Minor coding convention fixup
drivers/block/umem: use DRIVER_NAME where appropriate
drivers/block/umem: trim trailing whitespace
drivers/block/umem: minor cleanups
drivers/block/umem: use dev_printk()
drivers/block/umem: move private include away from include/linux
Sysace: Labels in C code should not be indented.
Sysace: Add of_platform_bus binding
Sysace: Move IRQ handler registration to occur after FSM is initialized
Sysace: minor rework and cleanup changes
...
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index f883b7e37f3..e8f102ea9b0 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -213,7 +213,7 @@ static DEFINE_SPINLOCK(all_mddevs_lock); static int md_fail_request (struct request_queue *q, struct bio *bio) { - bio_io_error(bio, bio->bi_size); + bio_io_error(bio); return 0; } @@ -384,12 +384,10 @@ static void free_disk_sb(mdk_rdev_t * rdev) } -static int super_written(struct bio *bio, unsigned int bytes_done, int error) +static void super_written(struct bio *bio, int error) { mdk_rdev_t *rdev = bio->bi_private; mddev_t *mddev = rdev->mddev; - if (bio->bi_size) - return 1; if (error || !test_bit(BIO_UPTODATE, &bio->bi_flags)) { printk("md: super_written gets error=%d, uptodate=%d\n", @@ -401,16 +399,13 @@ static int super_written(struct bio *bio, unsigned int bytes_done, int error) if (atomic_dec_and_test(&mddev->pending_writes)) wake_up(&mddev->sb_wait); bio_put(bio); - return 0; } -static int super_written_barrier(struct bio *bio, unsigned int bytes_done, int error) +static void super_written_barrier(struct bio *bio, int error) { struct bio *bio2 = bio->bi_private; mdk_rdev_t *rdev = bio2->bi_private; mddev_t *mddev = rdev->mddev; - if (bio->bi_size) - return 1; if (!test_bit(BIO_UPTODATE, &bio->bi_flags) && error == -EOPNOTSUPP) { @@ -424,11 +419,11 @@ static int super_written_barrier(struct bio *bio, unsigned int bytes_done, int e spin_unlock_irqrestore(&mddev->write_lock, flags); wake_up(&mddev->sb_wait); bio_put(bio); - return 0; + } else { + bio_put(bio2); + bio->bi_private = rdev; + super_written(bio, error); } - bio_put(bio2); - bio->bi_private = rdev; - return super_written(bio, bytes_done, error); } void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, @@ -489,13 +484,9 @@ void md_super_wait(mddev_t *mddev) finish_wait(&mddev->sb_wait, &wq); } -static int bi_complete(struct bio *bio, unsigned int bytes_done, int error) +static void bi_complete(struct bio *bio, int error) { - if (bio->bi_size) - return 1; - complete((struct completion*)bio->bi_private); - return 0; } int sync_page_io(struct block_device *bdev, sector_t sector, int size, |