diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-25 13:33:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-25 13:33:36 -0400 |
commit | 096a705bbc080a4041636d07514560da8d78acbe (patch) | |
tree | 38c3c01225709ffa53419083ea6332f8a72610de /block/genhd.c | |
parent | fea80311a939a746533a6d7e7c3183729d6a3faf (diff) | |
parent | 5757a6d76cdf6dda2a492c09b985c015e86779b1 (diff) |
Merge branch 'for-3.1/core' of git://git.kernel.dk/linux-block
* 'for-3.1/core' of git://git.kernel.dk/linux-block: (24 commits)
block: strict rq_affinity
backing-dev: use synchronize_rcu_expedited instead of synchronize_rcu
block: fix patch import error in max_discard_sectors check
block: reorder request_queue to remove 64 bit alignment padding
CFQ: add think time check for group
CFQ: add think time check for service tree
CFQ: move think time check variables to a separate struct
fixlet: Remove fs_excl from struct task.
cfq: Remove special treatment for metadata rqs.
block: document blk_plug list access
block: avoid building too big plug list
compat_ioctl: fix make headers_check regression
block: eliminate potential for infinite loop in blkdev_issue_discard
compat_ioctl: fix warning caused by qemu
block: flush MEDIA_CHANGE from drivers on close(2)
blk-throttle: Make total_nr_queued unsigned
block: Add __attribute__((format(printf...) and fix fallout
fs/partitions/check.c: make local symbols static
block:remove some spare spaces in genhd.c
block:fix the comment error in blkdev.h
...
Diffstat (limited to 'block/genhd.c')
-rw-r--r-- | block/genhd.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/block/genhd.c b/block/genhd.c index 6024b82e3209..5cb51c55f6d8 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
@@ -602,7 +602,7 @@ void add_disk(struct gendisk *disk) | |||
602 | disk->major = MAJOR(devt); | 602 | disk->major = MAJOR(devt); |
603 | disk->first_minor = MINOR(devt); | 603 | disk->first_minor = MINOR(devt); |
604 | 604 | ||
605 | /* Register BDI before referencing it from bdev */ | 605 | /* Register BDI before referencing it from bdev */ |
606 | bdi = &disk->queue->backing_dev_info; | 606 | bdi = &disk->queue->backing_dev_info; |
607 | bdi_register_dev(bdi, disk_devt(disk)); | 607 | bdi_register_dev(bdi, disk_devt(disk)); |
608 | 608 | ||
@@ -1140,7 +1140,7 @@ static int diskstats_show(struct seq_file *seqf, void *v) | |||
1140 | "wsect wuse running use aveq" | 1140 | "wsect wuse running use aveq" |
1141 | "\n\n"); | 1141 | "\n\n"); |
1142 | */ | 1142 | */ |
1143 | 1143 | ||
1144 | disk_part_iter_init(&piter, gp, DISK_PITER_INCL_EMPTY_PART0); | 1144 | disk_part_iter_init(&piter, gp, DISK_PITER_INCL_EMPTY_PART0); |
1145 | while ((hd = disk_part_iter_next(&piter))) { | 1145 | while ((hd = disk_part_iter_next(&piter))) { |
1146 | cpu = part_stat_lock(); | 1146 | cpu = part_stat_lock(); |
@@ -1164,7 +1164,7 @@ static int diskstats_show(struct seq_file *seqf, void *v) | |||
1164 | ); | 1164 | ); |
1165 | } | 1165 | } |
1166 | disk_part_iter_exit(&piter); | 1166 | disk_part_iter_exit(&piter); |
1167 | 1167 | ||
1168 | return 0; | 1168 | return 0; |
1169 | } | 1169 | } |
1170 | 1170 | ||
@@ -1492,30 +1492,32 @@ void disk_unblock_events(struct gendisk *disk) | |||
1492 | } | 1492 | } |
1493 | 1493 | ||
1494 | /** | 1494 | /** |
1495 | * disk_check_events - schedule immediate event checking | 1495 | * disk_flush_events - schedule immediate event checking and flushing |
1496 | * @disk: disk to check events for | 1496 | * @disk: disk to check and flush events for |
1497 | * @mask: events to flush | ||
1497 | * | 1498 | * |
1498 | * Schedule immediate event checking on @disk if not blocked. | 1499 | * Schedule immediate event checking on @disk if not blocked. Events in |
1500 | * @mask are scheduled to be cleared from the driver. Note that this | ||
1501 | * doesn't clear the events from @disk->ev. | ||
1499 | * | 1502 | * |
1500 | * CONTEXT: | 1503 | * CONTEXT: |
1501 | * Don't care. Safe to call from irq context. | 1504 | * If @mask is non-zero must be called with bdev->bd_mutex held. |
1502 | */ | 1505 | */ |
1503 | void disk_check_events(struct gendisk *disk) | 1506 | void disk_flush_events(struct gendisk *disk, unsigned int mask) |
1504 | { | 1507 | { |
1505 | struct disk_events *ev = disk->ev; | 1508 | struct disk_events *ev = disk->ev; |
1506 | unsigned long flags; | ||
1507 | 1509 | ||
1508 | if (!ev) | 1510 | if (!ev) |
1509 | return; | 1511 | return; |
1510 | 1512 | ||
1511 | spin_lock_irqsave(&ev->lock, flags); | 1513 | spin_lock_irq(&ev->lock); |
1514 | ev->clearing |= mask; | ||
1512 | if (!ev->block) { | 1515 | if (!ev->block) { |
1513 | cancel_delayed_work(&ev->dwork); | 1516 | cancel_delayed_work(&ev->dwork); |
1514 | queue_delayed_work(system_nrt_wq, &ev->dwork, 0); | 1517 | queue_delayed_work(system_nrt_wq, &ev->dwork, 0); |
1515 | } | 1518 | } |
1516 | spin_unlock_irqrestore(&ev->lock, flags); | 1519 | spin_unlock_irq(&ev->lock); |
1517 | } | 1520 | } |
1518 | EXPORT_SYMBOL_GPL(disk_check_events); | ||
1519 | 1521 | ||
1520 | /** | 1522 | /** |
1521 | * disk_clear_events - synchronously check, clear and return pending events | 1523 | * disk_clear_events - synchronously check, clear and return pending events |
@@ -1705,7 +1707,7 @@ static int disk_events_set_dfl_poll_msecs(const char *val, | |||
1705 | mutex_lock(&disk_events_mutex); | 1707 | mutex_lock(&disk_events_mutex); |
1706 | 1708 | ||
1707 | list_for_each_entry(ev, &disk_events, node) | 1709 | list_for_each_entry(ev, &disk_events, node) |
1708 | disk_check_events(ev->disk); | 1710 | disk_flush_events(ev->disk, 0); |
1709 | 1711 | ||
1710 | mutex_unlock(&disk_events_mutex); | 1712 | mutex_unlock(&disk_events_mutex); |
1711 | 1713 | ||