Commit 8e775167d54e6521e7cdbc03ee7ec42a8c67b49a

Authored by Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  Revert "block: fix accounting bug on cross partition merges"

Showing 8 changed files Side-by-side Diff

... ... @@ -64,15 +64,13 @@
64 64 return;
65 65  
66 66 cpu = part_stat_lock();
  67 + part = disk_map_sector_rcu(rq->rq_disk, blk_rq_pos(rq));
67 68  
68   - if (!new_io) {
69   - part = rq->part;
  69 + if (!new_io)
70 70 part_stat_inc(cpu, part, merges[rw]);
71   - } else {
72   - part = disk_map_sector_rcu(rq->rq_disk, blk_rq_pos(rq));
  71 + else {
73 72 part_round_stats(cpu, part);
74 73 part_inc_in_flight(part, rw);
75   - rq->part = part;
76 74 }
77 75  
78 76 part_stat_unlock();
... ... @@ -130,7 +128,6 @@
130 128 rq->ref_count = 1;
131 129 rq->start_time = jiffies;
132 130 set_start_time_ns(rq);
133   - rq->part = NULL;
134 131 }
135 132 EXPORT_SYMBOL(blk_rq_init);
136 133  
137 134  
... ... @@ -805,16 +802,11 @@
805 802 rl->starved[is_sync] = 0;
806 803  
807 804 priv = !test_bit(QUEUE_FLAG_ELVSWITCH, &q->queue_flags);
808   - if (priv) {
  805 + if (priv)
809 806 rl->elvpriv++;
810 807  
811   - /*
812   - * Don't do stats for non-priv requests
813   - */
814   - if (blk_queue_io_stat(q))
815   - rw_flags |= REQ_IO_STAT;
816   - }
817   -
  808 + if (blk_queue_io_stat(q))
  809 + rw_flags |= REQ_IO_STAT;
818 810 spin_unlock_irq(q->queue_lock);
819 811  
820 812 rq = blk_alloc_request(q, rw_flags, priv, gfp_mask);
... ... @@ -1791,7 +1783,7 @@
1791 1783 int cpu;
1792 1784  
1793 1785 cpu = part_stat_lock();
1794   - part = req->part;
  1786 + part = disk_map_sector_rcu(req->rq_disk, blk_rq_pos(req));
1795 1787 part_stat_add(cpu, part, sectors[rw], bytes >> 9);
1796 1788 part_stat_unlock();
1797 1789 }
... ... @@ -1811,7 +1803,7 @@
1811 1803 int cpu;
1812 1804  
1813 1805 cpu = part_stat_lock();
1814   - part = req->part;
  1806 + part = disk_map_sector_rcu(req->rq_disk, blk_rq_pos(req));
1815 1807  
1816 1808 part_stat_inc(cpu, part, ios[rw]);
1817 1809 part_stat_add(cpu, part, ticks[rw], duration);
... ... @@ -351,7 +351,7 @@
351 351 int cpu;
352 352  
353 353 cpu = part_stat_lock();
354   - part = req->part;
  354 + part = disk_map_sector_rcu(req->rq_disk, blk_rq_pos(req));
355 355  
356 356 part_round_stats(cpu, part);
357 357 part_dec_in_flight(part, rq_data_dir(req));
... ... @@ -116,6 +116,10 @@
116 116  
117 117 int blk_dev_init(void);
118 118  
  119 +void elv_quiesce_start(struct request_queue *q);
  120 +void elv_quiesce_end(struct request_queue *q);
  121 +
  122 +
119 123 /*
120 124 * Return the threshold (number of used requests) at which the queue is
121 125 * considered to be congested. It include a little hysteresis to keep the
... ... @@ -929,15 +929,8 @@
929 929 {
930 930 struct disk_part_tbl *ptbl =
931 931 container_of(head, struct disk_part_tbl, rcu_head);
932   - struct gendisk *disk = ptbl->disk;
933   - struct request_queue *q = disk->queue;
934   - unsigned long flags;
935 932  
936 933 kfree(ptbl);
937   -
938   - spin_lock_irqsave(q->queue_lock, flags);
939   - elv_quiesce_end(q);
940   - spin_unlock_irqrestore(q->queue_lock, flags);
941 934 }
942 935  
943 936 /**
944 937  
... ... @@ -955,17 +948,11 @@
955 948 struct disk_part_tbl *new_ptbl)
956 949 {
957 950 struct disk_part_tbl *old_ptbl = disk->part_tbl;
958   - struct request_queue *q = disk->queue;
959 951  
960 952 rcu_assign_pointer(disk->part_tbl, new_ptbl);
961 953  
962 954 if (old_ptbl) {
963 955 rcu_assign_pointer(old_ptbl->last_lookup, NULL);
964   -
965   - spin_lock_irq(q->queue_lock);
966   - elv_quiesce_start(q);
967   - spin_unlock_irq(q->queue_lock);
968   -
969 956 call_rcu(&old_ptbl->rcu_head, disk_free_ptbl_rcu_cb);
970 957 }
971 958 }
... ... @@ -1006,7 +993,6 @@
1006 993 return -ENOMEM;
1007 994  
1008 995 new_ptbl->len = target;
1009   - new_ptbl->disk = disk;
1010 996  
1011 997 for (i = 0; i < len; i++)
1012 998 rcu_assign_pointer(new_ptbl->part[i], old_ptbl->part[i]);
fs/partitions/check.c
... ... @@ -365,25 +365,17 @@
365 365 static void delete_partition_rcu_cb(struct rcu_head *head)
366 366 {
367 367 struct hd_struct *part = container_of(head, struct hd_struct, rcu_head);
368   - struct gendisk *disk = part_to_disk(part);
369   - struct request_queue *q = disk->queue;
370   - unsigned long flags;
371 368  
372 369 part->start_sect = 0;
373 370 part->nr_sects = 0;
374 371 part_stat_set_all(part, 0);
375 372 put_device(part_to_dev(part));
376   -
377   - spin_lock_irqsave(q->queue_lock, flags);
378   - elv_quiesce_end(q);
379   - spin_unlock_irqrestore(q->queue_lock, flags);
380 373 }
381 374  
382 375 void delete_partition(struct gendisk *disk, int partno)
383 376 {
384 377 struct disk_part_tbl *ptbl = disk->part_tbl;
385 378 struct hd_struct *part;
386   - struct request_queue *q = disk->queue;
387 379  
388 380 if (partno >= ptbl->len)
389 381 return;
... ... @@ -397,10 +389,6 @@
397 389 rcu_assign_pointer(ptbl->last_lookup, NULL);
398 390 kobject_put(part->holder_dir);
399 391 device_del(part_to_dev(part));
400   -
401   - spin_lock_irq(q->queue_lock);
402   - elv_quiesce_start(q);
403   - spin_unlock_irq(q->queue_lock);
404 392  
405 393 call_rcu(&part->rcu_head, delete_partition_rcu_cb);
406 394 }
include/linux/blkdev.h
... ... @@ -115,7 +115,6 @@
115 115 void *elevator_private3;
116 116  
117 117 struct gendisk *rq_disk;
118   - struct hd_struct *part;
119 118 unsigned long start_time;
120 119 #ifdef CONFIG_BLK_CGROUP
121 120 unsigned long long start_time_ns;
include/linux/elevator.h
... ... @@ -122,8 +122,6 @@
122 122 extern int elv_set_request(struct request_queue *, struct request *, gfp_t);
123 123 extern void elv_put_request(struct request_queue *, struct request *);
124 124 extern void elv_drain_elevator(struct request_queue *);
125   -extern void elv_quiesce_start(struct request_queue *);
126   -extern void elv_quiesce_end(struct request_queue *);
127 125  
128 126 /*
129 127 * io scheduler registration
include/linux/genhd.h
... ... @@ -140,7 +140,6 @@
140 140 struct rcu_head rcu_head;
141 141 int len;
142 142 struct hd_struct __rcu *last_lookup;
143   - struct gendisk *disk;
144 143 struct hd_struct __rcu *part[];
145 144 };
146 145