diff --git a/[refs] b/[refs] index 244805cf1468..db1c4f5acaff 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 797a455d2c682476c3797dbfecf5bf84c1e3b9d3 +refs/heads/master: dddd9dc340ae1a41d90e084529ca979c77c4ecfe diff --git a/trunk/block/blk-core.c b/trunk/block/blk-core.c index 2f4002f79a24..151070541e21 100644 --- a/trunk/block/blk-core.c +++ b/trunk/block/blk-core.c @@ -64,27 +64,13 @@ static void drive_stat_acct(struct request *rq, int new_io) return; cpu = part_stat_lock(); + part = disk_map_sector_rcu(rq->rq_disk, blk_rq_pos(rq)); - if (!new_io) { - part = rq->part; + if (!new_io) part_stat_inc(cpu, part, merges[rw]); - } else { - part = disk_map_sector_rcu(rq->rq_disk, blk_rq_pos(rq)); - if (!hd_struct_try_get(part)) { - /* - * The partition is already being removed, - * the request will be accounted on the disk only - * - * We take a reference on disk->part0 although that - * partition will never be deleted, so we can treat - * it as any other partition. - */ - part = &rq->rq_disk->part0; - hd_struct_get(part); - } + else { part_round_stats(cpu, part); part_inc_in_flight(part, rw); - rq->part = part; } part_stat_unlock(); @@ -142,7 +128,6 @@ void blk_rq_init(struct request_queue *q, struct request *rq) rq->ref_count = 1; rq->start_time = jiffies; set_start_time_ns(rq); - rq->part = NULL; } EXPORT_SYMBOL(blk_rq_init); @@ -1791,7 +1776,7 @@ static void blk_account_io_completion(struct request *req, unsigned int bytes) int cpu; cpu = part_stat_lock(); - part = req->part; + part = disk_map_sector_rcu(req->rq_disk, blk_rq_pos(req)); part_stat_add(cpu, part, sectors[rw], bytes >> 9); part_stat_unlock(); } @@ -1811,14 +1796,13 @@ static void blk_account_io_done(struct request *req) int cpu; cpu = part_stat_lock(); - part = req->part; + part = disk_map_sector_rcu(req->rq_disk, blk_rq_pos(req)); part_stat_inc(cpu, part, ios[rw]); part_stat_add(cpu, part, ticks[rw], duration); part_round_stats(cpu, part); part_dec_in_flight(part, rw); - hd_struct_put(part); part_stat_unlock(); } } @@ -2622,9 +2606,7 @@ int __init blk_dev_init(void) BUILD_BUG_ON(__REQ_NR_BITS > 8 * sizeof(((struct request *)0)->cmd_flags)); - /* used for unplugging and affects IO latency/throughput - HIGHPRI */ - kblockd_workqueue = alloc_workqueue("kblockd", - WQ_MEM_RECLAIM | WQ_HIGHPRI, 0); + kblockd_workqueue = create_workqueue("kblockd"); if (!kblockd_workqueue) panic("Failed to create kblockd\n"); diff --git a/trunk/block/blk-ioc.c b/trunk/block/blk-ioc.c index b791022beef3..3c7a339fe381 100644 --- a/trunk/block/blk-ioc.c +++ b/trunk/block/blk-ioc.c @@ -64,7 +64,7 @@ static void cfq_exit(struct io_context *ioc) rcu_read_unlock(); } -/* Called by the exiting task */ +/* Called by the exitting task */ void exit_io_context(struct task_struct *task) { struct io_context *ioc; @@ -74,9 +74,10 @@ void exit_io_context(struct task_struct *task) task->io_context = NULL; task_unlock(task); - if (atomic_dec_and_test(&ioc->nr_tasks)) + if (atomic_dec_and_test(&ioc->nr_tasks)) { cfq_exit(ioc); + } put_io_context(ioc); } diff --git a/trunk/block/blk-merge.c b/trunk/block/blk-merge.c index 00b7d31b38a2..77b7c26df6b5 100644 --- a/trunk/block/blk-merge.c +++ b/trunk/block/blk-merge.c @@ -351,12 +351,11 @@ static void blk_account_io_merge(struct request *req) int cpu; cpu = part_stat_lock(); - part = req->part; + part = disk_map_sector_rcu(req->rq_disk, blk_rq_pos(req)); part_round_stats(cpu, part); part_dec_in_flight(part, rq_data_dir(req)); - hd_struct_put(part); part_stat_unlock(); } } diff --git a/trunk/block/cfq-iosched.c b/trunk/block/cfq-iosched.c index f083bda30546..9b186fd6bf47 100644 --- a/trunk/block/cfq-iosched.c +++ b/trunk/block/cfq-iosched.c @@ -96,7 +96,7 @@ struct cfq_rb_root { */ struct cfq_queue { /* reference count */ - int ref; + atomic_t ref; /* various state flags, see below */ unsigned int flags; /* parent cfq_data */ @@ -207,7 +207,7 @@ struct cfq_group { struct blkio_group blkg; #ifdef CONFIG_CFQ_GROUP_IOSCHED struct hlist_node cfqd_node; - int ref; + atomic_t ref; #endif /* number of requests that are on the dispatch list or inside driver */ int dispatched; @@ -1014,7 +1014,7 @@ cfq_find_alloc_cfqg(struct cfq_data *cfqd, struct cgroup *cgroup, int create) * elevator which will be dropped by either elevator exit * or cgroup deletion path depending on who is exiting first. */ - cfqg->ref = 1; + atomic_set(&cfqg->ref, 1); /* * Add group onto cgroup list. It might happen that bdi->dev is @@ -1059,7 +1059,7 @@ static struct cfq_group *cfq_get_cfqg(struct cfq_data *cfqd, int create) static inline struct cfq_group *cfq_ref_get_cfqg(struct cfq_group *cfqg) { - cfqg->ref++; + atomic_inc(&cfqg->ref); return cfqg; } @@ -1071,7 +1071,7 @@ static void cfq_link_cfqq_cfqg(struct cfq_queue *cfqq, struct cfq_group *cfqg) cfqq->cfqg = cfqg; /* cfqq reference on cfqg */ - cfqq->cfqg->ref++; + atomic_inc(&cfqq->cfqg->ref); } static void cfq_put_cfqg(struct cfq_group *cfqg) @@ -1079,9 +1079,8 @@ static void cfq_put_cfqg(struct cfq_group *cfqg) struct cfq_rb_root *st; int i, j; - BUG_ON(cfqg->ref <= 0); - cfqg->ref--; - if (cfqg->ref) + BUG_ON(atomic_read(&cfqg->ref) <= 0); + if (!atomic_dec_and_test(&cfqg->ref)) return; for_each_cfqg_st(cfqg, i, j, st) BUG_ON(!RB_EMPTY_ROOT(&st->rb)); @@ -1189,7 +1188,7 @@ static void cfq_service_tree_add(struct cfq_data *cfqd, struct cfq_queue *cfqq, cfq_group_service_tree_del(cfqd, cfqq->cfqg); cfqq->orig_cfqg = cfqq->cfqg; cfqq->cfqg = &cfqd->root_group; - cfqd->root_group.ref++; + atomic_inc(&cfqd->root_group.ref); group_changed = 1; } else if (!cfqd->cfq_group_isolation && cfqq_type(cfqq) == SYNC_WORKLOAD && cfqq->orig_cfqg) { @@ -2026,7 +2025,7 @@ static int cfqq_process_refs(struct cfq_queue *cfqq) int process_refs, io_refs; io_refs = cfqq->allocated[READ] + cfqq->allocated[WRITE]; - process_refs = cfqq->ref - io_refs; + process_refs = atomic_read(&cfqq->ref) - io_refs; BUG_ON(process_refs < 0); return process_refs; } @@ -2066,10 +2065,10 @@ static void cfq_setup_merge(struct cfq_queue *cfqq, struct cfq_queue *new_cfqq) */ if (new_process_refs >= process_refs) { cfqq->new_cfqq = new_cfqq; - new_cfqq->ref += process_refs; + atomic_add(process_refs, &new_cfqq->ref); } else { new_cfqq->new_cfqq = cfqq; - cfqq->ref += new_process_refs; + atomic_add(new_process_refs, &cfqq->ref); } } @@ -2104,6 +2103,12 @@ static void choose_service_tree(struct cfq_data *cfqd, struct cfq_group *cfqg) unsigned group_slice; enum wl_prio_t original_prio = cfqd->serving_prio; + if (!cfqg) { + cfqd->serving_prio = IDLE_WORKLOAD; + cfqd->workload_expires = jiffies + 1; + return; + } + /* Choose next priority. RT > BE > IDLE */ if (cfq_group_busy_queues_wl(RT_WORKLOAD, cfqd, cfqg)) cfqd->serving_prio = RT_WORKLOAD; @@ -2533,10 +2538,9 @@ static void cfq_put_queue(struct cfq_queue *cfqq) struct cfq_data *cfqd = cfqq->cfqd; struct cfq_group *cfqg, *orig_cfqg; - BUG_ON(cfqq->ref <= 0); + BUG_ON(atomic_read(&cfqq->ref) <= 0); - cfqq->ref--; - if (cfqq->ref) + if (!atomic_dec_and_test(&cfqq->ref)) return; cfq_log_cfqq(cfqd, cfqq, "put_queue"); @@ -2839,7 +2843,7 @@ static void cfq_init_cfqq(struct cfq_data *cfqd, struct cfq_queue *cfqq, RB_CLEAR_NODE(&cfqq->p_node); INIT_LIST_HEAD(&cfqq->fifo); - cfqq->ref = 0; + atomic_set(&cfqq->ref, 0); cfqq->cfqd = cfqd; cfq_mark_cfqq_prio_changed(cfqq); @@ -2975,11 +2979,11 @@ cfq_get_queue(struct cfq_data *cfqd, bool is_sync, struct io_context *ioc, * pin the queue now that it's allocated, scheduler exit will prune it */ if (!is_sync && !(*async_cfqq)) { - cfqq->ref++; + atomic_inc(&cfqq->ref); *async_cfqq = cfqq; } - cfqq->ref++; + atomic_inc(&cfqq->ref); return cfqq; } @@ -3681,13 +3685,13 @@ cfq_set_request(struct request_queue *q, struct request *rq, gfp_t gfp_mask) } cfqq->allocated[rw]++; - cfqq->ref++; - rq->elevator_private = cic; - rq->elevator_private2 = cfqq; - rq->elevator_private3 = cfq_ref_get_cfqg(cfqq->cfqg); + atomic_inc(&cfqq->ref); spin_unlock_irqrestore(q->queue_lock, flags); + rq->elevator_private = cic; + rq->elevator_private2 = cfqq; + rq->elevator_private3 = cfq_ref_get_cfqg(cfqq->cfqg); return 0; queue_fail: @@ -3862,10 +3866,6 @@ static void *cfq_init_queue(struct request_queue *q) if (!cfqd) return NULL; - /* - * Don't need take queue_lock in the routine, since we are - * initializing the ioscheduler, and nobody is using cfqd - */ cfqd->cic_index = i; /* Init root service tree */ @@ -3885,7 +3885,7 @@ static void *cfq_init_queue(struct request_queue *q) * Take a reference to root group which we never drop. This is just * to make sure that cfq_put_cfqg() does not try to kfree root group */ - cfqg->ref = 1; + atomic_set(&cfqg->ref, 1); rcu_read_lock(); cfq_blkiocg_add_blkio_group(&blkio_root_cgroup, &cfqg->blkg, (void *)cfqd, 0); @@ -3905,7 +3905,7 @@ static void *cfq_init_queue(struct request_queue *q) * will not attempt to free it. */ cfq_init_cfqq(cfqd, &cfqd->oom_cfqq, 1, 0); - cfqd->oom_cfqq.ref++; + atomic_inc(&cfqd->oom_cfqq.ref); cfq_link_cfqq_cfqg(&cfqd->oom_cfqq, &cfqd->root_group); INIT_LIST_HEAD(&cfqd->cic_list); diff --git a/trunk/block/genhd.c b/trunk/block/genhd.c index 399d37ec7412..0905ab22c8cf 100644 --- a/trunk/block/genhd.c +++ b/trunk/block/genhd.c @@ -239,7 +239,7 @@ static struct blk_major_name { } *major_names[BLKDEV_MAJOR_HASH_SIZE]; /* index in the above - for now: assume no multimajor ranges */ -static inline int major_to_index(unsigned major) +static inline int major_to_index(int major) { return major % BLKDEV_MAJOR_HASH_SIZE; } @@ -735,7 +735,7 @@ static void *show_partition_start(struct seq_file *seqf, loff_t *pos) static void *p; p = disk_seqf_start(seqf, pos); - if (!IS_ERR_OR_NULL(p) && !*pos) + if (!IS_ERR(p) && p && !*pos) seq_puts(seqf, "major minor #blocks name\n\n"); return p; } @@ -1110,29 +1110,6 @@ static int __init proc_genhd_init(void) module_init(proc_genhd_init); #endif /* CONFIG_PROC_FS */ -static void media_change_notify_thread(struct work_struct *work) -{ - struct gendisk *gd = container_of(work, struct gendisk, async_notify); - char event[] = "MEDIA_CHANGE=1"; - char *envp[] = { event, NULL }; - - /* - * set enviroment vars to indicate which event this is for - * so that user space will know to go check the media status. - */ - kobject_uevent_env(&disk_to_dev(gd)->kobj, KOBJ_CHANGE, envp); - put_device(gd->driverfs_dev); -} - -#if 0 -void genhd_media_change_notify(struct gendisk *disk) -{ - get_device(disk->driverfs_dev); - schedule_work(&disk->async_notify); -} -EXPORT_SYMBOL_GPL(genhd_media_change_notify); -#endif /* 0 */ - dev_t blk_lookup_devt(const char *name, int partno) { dev_t devt = MKDEV(0, 0); @@ -1193,15 +1170,11 @@ struct gendisk *alloc_disk_node(int minors, int node_id) } disk->part_tbl->part[0] = &disk->part0; - hd_ref_init(&disk->part0); - disk->minors = minors; rand_initialize_disk(disk); disk_to_dev(disk)->class = &block_class; disk_to_dev(disk)->type = &disk_type; device_initialize(disk_to_dev(disk)); - INIT_WORK(&disk->async_notify, - media_change_notify_thread); } return disk; } diff --git a/trunk/drivers/block/loop.c b/trunk/drivers/block/loop.c index 44e18c073c44..7ea0bea2f7e3 100644 --- a/trunk/drivers/block/loop.c +++ b/trunk/drivers/block/loop.c @@ -395,7 +395,11 @@ lo_splice_actor(struct pipe_inode_info *pipe, struct pipe_buffer *buf, struct loop_device *lo = p->lo; struct page *page = buf->page; sector_t IV; - int size; + int size, ret; + + ret = buf->ops->confirm(pipe, buf); + if (unlikely(ret)) + return ret; IV = ((sector_t) page->index << (PAGE_CACHE_SHIFT - 9)) + (buf->offset >> 9); diff --git a/trunk/drivers/md/dm.c b/trunk/drivers/md/dm.c index f48a2f359ac4..0a2b5516bc21 100644 --- a/trunk/drivers/md/dm.c +++ b/trunk/drivers/md/dm.c @@ -630,7 +630,7 @@ static void dec_pending(struct dm_io *io, int error) queue_io(md, bio); } else { /* done with normal IO or empty flush */ - trace_block_bio_complete(md->queue, bio, io_error); + trace_block_bio_complete(md->queue, bio); bio_endio(bio, io_error); } } diff --git a/trunk/fs/bio-integrity.c b/trunk/fs/bio-integrity.c index e49cce234c65..4d0ff5ee27b8 100644 --- a/trunk/fs/bio-integrity.c +++ b/trunk/fs/bio-integrity.c @@ -782,12 +782,7 @@ void __init bio_integrity_init(void) { unsigned int i; - /* - * kintegrityd won't block much but may burn a lot of CPU cycles. - * Make it highpri CPU intensive wq with max concurrency of 1. - */ - kintegrityd_wq = alloc_workqueue("kintegrityd", WQ_MEM_RECLAIM | - WQ_HIGHPRI | WQ_CPU_INTENSIVE, 1); + kintegrityd_wq = create_workqueue("kintegrityd"); if (!kintegrityd_wq) panic("Failed to create kintegrityd\n"); diff --git a/trunk/fs/char_dev.c b/trunk/fs/char_dev.c index 143f0207c7eb..e5b9df993b93 100644 --- a/trunk/fs/char_dev.c +++ b/trunk/fs/char_dev.c @@ -59,7 +59,7 @@ static struct char_device_struct { } *chrdevs[CHRDEV_MAJOR_HASH_SIZE]; /* index in the above */ -static inline int major_to_index(unsigned major) +static inline int major_to_index(int major) { return major % CHRDEV_MAJOR_HASH_SIZE; } diff --git a/trunk/fs/nfsd/vfs.c b/trunk/fs/nfsd/vfs.c index 106ed482f119..184938fcff04 100644 --- a/trunk/fs/nfsd/vfs.c +++ b/trunk/fs/nfsd/vfs.c @@ -845,6 +845,11 @@ nfsd_splice_actor(struct pipe_inode_info *pipe, struct pipe_buffer *buf, struct page **pp = rqstp->rq_respages + rqstp->rq_resused; struct page *page = buf->page; size_t size; + int ret; + + ret = buf->ops->confirm(pipe, buf); + if (unlikely(ret)) + return ret; size = sd->len; diff --git a/trunk/fs/partitions/check.c b/trunk/fs/partitions/check.c index 011520df71ae..bdf8d3cc95a4 100644 --- a/trunk/fs/partitions/check.c +++ b/trunk/fs/partitions/check.c @@ -381,11 +381,6 @@ static void delete_partition_rcu_cb(struct rcu_head *head) put_device(part_to_dev(part)); } -void __delete_partition(struct hd_struct *part) -{ - call_rcu(&part->rcu_head, delete_partition_rcu_cb); -} - void delete_partition(struct gendisk *disk, int partno) { struct disk_part_tbl *ptbl = disk->part_tbl; @@ -404,7 +399,7 @@ void delete_partition(struct gendisk *disk, int partno) kobject_put(part->holder_dir); device_del(part_to_dev(part)); - hd_struct_put(part); + call_rcu(&part->rcu_head, delete_partition_rcu_cb); } static ssize_t whole_disk_show(struct device *dev, @@ -503,7 +498,6 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno, if (!dev_get_uevent_suppress(ddev)) kobject_uevent(&pdev->kobj, KOBJ_ADD); - hd_ref_init(p); return p; out_free_info: diff --git a/trunk/fs/splice.c b/trunk/fs/splice.c index d2026382ac3e..8f1dfaecc8f0 100644 --- a/trunk/fs/splice.c +++ b/trunk/fs/splice.c @@ -682,14 +682,19 @@ static int pipe_to_sendpage(struct pipe_inode_info *pipe, { struct file *file = sd->u.file; loff_t pos = sd->pos; - int more; - - if (!likely(file->f_op && file->f_op->sendpage)) - return -EINVAL; + int ret, more; + + ret = buf->ops->confirm(pipe, buf); + if (!ret) { + more = (sd->flags & SPLICE_F_MORE) || sd->len < sd->total_len; + if (file->f_op && file->f_op->sendpage) + ret = file->f_op->sendpage(file, buf->page, buf->offset, + sd->len, &pos, more); + else + ret = -EINVAL; + } - more = (sd->flags & SPLICE_F_MORE) || sd->len < sd->total_len; - return file->f_op->sendpage(file, buf->page, buf->offset, - sd->len, &pos, more); + return ret; } /* @@ -722,6 +727,13 @@ int pipe_to_file(struct pipe_inode_info *pipe, struct pipe_buffer *buf, void *fsdata; int ret; + /* + * make sure the data in this buffer is uptodate + */ + ret = buf->ops->confirm(pipe, buf); + if (unlikely(ret)) + return ret; + offset = sd->pos & ~PAGE_CACHE_MASK; this_len = sd->len; @@ -793,17 +805,12 @@ int splice_from_pipe_feed(struct pipe_inode_info *pipe, struct splice_desc *sd, if (sd->len > sd->total_len) sd->len = sd->total_len; - ret = buf->ops->confirm(pipe, buf); - if (unlikely(ret)) { + ret = actor(pipe, buf, sd); + if (ret <= 0) { if (ret == -ENODATA) ret = 0; return ret; } - - ret = actor(pipe, buf, sd); - if (ret <= 0) - return ret; - buf->offset += ret; buf->len -= ret; @@ -1037,6 +1044,10 @@ static int write_pipe_buf(struct pipe_inode_info *pipe, struct pipe_buffer *buf, int ret; void *data; + ret = buf->ops->confirm(pipe, buf); + if (ret) + return ret; + data = buf->ops->map(pipe, buf, 0); ret = kernel_write(sd->u.file, data + buf->offset, sd->len, sd->pos); buf->ops->unmap(pipe, buf, data); @@ -1496,6 +1507,10 @@ static int pipe_to_user(struct pipe_inode_info *pipe, struct pipe_buffer *buf, char *src; int ret; + ret = buf->ops->confirm(pipe, buf); + if (unlikely(ret)) + return ret; + /* * See if we can use the atomic maps, by prefaulting in the * pages and doing an atomic copy diff --git a/trunk/include/linux/blkdev.h b/trunk/include/linux/blkdev.h index 482a7fd48831..aae86fd10c4f 100644 --- a/trunk/include/linux/blkdev.h +++ b/trunk/include/linux/blkdev.h @@ -115,7 +115,6 @@ struct request { void *elevator_private3; struct gendisk *rq_disk; - struct hd_struct *part; unsigned long start_time; #ifdef CONFIG_BLK_CGROUP unsigned long long start_time_ns; diff --git a/trunk/include/linux/genhd.h b/trunk/include/linux/genhd.h index 2d0468145967..5e4e6928387c 100644 --- a/trunk/include/linux/genhd.h +++ b/trunk/include/linux/genhd.h @@ -115,7 +115,6 @@ struct hd_struct { #else struct disk_stats dkstats; #endif - atomic_t ref; struct rcu_head rcu_head; }; @@ -174,7 +173,6 @@ struct gendisk { struct timer_rand_state *random; atomic_t sync_io; /* RAID */ - struct work_struct async_notify; #ifdef CONFIG_BLK_DEV_INTEGRITY struct blk_integrity *integrity; #endif @@ -584,7 +582,6 @@ extern struct hd_struct * __must_check add_partition(struct gendisk *disk, sector_t len, int flags, struct partition_meta_info *info); -extern void __delete_partition(struct hd_struct *); extern void delete_partition(struct gendisk *, int); extern void printk_all_partitions(void); @@ -613,29 +610,6 @@ extern ssize_t part_fail_store(struct device *dev, const char *buf, size_t count); #endif /* CONFIG_FAIL_MAKE_REQUEST */ -static inline void hd_ref_init(struct hd_struct *part) -{ - atomic_set(&part->ref, 1); - smp_mb(); -} - -static inline void hd_struct_get(struct hd_struct *part) -{ - atomic_inc(&part->ref); - smp_mb__after_atomic_inc(); -} - -static inline int hd_struct_try_get(struct hd_struct *part) -{ - return atomic_inc_not_zero(&part->ref); -} - -static inline void hd_struct_put(struct hd_struct *part) -{ - if (atomic_dec_and_test(&part->ref)) - __delete_partition(part); -} - #else /* CONFIG_BLOCK */ static inline void printk_all_partitions(void) { } diff --git a/trunk/include/trace/events/block.h b/trunk/include/trace/events/block.h index aba421d68f6f..b56c65dc105d 100644 --- a/trunk/include/trace/events/block.h +++ b/trunk/include/trace/events/block.h @@ -206,16 +206,15 @@ TRACE_EVENT(block_bio_bounce, * block_bio_complete - completed all work on the block operation * @q: queue holding the block operation * @bio: block operation completed - * @error: io error value * * This tracepoint indicates there is no further work to do on this * block IO operation @bio. */ TRACE_EVENT(block_bio_complete, - TP_PROTO(struct request_queue *q, struct bio *bio, int error), + TP_PROTO(struct request_queue *q, struct bio *bio), - TP_ARGS(q, bio, error), + TP_ARGS(q, bio), TP_STRUCT__entry( __field( dev_t, dev ) @@ -229,7 +228,6 @@ TRACE_EVENT(block_bio_complete, __entry->dev = bio->bi_bdev->bd_dev; __entry->sector = bio->bi_sector; __entry->nr_sector = bio->bi_size >> 9; - __entry->error = error; blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); ), diff --git a/trunk/kernel/trace/blktrace.c b/trunk/kernel/trace/blktrace.c index 153562d0b93c..2b8e2ee7c0ef 100644 --- a/trunk/kernel/trace/blktrace.c +++ b/trunk/kernel/trace/blktrace.c @@ -758,58 +758,53 @@ static void blk_add_trace_rq_complete(void *ignore, * @q: queue the io is for * @bio: the source bio * @what: the action - * @error: error, if any * * Description: * Records an action against a bio. Will log the bio offset + size. * **/ static void blk_add_trace_bio(struct request_queue *q, struct bio *bio, - u32 what, int error) + u32 what) { struct blk_trace *bt = q->blk_trace; if (likely(!bt)) return; - if (!error && !bio_flagged(bio, BIO_UPTODATE)) - error = EIO; - __blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw, what, - error, 0, NULL); + !bio_flagged(bio, BIO_UPTODATE), 0, NULL); } static void blk_add_trace_bio_bounce(void *ignore, struct request_queue *q, struct bio *bio) { - blk_add_trace_bio(q, bio, BLK_TA_BOUNCE, 0); + blk_add_trace_bio(q, bio, BLK_TA_BOUNCE); } static void blk_add_trace_bio_complete(void *ignore, - struct request_queue *q, struct bio *bio, - int error) + struct request_queue *q, struct bio *bio) { - blk_add_trace_bio(q, bio, BLK_TA_COMPLETE, error); + blk_add_trace_bio(q, bio, BLK_TA_COMPLETE); } static void blk_add_trace_bio_backmerge(void *ignore, struct request_queue *q, struct bio *bio) { - blk_add_trace_bio(q, bio, BLK_TA_BACKMERGE, 0); + blk_add_trace_bio(q, bio, BLK_TA_BACKMERGE); } static void blk_add_trace_bio_frontmerge(void *ignore, struct request_queue *q, struct bio *bio) { - blk_add_trace_bio(q, bio, BLK_TA_FRONTMERGE, 0); + blk_add_trace_bio(q, bio, BLK_TA_FRONTMERGE); } static void blk_add_trace_bio_queue(void *ignore, struct request_queue *q, struct bio *bio) { - blk_add_trace_bio(q, bio, BLK_TA_QUEUE, 0); + blk_add_trace_bio(q, bio, BLK_TA_QUEUE); } static void blk_add_trace_getrq(void *ignore, @@ -817,7 +812,7 @@ static void blk_add_trace_getrq(void *ignore, struct bio *bio, int rw) { if (bio) - blk_add_trace_bio(q, bio, BLK_TA_GETRQ, 0); + blk_add_trace_bio(q, bio, BLK_TA_GETRQ); else { struct blk_trace *bt = q->blk_trace; @@ -832,7 +827,7 @@ static void blk_add_trace_sleeprq(void *ignore, struct bio *bio, int rw) { if (bio) - blk_add_trace_bio(q, bio, BLK_TA_SLEEPRQ, 0); + blk_add_trace_bio(q, bio, BLK_TA_SLEEPRQ); else { struct blk_trace *bt = q->blk_trace;