mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
Merge branch 'for-2.6.32' of git://git.kernel.dk/linux-2.6-block
* 'for-2.6.32' of git://git.kernel.dk/linux-2.6-block: (29 commits) block: use blkdev_issue_discard in blk_ioctl_discard Make DISCARD_BARRIER and DISCARD_NOBARRIER writes instead of reads block: don't assume device has a request list backing in nr_requests store block: Optimal I/O limit wrapper cfq: choose a new next_req when a request is dispatched Seperate read and write statistics of in_flight requests aoe: end barrier bios with EOPNOTSUPP block: trace bio queueing trial only when it occurs block: enable rq CPU completion affinity by default cfq: fix the log message after dispatched a request block: use printk_once cciss: memory leak in cciss_init_one() splice: update mtime and atime on files block: make blk_iopoll_prep_sched() follow normal 0/1 return convention cfq-iosched: get rid of must_alloc flag block: use interrupts disabled version of raise_softirq_irqoff() block: fix comment in blk-iopoll.c block: adjust default budget for blk-iopoll block: fix long lines in block/blk-iopoll.c block: add blk-iopoll, a NAPI like approach for block devices ...
This commit is contained in:
commit
355bbd8cb8
42 changed files with 729 additions and 284 deletions
|
|
@ -1129,7 +1129,7 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio,
|
|||
if (error == -EOPNOTSUPP)
|
||||
goto out;
|
||||
|
||||
if ((error == -EWOULDBLOCK) && bio_rw_ahead(bio))
|
||||
if ((error == -EWOULDBLOCK) && bio_rw_flagged(bio, BIO_RW_AHEAD))
|
||||
goto out;
|
||||
|
||||
if (unlikely(error)) {
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ static int stripe_end_io(struct dm_target *ti, struct bio *bio,
|
|||
if (!error)
|
||||
return 0; /* I/O complete */
|
||||
|
||||
if ((error == -EWOULDBLOCK) && bio_rw_ahead(bio))
|
||||
if ((error == -EWOULDBLOCK) && bio_rw_flagged(bio, BIO_RW_AHEAD))
|
||||
return error;
|
||||
|
||||
if (error == -EOPNOTSUPP)
|
||||
|
|
@ -336,7 +336,7 @@ static void stripe_io_hints(struct dm_target *ti,
|
|||
unsigned chunk_size = (sc->chunk_mask + 1) << 9;
|
||||
|
||||
blk_limits_io_min(limits, chunk_size);
|
||||
limits->io_opt = chunk_size * sc->stripes;
|
||||
blk_limits_io_opt(limits, chunk_size * sc->stripes);
|
||||
}
|
||||
|
||||
static struct target_type stripe_target = {
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ struct mapped_device {
|
|||
/*
|
||||
* A list of ios that arrived while we were suspended.
|
||||
*/
|
||||
atomic_t pending;
|
||||
atomic_t pending[2];
|
||||
wait_queue_head_t wait;
|
||||
struct work_struct work;
|
||||
struct bio_list deferred;
|
||||
|
|
@ -453,13 +453,14 @@ static void start_io_acct(struct dm_io *io)
|
|||
{
|
||||
struct mapped_device *md = io->md;
|
||||
int cpu;
|
||||
int rw = bio_data_dir(io->bio);
|
||||
|
||||
io->start_time = jiffies;
|
||||
|
||||
cpu = part_stat_lock();
|
||||
part_round_stats(cpu, &dm_disk(md)->part0);
|
||||
part_stat_unlock();
|
||||
dm_disk(md)->part0.in_flight = atomic_inc_return(&md->pending);
|
||||
dm_disk(md)->part0.in_flight[rw] = atomic_inc_return(&md->pending[rw]);
|
||||
}
|
||||
|
||||
static void end_io_acct(struct dm_io *io)
|
||||
|
|
@ -479,8 +480,9 @@ static void end_io_acct(struct dm_io *io)
|
|||
* After this is decremented the bio must not be touched if it is
|
||||
* a barrier.
|
||||
*/
|
||||
dm_disk(md)->part0.in_flight = pending =
|
||||
atomic_dec_return(&md->pending);
|
||||
dm_disk(md)->part0.in_flight[rw] = pending =
|
||||
atomic_dec_return(&md->pending[rw]);
|
||||
pending += atomic_read(&md->pending[rw^0x1]);
|
||||
|
||||
/* nudge anyone waiting on suspend queue */
|
||||
if (!pending)
|
||||
|
|
@ -586,7 +588,7 @@ static void dec_pending(struct dm_io *io, int error)
|
|||
*/
|
||||
spin_lock_irqsave(&md->deferred_lock, flags);
|
||||
if (__noflush_suspending(md)) {
|
||||
if (!bio_barrier(io->bio))
|
||||
if (!bio_rw_flagged(io->bio, BIO_RW_BARRIER))
|
||||
bio_list_add_head(&md->deferred,
|
||||
io->bio);
|
||||
} else
|
||||
|
|
@ -598,7 +600,7 @@ static void dec_pending(struct dm_io *io, int error)
|
|||
io_error = io->error;
|
||||
bio = io->bio;
|
||||
|
||||
if (bio_barrier(bio)) {
|
||||
if (bio_rw_flagged(bio, BIO_RW_BARRIER)) {
|
||||
/*
|
||||
* There can be just one barrier request so we use
|
||||
* a per-device variable for error reporting.
|
||||
|
|
@ -1209,7 +1211,7 @@ static void __split_and_process_bio(struct mapped_device *md, struct bio *bio)
|
|||
|
||||
ci.map = dm_get_table(md);
|
||||
if (unlikely(!ci.map)) {
|
||||
if (!bio_barrier(bio))
|
||||
if (!bio_rw_flagged(bio, BIO_RW_BARRIER))
|
||||
bio_io_error(bio);
|
||||
else
|
||||
if (!md->barrier_error)
|
||||
|
|
@ -1321,7 +1323,7 @@ static int _dm_request(struct request_queue *q, struct bio *bio)
|
|||
* we have to queue this io for later.
|
||||
*/
|
||||
if (unlikely(test_bit(DMF_QUEUE_IO_TO_THREAD, &md->flags)) ||
|
||||
unlikely(bio_barrier(bio))) {
|
||||
unlikely(bio_rw_flagged(bio, BIO_RW_BARRIER))) {
|
||||
up_read(&md->io_lock);
|
||||
|
||||
if (unlikely(test_bit(DMF_BLOCK_IO_FOR_SUSPEND, &md->flags)) &&
|
||||
|
|
@ -1344,7 +1346,7 @@ static int dm_make_request(struct request_queue *q, struct bio *bio)
|
|||
{
|
||||
struct mapped_device *md = q->queuedata;
|
||||
|
||||
if (unlikely(bio_barrier(bio))) {
|
||||
if (unlikely(bio_rw_flagged(bio, BIO_RW_BARRIER))) {
|
||||
bio_endio(bio, -EOPNOTSUPP);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1785,7 +1787,8 @@ static struct mapped_device *alloc_dev(int minor)
|
|||
if (!md->disk)
|
||||
goto bad_disk;
|
||||
|
||||
atomic_set(&md->pending, 0);
|
||||
atomic_set(&md->pending[0], 0);
|
||||
atomic_set(&md->pending[1], 0);
|
||||
init_waitqueue_head(&md->wait);
|
||||
INIT_WORK(&md->work, dm_wq_work);
|
||||
init_waitqueue_head(&md->eventq);
|
||||
|
|
@ -2088,7 +2091,8 @@ static int dm_wait_for_completion(struct mapped_device *md, int interruptible)
|
|||
break;
|
||||
}
|
||||
spin_unlock_irqrestore(q->queue_lock, flags);
|
||||
} else if (!atomic_read(&md->pending))
|
||||
} else if (!atomic_read(&md->pending[0]) &&
|
||||
!atomic_read(&md->pending[1]))
|
||||
break;
|
||||
|
||||
if (interruptible == TASK_INTERRUPTIBLE &&
|
||||
|
|
@ -2164,7 +2168,7 @@ static void dm_wq_work(struct work_struct *work)
|
|||
if (dm_request_based(md))
|
||||
generic_make_request(c);
|
||||
else {
|
||||
if (bio_barrier(c))
|
||||
if (bio_rw_flagged(c, BIO_RW_BARRIER))
|
||||
process_barrier(md, c);
|
||||
else
|
||||
__split_and_process_bio(md, c);
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ static int linear_make_request (struct request_queue *q, struct bio *bio)
|
|||
sector_t start_sector;
|
||||
int cpu;
|
||||
|
||||
if (unlikely(bio_barrier(bio))) {
|
||||
if (unlikely(bio_rw_flagged(bio, BIO_RW_BARRIER))) {
|
||||
bio_endio(bio, -EOPNOTSUPP);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ static void multipath_end_request(struct bio *bio, int error)
|
|||
|
||||
if (uptodate)
|
||||
multipath_end_bh_io(mp_bh, 0);
|
||||
else if (!bio_rw_ahead(bio)) {
|
||||
else if (!bio_rw_flagged(bio, BIO_RW_AHEAD)) {
|
||||
/*
|
||||
* oops, IO error:
|
||||
*/
|
||||
|
|
@ -144,7 +144,7 @@ static int multipath_make_request (struct request_queue *q, struct bio * bio)
|
|||
const int rw = bio_data_dir(bio);
|
||||
int cpu;
|
||||
|
||||
if (unlikely(bio_barrier(bio))) {
|
||||
if (unlikely(bio_rw_flagged(bio, BIO_RW_BARRIER))) {
|
||||
bio_endio(bio, -EOPNOTSUPP);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -448,7 +448,7 @@ static int raid0_make_request(struct request_queue *q, struct bio *bio)
|
|||
const int rw = bio_data_dir(bio);
|
||||
int cpu;
|
||||
|
||||
if (unlikely(bio_barrier(bio))) {
|
||||
if (unlikely(bio_rw_flagged(bio, BIO_RW_BARRIER))) {
|
||||
bio_endio(bio, -EOPNOTSUPP);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -782,8 +782,9 @@ static int make_request(struct request_queue *q, struct bio * bio)
|
|||
struct bio_list bl;
|
||||
struct page **behind_pages = NULL;
|
||||
const int rw = bio_data_dir(bio);
|
||||
const int do_sync = bio_sync(bio);
|
||||
int cpu, do_barriers;
|
||||
const bool do_sync = bio_rw_flagged(bio, BIO_RW_SYNCIO);
|
||||
int cpu;
|
||||
bool do_barriers;
|
||||
mdk_rdev_t *blocked_rdev;
|
||||
|
||||
/*
|
||||
|
|
@ -797,7 +798,8 @@ static int make_request(struct request_queue *q, struct bio * bio)
|
|||
|
||||
md_write_start(mddev, bio); /* wait on superblock update early */
|
||||
|
||||
if (unlikely(!mddev->barriers_work && bio_barrier(bio))) {
|
||||
if (unlikely(!mddev->barriers_work &&
|
||||
bio_rw_flagged(bio, BIO_RW_BARRIER))) {
|
||||
if (rw == WRITE)
|
||||
md_write_end(mddev);
|
||||
bio_endio(bio, -EOPNOTSUPP);
|
||||
|
|
@ -925,7 +927,7 @@ static int make_request(struct request_queue *q, struct bio * bio)
|
|||
atomic_set(&r1_bio->remaining, 0);
|
||||
atomic_set(&r1_bio->behind_remaining, 0);
|
||||
|
||||
do_barriers = bio_barrier(bio);
|
||||
do_barriers = bio_rw_flagged(bio, BIO_RW_BARRIER);
|
||||
if (do_barriers)
|
||||
set_bit(R1BIO_Barrier, &r1_bio->state);
|
||||
|
||||
|
|
@ -1600,7 +1602,7 @@ static void raid1d(mddev_t *mddev)
|
|||
* We already have a nr_pending reference on these rdevs.
|
||||
*/
|
||||
int i;
|
||||
const int do_sync = bio_sync(r1_bio->master_bio);
|
||||
const bool do_sync = bio_rw_flagged(r1_bio->master_bio, BIO_RW_SYNCIO);
|
||||
clear_bit(R1BIO_BarrierRetry, &r1_bio->state);
|
||||
clear_bit(R1BIO_Barrier, &r1_bio->state);
|
||||
for (i=0; i < conf->raid_disks; i++)
|
||||
|
|
@ -1654,7 +1656,7 @@ static void raid1d(mddev_t *mddev)
|
|||
(unsigned long long)r1_bio->sector);
|
||||
raid_end_bio_io(r1_bio);
|
||||
} else {
|
||||
const int do_sync = bio_sync(r1_bio->master_bio);
|
||||
const bool do_sync = bio_rw_flagged(r1_bio->master_bio, BIO_RW_SYNCIO);
|
||||
r1_bio->bios[r1_bio->read_disk] =
|
||||
mddev->ro ? IO_BLOCKED : NULL;
|
||||
r1_bio->read_disk = disk;
|
||||
|
|
|
|||
|
|
@ -796,12 +796,12 @@ static int make_request(struct request_queue *q, struct bio * bio)
|
|||
int i;
|
||||
int chunk_sects = conf->chunk_mask + 1;
|
||||
const int rw = bio_data_dir(bio);
|
||||
const int do_sync = bio_sync(bio);
|
||||
const bool do_sync = bio_rw_flagged(bio, BIO_RW_SYNCIO);
|
||||
struct bio_list bl;
|
||||
unsigned long flags;
|
||||
mdk_rdev_t *blocked_rdev;
|
||||
|
||||
if (unlikely(bio_barrier(bio))) {
|
||||
if (unlikely(bio_rw_flagged(bio, BIO_RW_BARRIER))) {
|
||||
bio_endio(bio, -EOPNOTSUPP);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1610,7 +1610,7 @@ static void raid10d(mddev_t *mddev)
|
|||
raid_end_bio_io(r10_bio);
|
||||
bio_put(bio);
|
||||
} else {
|
||||
const int do_sync = bio_sync(r10_bio->master_bio);
|
||||
const bool do_sync = bio_rw_flagged(r10_bio->master_bio, BIO_RW_SYNCIO);
|
||||
bio_put(bio);
|
||||
rdev = conf->mirrors[mirror].rdev;
|
||||
if (printk_ratelimit())
|
||||
|
|
|
|||
|
|
@ -3606,7 +3606,7 @@ static int make_request(struct request_queue *q, struct bio * bi)
|
|||
const int rw = bio_data_dir(bi);
|
||||
int cpu, remaining;
|
||||
|
||||
if (unlikely(bio_barrier(bi))) {
|
||||
if (unlikely(bio_rw_flagged(bi, BIO_RW_BARRIER))) {
|
||||
bio_endio(bi, -EOPNOTSUPP);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue