diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-04 15:39:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-10-04 15:39:14 -0400 |
commit | 58e57fbd1c7e8833314459555e337364fe5521f3 (patch) | |
tree | 242a3859387588889c9dcc45915b0dec951f84c3 /drivers/md | |
parent | 8a0382f6fceaf0c6479e582e1054f36333ea3d24 (diff) | |
parent | 0f78ab9899e9d6acb09d5465def618704255963b (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block: (41 commits)
Revert "Seperate read and write statistics of in_flight requests"
cfq-iosched: don't delay async queue if it hasn't dispatched at all
block: Topology ioctls
cfq-iosched: use assigned slice sync value, not default
cfq-iosched: rename 'desktop' sysfs entry to 'low_latency'
cfq-iosched: implement slower async initiate and queue ramp up
cfq-iosched: delay async IO dispatch, if sync IO was just done
cfq-iosched: add a knob for desktop interactiveness
Add a tracepoint for block request remapping
block: allow large discard requests
block: use normal I/O path for discard requests
swapfile: avoid NULL pointer dereference in swapon when s_bdev is NULL
fs/bio.c: move EXPORT* macros to line after function
Add missing blk_trace_remove_sysfs to be in pair with blk_trace_init_sysfs
cciss: fix build when !PROC_FS
block: Do not clamp max_hw_sectors for stacking devices
block: Set max_sectors correctly for stacking devices
cciss: cciss_host_attr_groups should be const
cciss: Dynamically allocate the drive_info_struct for each logical drive.
cciss: Add usage_count attribute to each logical drive in /sys
...
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 376f1ab48a24..23e76fe0d359 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -130,7 +130,7 @@ struct mapped_device { | |||
130 | /* | 130 | /* |
131 | * A list of ios that arrived while we were suspended. | 131 | * A list of ios that arrived while we were suspended. |
132 | */ | 132 | */ |
133 | atomic_t pending[2]; | 133 | atomic_t pending; |
134 | wait_queue_head_t wait; | 134 | wait_queue_head_t wait; |
135 | struct work_struct work; | 135 | struct work_struct work; |
136 | struct bio_list deferred; | 136 | struct bio_list deferred; |
@@ -453,14 +453,13 @@ static void start_io_acct(struct dm_io *io) | |||
453 | { | 453 | { |
454 | struct mapped_device *md = io->md; | 454 | struct mapped_device *md = io->md; |
455 | int cpu; | 455 | int cpu; |
456 | int rw = bio_data_dir(io->bio); | ||
457 | 456 | ||
458 | io->start_time = jiffies; | 457 | io->start_time = jiffies; |
459 | 458 | ||
460 | cpu = part_stat_lock(); | 459 | cpu = part_stat_lock(); |
461 | part_round_stats(cpu, &dm_disk(md)->part0); | 460 | part_round_stats(cpu, &dm_disk(md)->part0); |
462 | part_stat_unlock(); | 461 | part_stat_unlock(); |
463 | dm_disk(md)->part0.in_flight[rw] = atomic_inc_return(&md->pending[rw]); | 462 | dm_disk(md)->part0.in_flight = atomic_inc_return(&md->pending); |
464 | } | 463 | } |
465 | 464 | ||
466 | static void end_io_acct(struct dm_io *io) | 465 | static void end_io_acct(struct dm_io *io) |
@@ -480,9 +479,8 @@ static void end_io_acct(struct dm_io *io) | |||
480 | * After this is decremented the bio must not be touched if it is | 479 | * After this is decremented the bio must not be touched if it is |
481 | * a barrier. | 480 | * a barrier. |
482 | */ | 481 | */ |
483 | dm_disk(md)->part0.in_flight[rw] = pending = | 482 | dm_disk(md)->part0.in_flight = pending = |
484 | atomic_dec_return(&md->pending[rw]); | 483 | atomic_dec_return(&md->pending); |
485 | pending += atomic_read(&md->pending[rw^0x1]); | ||
486 | 484 | ||
487 | /* nudge anyone waiting on suspend queue */ | 485 | /* nudge anyone waiting on suspend queue */ |
488 | if (!pending) | 486 | if (!pending) |
@@ -1787,8 +1785,7 @@ static struct mapped_device *alloc_dev(int minor) | |||
1787 | if (!md->disk) | 1785 | if (!md->disk) |
1788 | goto bad_disk; | 1786 | goto bad_disk; |
1789 | 1787 | ||
1790 | atomic_set(&md->pending[0], 0); | 1788 | atomic_set(&md->pending, 0); |
1791 | atomic_set(&md->pending[1], 0); | ||
1792 | init_waitqueue_head(&md->wait); | 1789 | init_waitqueue_head(&md->wait); |
1793 | INIT_WORK(&md->work, dm_wq_work); | 1790 | INIT_WORK(&md->work, dm_wq_work); |
1794 | init_waitqueue_head(&md->eventq); | 1791 | init_waitqueue_head(&md->eventq); |
@@ -2091,8 +2088,7 @@ static int dm_wait_for_completion(struct mapped_device *md, int interruptible) | |||
2091 | break; | 2088 | break; |
2092 | } | 2089 | } |
2093 | spin_unlock_irqrestore(q->queue_lock, flags); | 2090 | spin_unlock_irqrestore(q->queue_lock, flags); |
2094 | } else if (!atomic_read(&md->pending[0]) && | 2091 | } else if (!atomic_read(&md->pending)) |
2095 | !atomic_read(&md->pending[1])) | ||
2096 | break; | 2092 | break; |
2097 | 2093 | ||
2098 | if (interruptible == TASK_INTERRUPTIBLE && | 2094 | if (interruptible == TASK_INTERRUPTIBLE && |